-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
With respect to the following comments:
// Simulation problem
// Sometimes (like in MULM1) DBH is not set. AU is used in these cases just as a 6 bits counter testing if bits 5-0 are zero.
// But when adding something like 32'hXXXX0000, the simulator (incorrectly) will set *all the 32 bits* of the result as X.
If you look at IEEE1800-2017, you will see the following, in section 11.4.3 Arithmetic operators :
For the arithmetic operators, if any operand bit value is the unknown value x or the high-impedance value z,
then the entire result value shall be x.
That means that although in your case you naturally expect the low 16 output bits to not be affected by Xs on the upper 16 bits, this is not what the SystemVerilog spec says, so this is not a simulator bug, but more like a SystemVerilog gotcha.
Other than that, I would avoid the use of `synthesis translate_off altogether, and replace them with an `ifdef ... `endif:
- They are not defined by the language spec
- They do not nest.
- (My personal opinion) They are ugly, because we should never carry information in comments that cannot be ignored. (but it's OK to put optimization hints, for example, because you can safely ignore it).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels