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 @@ -461,6 +461,13 @@ typet verilog_typecheck_exprt::elaborate_type(const typet &src)
461461 // package::typedef
462462 return elaborate_package_scope_typedef (to_verilog_package_scope_type (src));
463463 }
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+ }
464471 else
465472 {
466473 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
3535 typet *p = &result;
3636
3737 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 )
3939 {
4040 p = &to_type_with_subtype (*p).subtype ();
4141 }
You can’t perform that action at this time.
0 commit comments