task generat(int n)
trans tr;
tr=new();
repeat(n)
begin
tr.addr=$random();
$display("tr.addr=%h",tr.addr);
transmit(tr);
end
endtask
书上的解释说打印的addr是不一样的,但是transmit发送出去的addr都是一样的,怎么理解?
这是原版的书上写的
What are the symptoms of this mistake? The code above creates only one
Transaction, so every time through the loop, generator_bad changes the object
at the same time it is being transmitted. When you run this, the $display shows
many addr values, but all transmitted Transaction objects have the same value
of addr.
这是原版的
What are the symptoms of this mistake? The code above creates only one
Transaction, so every time through the loop, generator_bad changes the object
at the same time it is being transmitted. When you run this, the $display shows
many addr values, but all transmitted Transaction objects have the same value
of addr.
What are the symptoms of this mistake? The code above creates only one
Transaction, so every time through the loop, generator_bad changes the object
at the same time it is being transmitted. When you run this, the $display shows
many addr values, but all transmitted Transaction objects have the same value
of addr.