3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Verilog超絶初心者]$monitorの罠

Last updated at Posted at 2015-12-27

Icarus Verilogを使っています。

$monitorに、複数bit幅の信号のうち特定bitだけを入力しても変化を検出してくれないようです。

reg a, b;
reg[1:0] c;

initial begin
	c = 0;

	【うまくいかない例】
	$monitor ("%t: c[0] = %b, c[1] = %b", $time, c[0], c[1]);

			 
	#10	c = c+1; 
	#10	c = c+1; 


	【うまくいく例】
	$monitor ("%t: a = %b,  b = %b", $time, a, b);

			 a <= c[0]; b <= c[1];
	#10	c = c+1; a <= c[0]; b <= c[1];
	#10	c = c+1; a <= c[0]; b <= c[1];
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?