10
10
#define CPROVER_VERILOG_TYPES_H
11
11
12
12
#include < util/bitvector_types.h>
13
+ #include < util/ieee_float.h>
13
14
14
15
// / Used during elaboration only,
15
16
// / to signal that a symbol is yet to be elaborated.
@@ -162,6 +163,13 @@ class verilog_real_typet:public typet
162
163
{
163
164
return 64 ;
164
165
}
166
+
167
+ typet lower () const
168
+ {
169
+ auto type = ieee_float_spect::double_precision ().to_type ();
170
+ type.set (ID_C_verilog_type, ID_verilog_real);
171
+ return type;
172
+ }
165
173
};
166
174
167
175
// / 32-bit floating point
@@ -176,6 +184,13 @@ class verilog_shortreal_typet:public typet
176
184
{
177
185
return 32 ;
178
186
}
187
+
188
+ typet lower () const
189
+ {
190
+ auto type = ieee_float_spect::single_precision ().to_type ();
191
+ type.set (ID_C_verilog_type, ID_verilog_shortreal);
192
+ return type;
193
+ }
179
194
};
180
195
181
196
// / 64-bit floating point
@@ -190,6 +205,13 @@ class verilog_realtime_typet:public typet
190
205
{
191
206
return 64 ;
192
207
}
208
+
209
+ typet lower () const
210
+ {
211
+ auto type = ieee_float_spect::double_precision ().to_type ();
212
+ type.set (ID_C_verilog_type, ID_verilog_realtime);
213
+ return type;
214
+ }
193
215
};
194
216
195
217
// / 2-state data type, 16-bit signed integer
@@ -204,6 +226,13 @@ class verilog_shortint_typet : public typet
204
226
{
205
227
return 16 ;
206
228
}
229
+
230
+ typet lower () const
231
+ {
232
+ auto type = signedbv_typet{width ()};
233
+ type.set (ID_C_verilog_type, ID_verilog_shortint);
234
+ return type;
235
+ }
207
236
};
208
237
209
238
// / 2-state data type, 32-bit signed integer
@@ -221,7 +250,9 @@ class verilog_int_typet : public typet
221
250
222
251
typet lower () const
223
252
{
224
- return signedbv_typet{width ()};
253
+ auto type = signedbv_typet{width ()};
254
+ type.set (ID_C_verilog_type, ID_verilog_int);
255
+ return type;
225
256
}
226
257
};
227
258
@@ -237,6 +268,13 @@ class verilog_longint_typet : public typet
237
268
{
238
269
return 64 ;
239
270
}
271
+
272
+ typet lower () const
273
+ {
274
+ auto type = signedbv_typet{width ()};
275
+ type.set (ID_C_verilog_type, ID_verilog_longint);
276
+ return type;
277
+ }
240
278
};
241
279
242
280
// / 2-state data type, 8-bit signed integer
@@ -251,6 +289,13 @@ class verilog_byte_typet : public typet
251
289
{
252
290
return 8 ;
253
291
}
292
+
293
+ typet lower () const
294
+ {
295
+ auto type = signedbv_typet{width ()};
296
+ type.set (ID_C_verilog_type, ID_verilog_byte);
297
+ return type;
298
+ }
254
299
};
255
300
256
301
// / 2-state data type, for vectors, unsigned
0 commit comments