nemolee
Full Member level 3
I simulate my design by using NC-sim 5.3. I found a strange phenomenon when I saw the related simulation waveform. There is a bug occured. The below is my testbench code:
always @(lnbuf_m0_ADDR)
begin
lnbuf_m0_ADDR_d = #3 {1'b0, lnbuf_m0_ADDR};
end
When the lnbuf_m0_ADDR countes from 8'hFF to 8'h00, the number of lnbuf_m0_ADDR_d will be 9'h100. It is so strange to this result. In fact, the result will be 9'h000. But when I change my code style to this:
assign #3 lnbuf_m0_ADDR_d = {1'b0, lnbuf_m0_ADDR};
This bug will be disappear. The value of lnbuf_m0_ADDR_d is 9'h000. I tried to apply these code to modelsim, then the bug is also disappear. Who can explain this strange and funny experience? Thank you very much.
always @(lnbuf_m0_ADDR)
begin
lnbuf_m0_ADDR_d = #3 {1'b0, lnbuf_m0_ADDR};
end
When the lnbuf_m0_ADDR countes from 8'hFF to 8'h00, the number of lnbuf_m0_ADDR_d will be 9'h100. It is so strange to this result. In fact, the result will be 9'h000. But when I change my code style to this:
assign #3 lnbuf_m0_ADDR_d = {1'b0, lnbuf_m0_ADDR};
This bug will be disappear. The value of lnbuf_m0_ADDR_d is 9'h000. I tried to apply these code to modelsim, then the bug is also disappear. Who can explain this strange and funny experience? Thank you very much.