From 724d7d42827e2287880bc4b61957ac5e3862bfdf Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 26 Mar 2022 16:40:32 +0100 Subject: [PATCH 1/3] Consolidate unpacked array type elaboration There are currently two implementations for elaborating unpacked array types. One that is used when elaborating a signal with an unpacked array type and one that is used everywhere else using the elaborate_type() infrastructure. The elaborate_type() implementation is less complete and for example does not support bounded queue types. Consolidate both into a single implementation to reduce duplicated code and get consistent behavior. This for example makes sure that the maximum queue size is respected when used as a function return type. Nested data structures of arrays, dynamic arrays or queues are not yet supported. In the current implementation when encountering such a type an assert will be triggered and the application crashes. In the new implementation an error message will be printed without crashing the application. Signed-off-by: Lars-Peter Clausen --- elab_sig.cc | 152 ++++------------------- elab_type.cc | 168 +++++++++++++++++++++----- ivtest/gold/sv_queue_parray_fail.gold | 6 +- ivtest/gold/sv_queue_real_fail.gold | 6 +- ivtest/gold/sv_queue_string_fail.gold | 6 +- ivtest/gold/sv_queue_vec_fail.gold | 6 +- pform_types.h | 4 + 7 files changed, 175 insertions(+), 173 deletions(-) diff --git a/elab_sig.cc b/elab_sig.cc index 83bc2ce5c..8c2e7d2b5 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -965,28 +965,6 @@ ivl_type_t PWire::elaborate_type(Design*des, NetScope*scope, return vec; } -ivl_type_t PWire::elaborate_darray_type(Design*des, NetScope*scope, - const char *darray_type, - const std::vector&packed_dimensions) - const -{ - ivl_type_t type = elaborate_type(des, scope, packed_dimensions); - - if (dynamic_cast(type) || - dynamic_cast(type) || - dynamic_cast(type) || - dynamic_cast(type)) - return type; - - cerr << get_fileline() << ": Sorry: " - << darray_type << " of type `" << *type - << "` is not yet supported." << endl; - des->errors++; - - // Return something to recover - return new netvector_t(IVL_VT_LOGIC); -} - /* * Elaborate a source wire. The "wire" is the declaration of wires, * registers, ports and memories. The parser has already merged the @@ -1136,86 +1114,6 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const attrib_list_t*attrib_list = evaluate_attributes(attributes, nattrib, des, scope); - - listunpacked_dimensions; - netdarray_t*netdarray = 0; - - for (list::const_iterator cur = unpacked_.begin() - ; cur != unpacked_.end() ; ++cur) { - PExpr*use_lidx = cur->first; - PExpr*use_ridx = cur->second; - - // Special case: If we encounter an undefined - // dimensions, then turn this into a dynamic array and - // put all the packed dimensions there. - if (use_lidx==0 && use_ridx==0) { - ivl_type_t base_type = elaborate_darray_type(des, - array_type_scope, - "Dynamic array", - packed_dimensions); - packed_dimensions.clear(); - ivl_assert(*this, netdarray==0); - netdarray = new netdarray_t(base_type); - continue; - } - - // Special case: Detect the mark for a QUEUE - // declaration, which is the dimensions [null:max_idx]. - if (dynamic_cast(use_lidx)) { - ivl_type_t base_type = elaborate_darray_type(des, - array_type_scope, - "Queue", - packed_dimensions); - packed_dimensions.clear(); - ivl_assert(*this, netdarray==0); - long max_idx; - if (use_ridx) { - NetExpr*tmp = elab_and_eval(des, array_type_scope, use_ridx, - -1, true); - NetEConst*cv = dynamic_cast(tmp); - if (cv == 0) { - cerr << get_fileline() << ": error: queue '" << name_ - << "' bound must be a constant!" << endl; - des->errors += 1; - max_idx = -1; - } else { - verinum res = cv->value(); - if (res.is_defined()) { - max_idx = res.as_long(); - if (max_idx < 0) { - cerr << get_fileline() << ": error: queue '" - << name_ << "' bound must be positive (" - << max_idx << ")!" << endl; - des->errors += 1; - max_idx = -1; - } - } else { - cerr << get_fileline() << ": error: queue '" << name_ - << "' bound is undefined!" << endl; - des->errors += 1; - max_idx = -1; - } - } - } else max_idx = -1; - netdarray = new netqueue_t(base_type, max_idx); - continue; - } - - // Cannot handle dynamic arrays/queues of arrays yet. - ivl_assert(*this, netdarray==0); - - long index_l, index_r; - evaluate_range(des, array_type_scope, this, *cur, index_l, index_r); - - if (abs(index_r - index_l) > warn_dimension_size) { - cerr << get_fileline() << ": warning: Array dimension " - "is greater than " << warn_dimension_size - << "." << endl; - } - - unpacked_dimensions.push_back(netrange_t(index_l, index_r)); - } - if (data_type_ == IVL_VT_REAL && !packed_dimensions.empty()) { cerr << get_fileline() << ": error: real "; if (wtype == NetNet::REG) cerr << "variable"; @@ -1263,37 +1161,31 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const wtype = NetNet::WIRE; } + ivl_type_t type = elaborate_type(des, array_type_scope, packed_dimensions); + // Create the type for the unpacked dimensions. If the + // unpacked_dimensions are empty this will just return the base type. + type = elaborate_array_type(des, array_type_scope, *this, type, unpacked_); - NetNet*sig = 0; - - if (netdarray) { - - if (debug_elaborate) { - cerr << get_fileline() << ": PWire::elaborate_sig: " - << "Create signal wtype=" << wtype - << " name=" << name_ - << " netdarray=" << *netdarray - << " in scope " << scope_path(scope) << endl; - } - - ivl_assert(*this, packed_dimensions.empty()); - ivl_assert(*this, unpacked_dimensions.empty()); - sig = new NetNet(scope, name_, wtype, netdarray); - - } else { - ivl_type_t use_type = elaborate_type(des, array_type_scope, - packed_dimensions); - - if (debug_elaborate) { - cerr << get_fileline() << ": debug: Create signal " - << wtype << " " << *set_data_type_ - << " " << name_ << unpacked_dimensions - << " in scope " << scope_path(scope) << endl; - } - - sig = new NetNet(scope, name_, wtype, unpacked_dimensions, use_type); + list unpacked_dimensions; + // If this is an unpacked array extract the base type and unpacked + // dimensions as these are separate properties of the NetNet. + if (const netuarray_t *atype = dynamic_cast(type)) { + unpacked_dimensions.insert(unpacked_dimensions.begin(), + atype->static_dimensions().begin(), + atype->static_dimensions().end()); + type = atype->element_type(); } + if (debug_elaborate) { + cerr << get_fileline() << ": debug: Create signal " << wtype; + if (set_data_type_) + cout << " " << *set_data_type_; + cout << name_ << unpacked_dimensions << " in scope " + << scope_path(scope) << endl; + } + + NetNet*sig = new NetNet(scope, name_, wtype, unpacked_dimensions, type); + if (wtype == NetNet::WIRE) sig->devirtualize_pins(); sig->set_line(*this); sig->port_type(port_type_); diff --git a/elab_type.cc b/elab_type.cc index 4471e1b28..338926ef1 100644 --- a/elab_type.cc +++ b/elab_type.cc @@ -222,39 +222,145 @@ ivl_type_t struct_type_t::elaborate_type_raw(Design*des, NetScope*scope) const return res; } +static ivl_type_t elaborate_darray_check_type(Design *des, const LineInfo &li, + ivl_type_t type, + const char *darray_type) +{ + if (dynamic_cast(type) || + dynamic_cast(type) || + dynamic_cast(type) || + dynamic_cast(type)) + return type; + + cerr << li.get_fileline() << ": Sorry: " + << darray_type << " of type `" << *type + << "` is not yet supported." << endl; + des->errors++; + + // Return something to recover + return new netvector_t(IVL_VT_LOGIC); +} + +static ivl_type_t elaborate_queue_type(Design *des, NetScope *scope, + const LineInfo &li, ivl_type_t base_type, + PExpr *ridx) +{ + base_type = elaborate_darray_check_type(des, li, base_type, "Queue"); + + long max_idx = -1; + if (ridx) { + NetExpr*tmp = elab_and_eval(des, scope, ridx, -1, true); + NetEConst*cv = dynamic_cast(tmp); + if (cv == 0) { + cerr << li.get_fileline() << ": error: " + << "queue bound must be constant." + << endl; + des->errors++; + } else { + verinum res = cv->value(); + if (res.is_defined()) { + max_idx = res.as_long(); + if (max_idx < 0) { + cerr << li.get_fileline() << ": error: " + << "queue bound must be positive (" + << max_idx << ")." << endl; + des->errors++; + max_idx = -1; + } + } else { + cerr << li.get_fileline() << ": error: " + << "queue bound must be defined." + << endl; + des->errors++; + } + } + delete cv; + } + + return new netqueue_t(base_type, max_idx); +} + +// If dims is not empty create a unpacked array type and clear dims, otherwise +// return the base type. Also check that we actually support the base type. +static ivl_type_t elaborate_static_array_type(Design *des, const LineInfo &li, + ivl_type_t base_type, + std::vector &dims) +{ + if (dims.empty()) + return base_type; + + if (dynamic_cast(base_type)) { + cerr << li.get_fileline() << ": sorry: " + << "array of queue type is not yet supported." + << endl; + des->errors++; + // Recover + base_type = new netvector_t(IVL_VT_LOGIC); + } else if (dynamic_cast(base_type)) { + cerr << li.get_fileline() << ": sorry: " + << "array of dynamic array type is not yet supported." + << endl; + des->errors++; + // Recover + base_type = new netvector_t(IVL_VT_LOGIC); + } + + ivl_type_t type = new netuarray_t(dims, base_type); + dims.clear(); + + return type; +} + +ivl_type_t elaborate_array_type(Design *des, NetScope *scope, + const LineInfo &li, ivl_type_t base_type, + const list &dims) +{ + const long warn_dimension_size = 1 << 30; + std::vector dimensions; + dimensions.reserve(dims.size()); + + ivl_type_t type = base_type; + + for (list::const_iterator cur = dims.begin(); + cur != dims.end() ; ++cur) { + PExpr *lidx = cur->first; + PExpr *ridx = cur->second; + + if (lidx == 0 && ridx == 0) { + // Special case: If we encounter an undefined dimensions, + // then turn this into a dynamic array and put all the + // packed dimensions there. + type = elaborate_static_array_type(des, li, type, dimensions); + type = elaborate_darray_check_type(des, li, type, "Dynamic array"); + type = new netdarray_t(type); + continue; + } else if (dynamic_cast(lidx)) { + // Special case: Detect the mark for a QUEUE declaration, + // which is the dimensions [null:max_idx]. + type = elaborate_static_array_type(des, li, type, dimensions); + type = elaborate_queue_type(des, scope, li, type, ridx); + continue; + } + + long index_l, index_r; + evaluate_range(des, scope, &li, *cur, index_l, index_r); + + if (abs(index_r - index_l) > warn_dimension_size) { + cerr << li.get_fileline() << ": warning: " + << "Array dimension is greater than " + << warn_dimension_size << "." + << endl; + } + + dimensions.push_back(netrange_t(index_l, index_r)); + } + + return elaborate_static_array_type(des, li, type, dimensions); +} + ivl_type_t uarray_type_t::elaborate_type_raw(Design*des, NetScope*scope) const { - ivl_type_t btype = base_type->elaborate_type(des, scope); - assert(dims->size() >= 1); - list::const_iterator cur = dims->begin(); - - // Special case: if the dimension is nil:nil, this is a - // dynamic array. Note that we only know how to handle dynamic - // arrays with 1 dimension at a time. - if (cur->first==0 && cur->second==0) { - assert(dims->size()==1); - ivl_type_s*res = new netdarray_t(btype); - return res; - } - - // Special case: if the dimension is null:nil. this is a queue. - if (dynamic_cast(cur->first)) { - // FIXME: Need to set the max size if cur->second is defined - ivl_type_s*res = new netqueue_t(btype, -1); - return res; - } - - vector dimensions; - bool dimensions_ok = evaluate_ranges(des, scope, this, dimensions, *dims); - - if (!dimensions_ok) { - cerr << get_fileline() << " : warning: " - << "Bad dimensions for type here." << endl; - } - - ivl_assert(*this, btype); - ivl_type_s*res = new netuarray_t(dimensions, btype); - return res; + return elaborate_array_type(des, scope, *this, btype, *dims.get()); } diff --git a/ivtest/gold/sv_queue_parray_fail.gold b/ivtest/gold/sv_queue_parray_fail.gold index 8bf76072b..b84d7f50e 100644 --- a/ivtest/gold/sv_queue_parray_fail.gold +++ b/ivtest/gold/sv_queue_parray_fail.gold @@ -1,7 +1,7 @@ -./ivltests/sv_queue_parray_fail.v:7: error: queue 'q_vec1' bound must be positive (-1)! -./ivltests/sv_queue_parray_fail.v:8: error: queue 'q_vec2' bound is undefined! +./ivltests/sv_queue_parray_fail.v:7: error: queue bound must be positive (-1). +./ivltests/sv_queue_parray_fail.v:8: error: queue bound must be defined. ./ivltests/sv_queue_parray_fail.v:9: error: A reference to a wire or reg (`bound') is not allowed in a constant expression. -./ivltests/sv_queue_parray_fail.v:9: error: queue 'q_vec3' bound must be a constant! +./ivltests/sv_queue_parray_fail.v:9: error: queue bound must be constant. ./ivltests/sv_queue_parray_fail.v:12: error: size() method takes no arguments ./ivltests/sv_queue_parray_fail.v:13: error: pop_front() method takes no arguments ./ivltests/sv_queue_parray_fail.v:14: error: pop_back() method takes no arguments diff --git a/ivtest/gold/sv_queue_real_fail.gold b/ivtest/gold/sv_queue_real_fail.gold index dd358f2b6..4c14bf9c8 100644 --- a/ivtest/gold/sv_queue_real_fail.gold +++ b/ivtest/gold/sv_queue_real_fail.gold @@ -1,7 +1,7 @@ -./ivltests/sv_queue_real_fail.v:4: error: queue 'q_real1' bound must be positive (-1)! -./ivltests/sv_queue_real_fail.v:5: error: queue 'q_real2' bound is undefined! +./ivltests/sv_queue_real_fail.v:4: error: queue bound must be positive (-1). +./ivltests/sv_queue_real_fail.v:5: error: queue bound must be defined. ./ivltests/sv_queue_real_fail.v:6: error: A reference to a wire or reg (`bound') is not allowed in a constant expression. -./ivltests/sv_queue_real_fail.v:6: error: queue 'q_real3' bound must be a constant! +./ivltests/sv_queue_real_fail.v:6: error: queue bound must be constant. ./ivltests/sv_queue_real_fail.v:9: error: size() method takes no arguments ./ivltests/sv_queue_real_fail.v:10: error: pop_front() method takes no arguments ./ivltests/sv_queue_real_fail.v:11: error: pop_back() method takes no arguments diff --git a/ivtest/gold/sv_queue_string_fail.gold b/ivtest/gold/sv_queue_string_fail.gold index ed1cd7169..977a4ad6b 100644 --- a/ivtest/gold/sv_queue_string_fail.gold +++ b/ivtest/gold/sv_queue_string_fail.gold @@ -1,7 +1,7 @@ -./ivltests/sv_queue_string_fail.v:4: error: queue 'q_str1' bound must be positive (-1)! -./ivltests/sv_queue_string_fail.v:5: error: queue 'q_str2' bound is undefined! +./ivltests/sv_queue_string_fail.v:4: error: queue bound must be positive (-1). +./ivltests/sv_queue_string_fail.v:5: error: queue bound must be defined. ./ivltests/sv_queue_string_fail.v:6: error: A reference to a wire or reg (`bound') is not allowed in a constant expression. -./ivltests/sv_queue_string_fail.v:6: error: queue 'q_str3' bound must be a constant! +./ivltests/sv_queue_string_fail.v:6: error: queue bound must be constant. ./ivltests/sv_queue_string_fail.v:9: error: size() method takes no arguments ./ivltests/sv_queue_string_fail.v:10: error: pop_front() method takes no arguments ./ivltests/sv_queue_string_fail.v:11: error: pop_back() method takes no arguments diff --git a/ivtest/gold/sv_queue_vec_fail.gold b/ivtest/gold/sv_queue_vec_fail.gold index 21080cf7a..b772362f9 100644 --- a/ivtest/gold/sv_queue_vec_fail.gold +++ b/ivtest/gold/sv_queue_vec_fail.gold @@ -1,7 +1,7 @@ -./ivltests/sv_queue_vec_fail.v:4: error: queue 'q_vec1' bound must be positive (-1)! -./ivltests/sv_queue_vec_fail.v:5: error: queue 'q_vec2' bound is undefined! +./ivltests/sv_queue_vec_fail.v:4: error: queue bound must be positive (-1). +./ivltests/sv_queue_vec_fail.v:5: error: queue bound must be defined. ./ivltests/sv_queue_vec_fail.v:6: error: A reference to a wire or reg (`bound') is not allowed in a constant expression. -./ivltests/sv_queue_vec_fail.v:6: error: queue 'q_vec3' bound must be a constant! +./ivltests/sv_queue_vec_fail.v:6: error: queue bound must be constant. ./ivltests/sv_queue_vec_fail.v:9: error: size() method takes no arguments ./ivltests/sv_queue_vec_fail.v:10: error: pop_front() method takes no arguments ./ivltests/sv_queue_vec_fail.v:11: error: pop_back() method takes no arguments diff --git a/pform_types.h b/pform_types.h index 45e312e6f..22d217427 100644 --- a/pform_types.h +++ b/pform_types.h @@ -364,6 +364,10 @@ struct class_type_t : public data_type_t { virtual SymbolType symbol_type() const; }; +ivl_type_t elaborate_array_type(Design *des, NetScope *scope, + const LineInfo &li, ivl_type_t base_type, + const std::list &dims); + /* * The pform_name_t is the general form for a hierarchical * identifier. It is an ordered list of name components. Each name From f42ab248a4ad6ae77698fd35a6ef1ee15752162e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 16 Apr 2022 11:42:57 +0200 Subject: [PATCH 2/3] Add regression test for functions with bounded queue return type Check that the maximum size of a bounded queue is properly handled when being used as the return type for a function. Elements beyond the maximum size should be ignored. Signed-off-by: Lars-Peter Clausen --- ..._queue_function.v => sv_queue_function1.v} | 0 ivtest/ivltests/sv_queue_function2.v | 24 +++++++++++++++++++ ivtest/regress-sv.list | 3 ++- ivtest/regress-vlog95.list | 3 ++- 4 files changed, 28 insertions(+), 2 deletions(-) rename ivtest/ivltests/{sv_queue_function.v => sv_queue_function1.v} (100%) create mode 100644 ivtest/ivltests/sv_queue_function2.v diff --git a/ivtest/ivltests/sv_queue_function.v b/ivtest/ivltests/sv_queue_function1.v similarity index 100% rename from ivtest/ivltests/sv_queue_function.v rename to ivtest/ivltests/sv_queue_function1.v diff --git a/ivtest/ivltests/sv_queue_function2.v b/ivtest/ivltests/sv_queue_function2.v new file mode 100644 index 000000000..a9aec655b --- /dev/null +++ b/ivtest/ivltests/sv_queue_function2.v @@ -0,0 +1,24 @@ +// Check that bounded queues are supported as function return types. + +module test; + + typedef int Q[$:1]; + + function automatic Q f(); + // The last element should be discarded + return '{1, 2, 3}; + endfunction + + initial begin + int q[$]; + + q = f(); + + if (q.size() == 2 && q[0] == 1 && q[1] == 2) begin + $display("PASSED"); + end else begin + $display("FAILED"); + end + end + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 5e10030ab..3561f1aa5 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -582,7 +582,8 @@ sv_port_default14 CE,-g2009 ivltests sv_queue1 normal,-g2009 ivltests sv_queue2 normal,-g2009 ivltests sv_queue3 normal,-g2009 ivltests -sv_queue_function normal,-g2009 ivltests +sv_queue_function1 normal,-g2009 ivltests +sv_queue_function2 normal,-g2009 ivltests sv_queue_parray normal,-g2009,-pfileline=1 ivltests gold=sv_queue_parray.gold sv_queue_parray_bounded normal,-g2009,-pfileline=1 ivltests gold=sv_queue_parray_bounded.gold sv_queue_parray_fail CE,-g2009 ivltests gold=sv_queue_parray_fail.gold diff --git a/ivtest/regress-vlog95.list b/ivtest/regress-vlog95.list index ddf6e57f6..c85adc362 100644 --- a/ivtest/regress-vlog95.list +++ b/ivtest/regress-vlog95.list @@ -470,7 +470,8 @@ pr3390385b CE,-g2009 ivltests # ++ pr3390385c CE,-g2009 ivltests # ++ pr3390385d CE,-g2009 ivltests # ++ pr3462145 CE,-g2009 ivltests # ++ -sv_queue_function CE,-g2009,-pallowsigned=1 ivltests # queue +sv_queue_function1 CE,-g2009,-pallowsigned=1 ivltests # queue +sv_queue_function2 CE,-g2009,-pallowsigned=1 ivltests # queue sv_typedef_darray_base1 CE,-g2009 ivltests # Dyanmic array sv_typedef_darray_base2 CE,-g2009 ivltests # Dyanmic array sv_typedef_darray_base3 CE,-g2009 ivltests # Dyanmic array From 818dfa55f342d116b2c58f7ee2fe0c1b51657b30 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 12 Apr 2022 22:42:54 +0200 Subject: [PATCH 3/3] Add regression tests for nested dynamic arrays and queues SystemVerilog allows to declare signals of nested unpacked types. E.g. a queue of dynamic arrays. This is currently not supported by Icarus. Add regression test nevertheless to check that this is reported as a non-supported construct and does not result in random crashes. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/sv_darray_nest1.v | 8 ++++++++ ivtest/ivltests/sv_darray_nest2.v | 8 ++++++++ ivtest/ivltests/sv_darray_nest3.v | 8 ++++++++ ivtest/ivltests/sv_darray_nest4.v | 8 ++++++++ ivtest/ivltests/sv_queue_nest1.v | 8 ++++++++ ivtest/ivltests/sv_queue_nest2.v | 8 ++++++++ ivtest/ivltests/sv_queue_nest3.v | 8 ++++++++ ivtest/ivltests/sv_queue_nest4.v | 8 ++++++++ ivtest/regress-fsv.list | 8 ++++++++ 9 files changed, 72 insertions(+) create mode 100644 ivtest/ivltests/sv_darray_nest1.v create mode 100644 ivtest/ivltests/sv_darray_nest2.v create mode 100644 ivtest/ivltests/sv_darray_nest3.v create mode 100644 ivtest/ivltests/sv_darray_nest4.v create mode 100644 ivtest/ivltests/sv_queue_nest1.v create mode 100644 ivtest/ivltests/sv_queue_nest2.v create mode 100644 ivtest/ivltests/sv_queue_nest3.v create mode 100644 ivtest/ivltests/sv_queue_nest4.v diff --git a/ivtest/ivltests/sv_darray_nest1.v b/ivtest/ivltests/sv_darray_nest1.v new file mode 100644 index 000000000..9b18556ca --- /dev/null +++ b/ivtest/ivltests/sv_darray_nest1.v @@ -0,0 +1,8 @@ +// Check that declarations for dynamic arrays of queues are supported. + +module test; + + // Dynamic array of queues + int q[$][]; + +endmodule diff --git a/ivtest/ivltests/sv_darray_nest2.v b/ivtest/ivltests/sv_darray_nest2.v new file mode 100644 index 000000000..a1fd298a6 --- /dev/null +++ b/ivtest/ivltests/sv_darray_nest2.v @@ -0,0 +1,8 @@ +// Check that declarations for dynamic arrays of dynamic arrays are supported. + +module test; + + // Dynamic array of dynamic arrays + int q[][]; + +endmodule diff --git a/ivtest/ivltests/sv_darray_nest3.v b/ivtest/ivltests/sv_darray_nest3.v new file mode 100644 index 000000000..f93b6f6f2 --- /dev/null +++ b/ivtest/ivltests/sv_darray_nest3.v @@ -0,0 +1,8 @@ +// Check that declarations for dynamic arrays of unpacked arrays are supported. + +module test; + + // Dynamic array of unpacked arrays + int q[10][]; + +endmodule diff --git a/ivtest/ivltests/sv_darray_nest4.v b/ivtest/ivltests/sv_darray_nest4.v new file mode 100644 index 000000000..08fb229a8 --- /dev/null +++ b/ivtest/ivltests/sv_darray_nest4.v @@ -0,0 +1,8 @@ +// Check that declarations for unpacked arrays of dynamic arrays are supported. + +module test; + + // Unpacked array of dynamic arrays + int q[][10]; + +endmodule diff --git a/ivtest/ivltests/sv_queue_nest1.v b/ivtest/ivltests/sv_queue_nest1.v new file mode 100644 index 000000000..aa199740b --- /dev/null +++ b/ivtest/ivltests/sv_queue_nest1.v @@ -0,0 +1,8 @@ +// Check that declarations for queues of queues are supported. + +module test; + + // Queue of queues + int q[$][$]; + +endmodule diff --git a/ivtest/ivltests/sv_queue_nest2.v b/ivtest/ivltests/sv_queue_nest2.v new file mode 100644 index 000000000..1b6fa7654 --- /dev/null +++ b/ivtest/ivltests/sv_queue_nest2.v @@ -0,0 +1,8 @@ +// Check that declarations for queues of dynamic arrays are supported. + +module test; + + // Queue of dynamic arrays + int q[][$]; + +endmodule diff --git a/ivtest/ivltests/sv_queue_nest3.v b/ivtest/ivltests/sv_queue_nest3.v new file mode 100644 index 000000000..958a93c87 --- /dev/null +++ b/ivtest/ivltests/sv_queue_nest3.v @@ -0,0 +1,8 @@ +// Check that declarations for queues of unpacked arrays are supported. + +module test; + + // Queue of unpacked arrays + int q[10][$]; + +endmodule diff --git a/ivtest/ivltests/sv_queue_nest4.v b/ivtest/ivltests/sv_queue_nest4.v new file mode 100644 index 000000000..212d15f7b --- /dev/null +++ b/ivtest/ivltests/sv_queue_nest4.v @@ -0,0 +1,8 @@ +// Check that declarations for unpacked arrays of queues are supported. + +module test; + + // Unpacked array of queues + int q[$][10]; + +endmodule diff --git a/ivtest/regress-fsv.list b/ivtest/regress-fsv.list index d990342fc..2bcbcd4aa 100644 --- a/ivtest/regress-fsv.list +++ b/ivtest/regress-fsv.list @@ -125,7 +125,15 @@ br971 normal ivltests br1005 normal ivltests br1015b normal ivltests br_ml20150315b normal ivltests +sv_darray_nest1 normal ivltests +sv_darray_nest2 normal ivltests +sv_darray_nest3 normal ivltests +sv_darray_nest4 normal ivltests sv_deferred_assert1 normal ivltests sv_deferred_assert2 normal ivltests sv_deferred_assume1 normal ivltests sv_deferred_assume2 normal ivltests +sv_queue_nest1 normal ivltests +sv_queue_nest2 normal ivltests +sv_queue_nest3 normal ivltests +sv_queue_nest4 normal ivltests