B
bbrady
Guest
Hi everyone,
I'm a little confused about an issue with regs and wires. I know what
both are used for and the differences between the two. However, I just
stumbled across a detail in the verilog standard that confused me. If
you declare something as a reg, apparently, you aren't allowed to also
declare it as a wire. In Section 4.2.2 Variable Declarations, it
states that it is illegal to redeclare a name already declared by a
net, ...
I've seen many times a name declared as a wire and a reg. Until a
moment ago, I actually thought this was what you were supposed to do.
Was this the case in an older version of Verilog, or have I just seen
many examples of incorrectly written Verilog code?
Now, this brings me to another (more important) question. I'm working
on a tool that will automatically translate Verilog to a formal
language. In one of the designs I'm working with, there are many
signals declared as both wires and regs. What should I do? Correct the
Verilog so that signals aren't defined as both wires and regs? Or is
there some other way to deal with this?
Thanks,
bryan
I'm a little confused about an issue with regs and wires. I know what
both are used for and the differences between the two. However, I just
stumbled across a detail in the verilog standard that confused me. If
you declare something as a reg, apparently, you aren't allowed to also
declare it as a wire. In Section 4.2.2 Variable Declarations, it
states that it is illegal to redeclare a name already declared by a
net, ...
I've seen many times a name declared as a wire and a reg. Until a
moment ago, I actually thought this was what you were supposed to do.
Was this the case in an older version of Verilog, or have I just seen
many examples of incorrectly written Verilog code?
Now, this brings me to another (more important) question. I'm working
on a tool that will automatically translate Verilog to a formal
language. In one of the designs I'm working with, there are many
signals declared as both wires and regs. What should I do? Correct the
Verilog so that signals aren't defined as both wires and regs? Or is
there some other way to deal with this?
Thanks,
bryan