Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Some questions about NC-sim

Status
Not open for further replies.

nemolee

Full Member level 3
Joined
Dec 28, 2004
Messages
155
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Activity points
1,467
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.
 

Hi, nemolee,

Why do you add delay in the combination logic?

In your logic, if the lnbuf_m0_ADDR changes at time A, the RHS input values will be sampled and the output will be updated with the sampled values, while all other input changes during the next 3ns will not be evaluated.
So please check your frequency of your lnbuf_m0_ADDR countes. If it is less than 3ns, it can influence your changes.

Hope to help.

Good Luck.
 

I guess, NC-sim lost its mind, It forgot the right hand side concatenation which forces the bit 9 of lnbuf_m0_ADDR_d = 0.

In your always block, when lnbuf_m0_ADDR changes, the right hand side of your assignment is evaluated before the delay.
The simulator uses a temp variable to store lnbuf_m0_ADDR, and then 3ns later, your assginment statement is evaluated.
Because the Inbuf_m0_ADDR_d is 9 bits, the temp variable is 9 bit. So when lnbuf_m0_ADDR changes from 2'hFF -> 2'h00, the temp variable = 1FF.
After 3ns, the assignment statement is evaluate, the Inbuf_m0_ADDR_d is assigned to temp variable.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top