Skip to content

Usage of synthesis on / off #12

@udif

Description

@udif

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:

  1. They are not defined by the language spec
  2. They do not nest.
  3. (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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions