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.

delay in verilog code

Status
Not open for further replies.

neo_chip

Member level 1
Joined
Jul 14, 2006
Messages
34
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Location
INDIA
Activity points
1,450
always @(posedge clk `SC_FIFO_ASYNC_RESET)
if(!rst) cnt <= #1 {aw+1{1'b0}};
else
if(clr) cnt <= #1 {aw+1{1'b0}};
else
if( re & !we) cnt <= #1 cnt + { {aw{1'b1}}, 1'b1};
else
if(!re & we) cnt <= #1 cnt + { {aw{1'b0}}, 1'b1};

Hi everyone...........
this is a part of the code...........
why the "#1" delay is used for every assignment in the code..... whats the use.......

THNX
 

In simulation , this delay will assure right schduling sequence. But I think this is not unnessary since today's cycel_based simulating tools can assure this even without these delay.On the other hand , this delay will increase your simulating time for the simulating tool must tackle these delay.
 

another use is to have #1 delay so that the waveform display is easier to read.
but usually an experienced designer won't be confused by 0 delay waveform.
 

use #1,i think the function is make you simulation near to the true condition.it is will ignored in synthesis
 

this delay is to avoid potential clock skew or race condition or

hold time(for example, if register's output is output to a sdam model,

that will need hold time to be meet) problem in simulation.

best regards



neo_chip said:
always @(posedge clk `SC_FIFO_ASYNC_RESET)
if(!rst) cnt <= #1 {aw+1{1'b0}};
else
if(clr) cnt <= #1 {aw+1{1'b0}};
else
if( re & !we) cnt <= #1 cnt + { {aw{1'b1}}, 1'b1};
else
if(!re & we) cnt <= #1 cnt + { {aw{1'b0}}, 1'b1};

Hi everyone...........
this is a part of the code...........
why the "#1" delay is used for every assignment in the code..... whats the use.......

THNX
 

It is convenient for debug using debussy. Adding it or not will not affect simulation and systhsis.

I think it will not affect timing, including setup and hold timing. It just simulates the cell dalay.
 

We used this kind # delay is to avoid potential clock skew or race condition or
hold time at the i/o interface.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top