File tree Expand file tree Collapse file tree 7 files changed +27
-5
lines changed
regression/verilog/data-types Expand file tree Collapse file tree 7 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
queue1.sv
3
3
4
- ^EXIT=0$
4
+ ^no properties$
5
+ ^EXIT=10$
5
6
^SIGNAL=0$
6
7
--
7
8
--
8
- Parsing fails.
Original file line number Diff line number Diff line change 1
1
module main ;
2
2
3
3
byte queue_of_bytes[$];
4
- string queue_of_strings[$: 10 ] = { " foobar " } ;
4
+ string queue_of_strings[$: 10 ];
5
5
6
6
endmodule
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ IREP_ID_ONE(verilog_inside)
94
94
IREP_ID_ONE (verilog_unique )
95
95
IREP_ID_ONE (verilog_unique0 )
96
96
IREP_ID_ONE (verilog_priority )
97
+ IREP_ID_ONE (verilog_queue )
97
98
IREP_ID_ONE (verilog_new )
98
99
IREP_ID_ONE (verilog_non_indexed_part_select )
99
100
IREP_ID_ONE (verilog_indexed_part_select_plus )
Original file line number Diff line number Diff line change @@ -2074,6 +2074,12 @@ std::string expr2verilogt::convert(const typet &type)
2074
2074
{
2075
2075
return " enum" ;
2076
2076
}
2077
+ else if (type.id () == ID_verilog_queue)
2078
+ {
2079
+ std::string dest = " queue of " ;
2080
+ dest += convert (to_type_with_subtype (type).subtype ());
2081
+ return dest;
2082
+ }
2077
2083
else if (type.id () == ID_struct)
2078
2084
{
2079
2085
return " struct" ;
Original file line number Diff line number Diff line change @@ -2114,6 +2114,7 @@ variable_dimension:
2114
2114
unsized_dimension
2115
2115
| unpacked_dimension
2116
2116
| associative_dimension
2117
+ | queue_dimension
2117
2118
;
2118
2119
2119
2120
variable_dimension_brace:
@@ -2126,6 +2127,13 @@ variable_dimension_brace:
2126
2127
}
2127
2128
;
2128
2129
2130
+ queue_dimension:
2131
+ ' [' ' $' ' ]'
2132
+ { init ($$, ID_verilog_queue); stack_type ($$).add_subtype ().make_nil (); }
2133
+ | ' [' ' $' TOK_COLON constant_expression ' ]'
2134
+ { init ($$, ID_verilog_queue); stack_type ($$).add_subtype ().make_nil (); }
2135
+ ;
2136
+
2129
2137
unsized_dimension: ' [' ' ]'
2130
2138
{ init ($$, " unsized" ); }
2131
2139
;
Original file line number Diff line number Diff line change @@ -461,6 +461,13 @@ typet verilog_typecheck_exprt::elaborate_type(const typet &src)
461
461
// package::typedef
462
462
return elaborate_package_scope_typedef (to_verilog_package_scope_type (src));
463
463
}
464
+ else if (src.id () == ID_verilog_queue)
465
+ {
466
+ // The subtype is the element type.
467
+ auto tmp = to_type_with_subtype (src);
468
+ tmp.subtype () = elaborate_type (tmp.subtype ());
469
+ return std::move (tmp);
470
+ }
464
471
else
465
472
{
466
473
throw errort ().with_location (source_location)
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ typet verilog_declaratort::merged_type(const typet &declaration_type) const
35
35
typet *p = &result;
36
36
37
37
while (p->id () == ID_verilog_unpacked_array ||
38
- p->id () == ID_verilog_associative_array)
38
+ p->id () == ID_verilog_associative_array || p-> id () == ID_verilog_queue )
39
39
{
40
40
p = &to_type_with_subtype (*p).subtype ();
41
41
}
You can’t perform that action at this time.
0 commit comments