diff options
| author | azidar | 2015-12-10 19:32:43 -0800 |
|---|---|---|
| committer | azidar | 2016-01-16 14:28:17 -0800 |
| commit | 5dfed8b731764834e4d16197d4f8c31f16daff75 (patch) | |
| tree | ad407f410e590700e4bf38312cf2acbd0d59f9ed /src/main/stanza/ir-utils.stanza | |
| parent | 0246ab2479724fb0118bb7a25577c71e2a038223 (diff) | |
Finished supporting nested accesses. Required some nuianced thinking. Pass all feature tests. Deleted CondRead because it tested a problem we don't have any more
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
| -rw-r--r-- | src/main/stanza/ir-utils.stanza | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza index a0942d50..7201b8ed 100644 --- a/src/main/stanza/ir-utils.stanza +++ b/src/main/stanza/ir-utils.stanza @@ -87,9 +87,13 @@ public defn BoolType () : UIntType(IntWidth(1)) public val zero = UIntValue(BigIntLit(0),IntWidth(1)) public val one = UIntValue(BigIntLit(1),IntWidth(1)) public defn uint (i:Int) -> UIntValue : - UIntValue(BigIntLit(i),UnknownWidth()) + val num-bits = req-num-bits(i) + val w = IntWidth(max(1,num-bits - 1)) + UIntValue(BigIntLit(i),w) public defn sint (i:Int) -> SIntValue : - SIntValue(BigIntLit(i),UnknownWidth()) + val num-bits = req-num-bits(i) + val w = IntWidth(max(1,num-bits)) + SIntValue(BigIntLit(i),w) public defn AND (e1:Expression,e2:Expression) -> Expression : if e1 == e2 : e1 |
