D
David Rogoff
Guest
I need some guru clarification on an issue. I tried google and the
bnf, but I'm still not sure. I have some old RTL code I had to look
at that had something like this (simplified):
reg [MSB_PARAM-1:0] a_reg;
always @ ...
if (a_reg) begin
blah blah ...
end
Supposedly, a_reg will be considered true if any of the bits are
non-zero. It's not very clear, but it seems like it works with
various tools.
What's the preferred way?
if (a_reg != MSB_PARAM'b0)
if (|a_reg)
if (|a_reg = 1'b1)
Can someone please point me to some specific documentation that covers
this case? Also, any examples of this failing would be useful.
Thanks,
David
bnf, but I'm still not sure. I have some old RTL code I had to look
at that had something like this (simplified):
reg [MSB_PARAM-1:0] a_reg;
always @ ...
if (a_reg) begin
blah blah ...
end
Supposedly, a_reg will be considered true if any of the bits are
non-zero. It's not very clear, but it seems like it works with
various tools.
What's the preferred way?
if (a_reg != MSB_PARAM'b0)
if (|a_reg)
if (|a_reg = 1'b1)
Can someone please point me to some specific documentation that covers
this case? Also, any examples of this failing would be useful.
Thanks,
David