Skip to content

SNat output always 64-bits #3120

@DigitalBrains1

Description

@DigitalBrains1

If you produce an SNat on an output port, it will always output 64 bits even if the number is larger:

topEntity ::
  SNat 70_000_000_000_000_000_000
topEntity = SNat
{-# OPAQUE topEntity #-}

generates Verilog:

module topEntity
    ( // No inputs
      // Outputs
      output wire [63:0] result
    );
  assign result = 64'd14659767778871345152;
endmodule

That's the number truncated to 64 unsigned bits.

I'd expect a 32-bit machine to produce 32 bits, by the way; mentioning this for completeness' sake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions