Open lkolbly opened 2 years ago
So Verilog has the replication operator: N{X} which repeats X N times. That's useful for things like:
N{X}
s_tready[t] = (m_tready[t] & m_tvalid[t]) ++ (m_tready[t] & m_tvalid[t]);
where you want to smear the same value across a new value.
Also, it has a variety of reduction operators: https://verilogcodes.blogspot.com/2015/10/unary-or-reduction-operators-in-verilog.html e.g. &x (in isolation) ANDs all the bits within x together.
&x
These concepts may be things that only apply to array-types. For example, &x where x is a bits<32>[5] I would expect would be something like x[0] & x[1] & x[2] & x[3] & x[4].
x
bits<32>[5]
x[0] & x[1] & x[2] & x[3] & x[4]
So Verilog has the replication operator:
N{X}
which repeats X N times. That's useful for things like:where you want to smear the same value across a new value.
Also, it has a variety of reduction operators: https://verilogcodes.blogspot.com/2015/10/unary-or-reduction-operators-in-verilog.html e.g.
&x
(in isolation) ANDs all the bits within x together.These concepts may be things that only apply to array-types. For example,
&x
wherex
is abits<32>[5]
I would expect would be something likex[0] & x[1] & x[2] & x[3] & x[4]
.