0
\$\begingroup\$

I used an IP from Lattice FPGA and looked in their code.

they use this bullets of verilog code there:

 // -----------------------------------------------------------
// gclk gate control2 on falling edge to prevent runt 
// -----------------------------------------------------------
always @(negedge hclk or negedge reset_n) begin
 if (~reset_n) begin
 gate_clk_ctl2 <= #1 1'b1;
 end
 else begin
 gate_clk_ctl2 <= #1 !orc_ack_1d;
 end
end

....

..

.

 //-------------------------------------------------------------------
// Latch data and address into internal reg clocked by hclk
//-------------------------------------------------------------------
always @(posedge hclk or negedge reset_n) begin
 if (~reset_n) begin
 reg_di[25:0] <= #1 26'h0000000;
 end
 else begin
if (pc_rdy_pulse) begin
 reg_di[25:0] <= #1 sreg_di[25:0];
 end
 end
end

I don't understand this syntax what this "#1" doing? what this logic does?

I know #x in verilog is delay.. but this is synthesizable code, so I dont understand how does it work.

Thanks.

alex.forencich
41.7k1 gold badge71 silver badges110 bronze badges
asked Jun 24, 2020 at 5:32
\$\endgroup\$
1
  • \$\begingroup\$ Probably so they can see the propagation during simulation? \$\endgroup\$ Commented Jun 24, 2020 at 5:58

1 Answer 1

1
\$\begingroup\$

Delays specified in this way only affect simulation; they are removed during synthesis.

answered Jun 25, 2020 at 5:02
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.