Skip to content

Add unit-test for LRM 3.0 Section 7.2 "Integer types" #37

@LeeKaiXuan

Description

@LeeKaiXuan

Syntax

integer_type ::= integer_atom_type
  [ [ constant_expression [ : 0 ] ] ]
  [ in [ domain_open_range_list ] ]
integer_atom_type ::=
    int
  | bit
domain_open_range_list ::= domain_open_range_value { , domain_open_range_value }
domain_open_range_value ::=
    constant_expression [ .. constant_expression ]
  | constant_expression ..
  | .. constant_expression

Rules

  • Integer values of bit type are unsigned.
  • Integer values of int type are signed.
  • The default value of the bit and int types is 0.
  • The default width of bit type is 1 bit and default domain is 0..1.
  • The default width of int type is 32 bits and default domain is -2**(31)..(2**(31)-1).
  • Widths should be specified with a single expression with a constant positive integer value (e.g., bit[4]).
  • A value domain may be specified for the type.
  • The domain specification consists of a list of one or more values and/or value ranges.
  • The width and value domain specifications are independent.
  • A variable of the declared type can hold values within the intersection of the possible values determined by the specified width (or the default width, if not specified) and the explicit value domain specification, if present.

Metadata

Metadata

Assignees

Labels

testAdding new or improve test case

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions