cucapra / dahlia

Time-sensitive affine types for predictable hardware generation
https://capra.cs.cornell.edu/dahlia
MIT License
130 stars 8 forks source link

Parse error in let expression for bitwidth 32 and above #408

Closed Mark1626 closed 8 months ago

Mark1626 commented 8 months ago

Parsing the following will fail because EInt uses Int type

let x: ubit<32> = 0xffffffff;

Error message:

For input string: "ffffffff"

https://github.com/cucapra/dahlia/blob/f3735bcf6d249ee067fc9dc6fceb833f6bb1139e/src/main/scala/common/Syntax.scala#L138

Suggestion:

Changing EInt to use BigInt will fix the parse error. Subsequently TStaticInt will also have to use BigInt

https://github.com/cucapra/dahlia/blob/f3735bcf6d249ee067fc9dc6fceb833f6bb1139e/src/main/scala/common/Syntax.scala#L84