1
1
// RUN: circt-opt %s --canonicalize | FileCheck --strict-whitespace %s
2
2
3
3
// CHECK-LABEL: hw.module @constant_fold0
4
- // CHECK: sim.fmt.lit ",0,0,;0,0, 0,0;1,1,-1,1;0011, 3, 3,3;01010,10, 10,0a;10000000,128,-128,80;0000001100101011111110, 51966, 51966,00cafe"
4
+ // CHECK: sim.fmt.literal ",0,0,;0,0, 0,0;1,1,-1,1;0011, 3, 3,3;01010,10, 10,0a;10000000,128,-128,80;0000001100101011111110, 51966, 51966,00cafe"
5
5
hw.module @constant_fold0 (in %zeroWitdh: i0 , out res : !sim.fstring ) {
6
- %comma = sim.fmt.lit " ,"
7
- %semicolon = sim.fmt.lit " ;"
6
+ %comma = sim.fmt.literal " ,"
7
+ %semicolon = sim.fmt.literal " ;"
8
8
9
9
%nocat = sim.fmt.concat ()
10
10
@@ -62,13 +62,13 @@ hw.module @constant_fold0(in %zeroWitdh: i0, out res: !sim.fstring) {
62
62
}
63
63
64
64
// CHECK-LABEL: hw.module @constant_fold1
65
- // CHECK: sim.fmt.lit " %b: '111111111111111111111111111111111111111111111111111000110100000010010001001010111001101011110010101010110010011011001001110' %u: '10633823966279322740806214058000332366' %d: ' -4242424242424242424242' %x: '7ffffffffffff1a04895cd79559364e'"
65
+ // CHECK: sim.fmt.literal " %b: '111111111111111111111111111111111111111111111111111000110100000010010001001010111001101011110010101010110010011011001001110' %u: '10633823966279322740806214058000332366' %d: ' -4242424242424242424242' %x: '7ffffffffffff1a04895cd79559364e'"
66
66
hw.module @constant_fold1 (out res : !sim.fstring ) {
67
- %preb = sim.fmt.lit " %b: '"
68
- %preu = sim.fmt.lit " %u: '"
69
- %pres = sim.fmt.lit " %d: '"
70
- %preh = sim.fmt.lit " %x: '"
71
- %q = sim.fmt.lit " '"
67
+ %preb = sim.fmt.literal " %b: '"
68
+ %preu = sim.fmt.literal " %u: '"
69
+ %pres = sim.fmt.literal " %d: '"
70
+ %preh = sim.fmt.literal " %x: '"
71
+ %q = sim.fmt.literal " '"
72
72
73
73
%cst42_123 = hw.constant -4242424242424242424242 : i123
74
74
%w123b42 = sim.fmt.bin %cst42_123 : i123
@@ -82,22 +82,22 @@ hw.module @constant_fold1(out res: !sim.fstring) {
82
82
83
83
// CHECK-LABEL: hw.module @constant_fold2
84
84
hw.module @constant_fold2 (in %foo: i1027 , out res : !sim.fstring ) {
85
- // CHECK: [[SDS:%.+]] = sim.fmt.lit " - "
85
+ // CHECK: [[SDS:%.+]] = sim.fmt.literal " - "
86
86
// CHECK: [[HEX:%.+]] = sim.fmt.hex %foo : i1027
87
87
// CHECK: [[CAT:%.+]] = sim.fmt.concat ([[SDS]], [[HEX]], [[SDS]])
88
88
// CHECK: hw.output [[CAT]] : !sim.fstring
89
89
90
- %space = sim.fmt.lit " "
91
- %dash = sim.fmt.lit " -"
92
- %spaceDashSpace = sim.fmt.lit " - "
90
+ %space = sim.fmt.literal " "
91
+ %dash = sim.fmt.literal " -"
92
+ %spaceDashSpace = sim.fmt.literal " - "
93
93
%hex = sim.fmt.hex %foo : i1027
94
94
95
95
%res = sim.fmt.concat (%spaceDashSpace , %hex , %space , %dash , %space )
96
96
hw.output %res : !sim.fstring
97
97
}
98
98
99
99
// CHECK-LABEL: hw.module @constant_fold3
100
- // CHECK: sim.fmt.lit "Foo\0A\0D\00Foo\00\C8"
100
+ // CHECK: sim.fmt.literal "Foo\0A\0D\00Foo\00\C8"
101
101
hw.module @constant_fold3 (in %zeroWitdh: i0 , out res : !sim.fstring ) {
102
102
%F = hw.constant 70 : i7
103
103
%o = hw.constant 111 : i8
@@ -120,27 +120,27 @@ hw.module @constant_fold3(in %zeroWitdh: i0, out res: !sim.fstring) {
120
120
121
121
122
122
// CHECK-LABEL: hw.module @flatten_concat1
123
- // CHECK-DAG: %[[LH:.+]] = sim.fmt.lit "Hex: "
124
- // CHECK-DAG: %[[LD:.+]] = sim.fmt.lit "Dec: "
125
- // CHECK-DAG: %[[LB:.+]] = sim.fmt.lit "Bin: "
123
+ // CHECK-DAG: %[[LH:.+]] = sim.fmt.literal "Hex: "
124
+ // CHECK-DAG: %[[LD:.+]] = sim.fmt.literal "Dec: "
125
+ // CHECK-DAG: %[[LB:.+]] = sim.fmt.literal "Bin: "
126
126
// CHECK-DAG: %[[FH:.+]] = sim.fmt.hex %val : i8
127
127
// CHECK-DAG: %[[FD:.+]] = sim.fmt.dec %val : i8
128
128
// CHECK-DAG: %[[FB:.+]] = sim.fmt.bin %val : i8
129
129
// CHECK-DAG: %[[CAT:.+]] = sim.fmt.concat (%[[LB]], %[[FB]], %[[LD]], %[[FD]], %[[LH]], %[[FH]])
130
130
// CHECK: hw.output %[[CAT]] : !sim.fstring
131
131
132
132
hw.module @flatten_concat1 (in %val : i8 , out res : !sim.fstring ) {
133
- %binLit = sim.fmt.lit " Bin: "
133
+ %binLit = sim.fmt.literal " Bin: "
134
134
%binVal = sim.fmt.bin %val : i8
135
135
%binCat = sim.fmt.concat (%binLit , %binVal )
136
136
137
- %decLit = sim.fmt.lit " Dec: "
137
+ %decLit = sim.fmt.literal " Dec: "
138
138
%decVal = sim.fmt.dec %val : i8
139
139
%decCat = sim.fmt.concat (%decLit , %decVal , %nocat )
140
140
141
141
%nocat = sim.fmt.concat ()
142
142
143
- %hexLit = sim.fmt.lit " Hex: "
143
+ %hexLit = sim.fmt.literal " Hex: "
144
144
%hexVal = sim.fmt.hex %val : i8
145
145
%hexCat = sim.fmt.concat (%hexLit , %hexVal )
146
146
@@ -149,14 +149,14 @@ hw.module @flatten_concat1(in %val : i8, out res: !sim.fstring) {
149
149
}
150
150
151
151
// CHECK-LABEL: hw.module @flatten_concat2
152
- // CHECK-DAG: %[[F:.+]] = sim.fmt.lit "Foo"
153
- // CHECK-DAG: %[[FF:.+]] = sim.fmt.lit "FooFoo"
152
+ // CHECK-DAG: %[[F:.+]] = sim.fmt.literal "Foo"
153
+ // CHECK-DAG: %[[FF:.+]] = sim.fmt.literal "FooFoo"
154
154
// CHECK-DAG: %[[CHR:.+]] = sim.fmt.char %val : i8
155
155
// CHECK-DAG: %[[CAT:.+]] = sim.fmt.concat (%[[F]], %[[CHR]], %[[FF]], %[[CHR]], %[[FF]], %[[CHR]], %[[FF]], %[[CHR]], %[[FF]], %[[CHR]], %[[F]])
156
156
// CHECK: hw.output %[[CAT]] : !sim.fstring
157
157
158
158
hw.module @flatten_concat2 (in %val : i8 , out res : !sim.fstring ) {
159
- %foo = sim.fmt.lit " Foo"
159
+ %foo = sim.fmt.literal " Foo"
160
160
%char = sim.fmt.char %val : i8
161
161
162
162
%c = sim.fmt.concat (%foo , %char , %foo )
0 commit comments