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
22queue1.sv
33
4- ^EXIT=0$
4+ ^no properties$
5+ ^EXIT=10$
56^SIGNAL=0$
67--
78--
8- Parsing fails.
Original file line number Diff line number Diff line change 11module main ;
22
33 byte queue_of_bytes[$];
4- string queue_of_strings[$: 10 ] = { " foobar " } ;
4+ string queue_of_strings[$: 10 ];
55
66endmodule
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ IREP_ID_ONE(verilog_inside)
9494IREP_ID_ONE (verilog_unique )
9595IREP_ID_ONE (verilog_unique0 )
9696IREP_ID_ONE (verilog_priority )
97+ IREP_ID_ONE (verilog_queue )
9798IREP_ID_ONE (verilog_new )
9899IREP_ID_ONE (verilog_non_indexed_part_select )
99100IREP_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)
20742074 {
20752075 return " enum" ;
20762076 }
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+ }
20772083 else if (type.id () == ID_struct)
20782084 {
20792085 return " struct" ;
Original file line number Diff line number Diff line change @@ -2114,6 +2114,7 @@ variable_dimension:
21142114 unsized_dimension
21152115 | unpacked_dimension
21162116 | associative_dimension
2117+ | queue_dimension
21172118 ;
21182119
21192120variable_dimension_brace:
@@ -2126,6 +2127,13 @@ variable_dimension_brace:
21262127 }
21272128 ;
21282129
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+
21292137unsized_dimension: ' [' ' ]'
21302138 { init ($$, " unsized" ); }
21312139 ;
Original file line number Diff line number Diff line change @@ -447,6 +447,13 @@ typet verilog_typecheck_exprt::elaborate_type(const typet &src)
447447 // package::typedef
448448 return elaborate_package_scope_typedef (to_type_with_subtypes (src));
449449 }
450+ else if (src.id () == ID_verilog_queue)
451+ {
452+ // The subtype is the element type.
453+ auto tmp = to_type_with_subtype (src);
454+ tmp.subtype () = elaborate_type (tmp.subtype ());
455+ return std::move (tmp);
456+ }
450457 else
451458 {
452459 throw errort ().with_location (source_location)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ typet verilog_declaratort::merged_type(const typet &declaration_type) const
3434 typet *p = &result;
3535
3636 while (p->id () == ID_verilog_unpacked_array ||
37- p->id () == ID_verilog_associative_array)
37+ p->id () == ID_verilog_associative_array || p-> id () == ID_verilog_queue )
3838 {
3939 p = &to_type_with_subtype (*p).subtype ();
4040 }
You can’t perform that action at this time.
0 commit comments