File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
regression/verilog/data-types Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ CORE
2
+ signed1.sv
3
+ --bound 0
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
Original file line number Diff line number Diff line change
1
+ module main ;
2
+
3
+ wire signed one_bit_signed = - 1 ;
4
+
5
+ assert final (one_bit_signed == - 1 );
6
+ assert final ($bits (one_bit_signed) == 1 );
7
+
8
+ wire unsigned one_bit_unsigned = 1 ;
9
+
10
+ assert final (one_bit_unsigned == 1 );
11
+ assert final ($bits (one_bit_unsigned) == 1 );
12
+
13
+ endmodule
Original file line number Diff line number Diff line change @@ -166,6 +166,16 @@ typet verilog_typecheck_exprt::elaborate_type(const typet &src)
166
166
// it's just a bit
167
167
return bool_typet ().with_source_location (source_location);
168
168
}
169
+ else if (src.id () == ID_signed)
170
+ {
171
+ // one bit, signed
172
+ return signedbv_typet{1 }.with_source_location (source_location);
173
+ }
174
+ else if (src.id () == ID_unsigned)
175
+ {
176
+ // one bit, unsigned
177
+ return unsignedbv_typet{1 }.with_source_location (source_location);
178
+ }
169
179
else if (src.id () == ID_verilog_byte)
170
180
{
171
181
return signedbv_typet{8 }.with_source_location (source_location);
You can’t perform that action at this time.
0 commit comments