P
Paul Marciano
Guest
Hi. As a beginner I'd appreciate a critique of my coding style.
always @(posedge clk)
r <= #1 a | b;
wire #1 w = a | b;
assign #1 x = a | b;
always @*
begin
j = #1 a | b;
k = #1 a | b;
end
The delays are, of course, for waveform viewing behavioral simulations.
Looking at other people's code, I see non-blocking delays, but I've not
seen wire, assign and blocking delays (I think the always @* block ends
up with k assigned after #2).
I've also noted some people preferring a `define non-blocking delay
that they can remove to speed up simulation.
So, from a style perspective, what delays do you add in your code and
why? Do you add wire and continuous assign delays or do you just delay
non-blocking assignments? Do you `define your delays?
Thanks for the input.
Paul.
always @(posedge clk)
r <= #1 a | b;
wire #1 w = a | b;
assign #1 x = a | b;
always @*
begin
j = #1 a | b;
k = #1 a | b;
end
The delays are, of course, for waveform viewing behavioral simulations.
Looking at other people's code, I see non-blocking delays, but I've not
seen wire, assign and blocking delays (I think the always @* block ends
up with k assigned after #2).
I've also noted some people preferring a `define non-blocking delay
that they can remove to speed up simulation.
So, from a style perspective, what delays do you add in your code and
why? Do you add wire and continuous assign delays or do you just delay
non-blocking assignments? Do you `define your delays?
Thanks for the input.
Paul.