Bit/part selects cannot have real index expressions
This commit is contained in:
parent
272771d183
commit
2249d224de
49
elab_expr.cc
49
elab_expr.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999-2022 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2023 Stephen Williams (steve@icarus.com)
|
||||
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
|
|
@ -4047,10 +4047,10 @@ bool PEIdent::calculate_bits_(Design*des, NetScope*scope,
|
|||
NetEConst*msb_c = dynamic_cast<NetEConst*>(msb_ex);
|
||||
if (msb_c == 0) {
|
||||
cerr << index_tail.msb->get_fileline() << ": error: "
|
||||
"Bit select expressions must be constant."
|
||||
"Bit select expressions must be a constant integral value."
|
||||
<< endl;
|
||||
cerr << index_tail.msb->get_fileline() << ": : "
|
||||
"This msb expression violates the rule: "
|
||||
"This expression violates that rule: "
|
||||
<< *index_tail.msb << endl;
|
||||
des->errors += 1;
|
||||
/* Attempt to recover from error. */
|
||||
|
|
@ -4089,10 +4089,10 @@ bool PEIdent::calculate_parts_(Design*des, NetScope*scope,
|
|||
NetEConst*lsb_c = dynamic_cast<NetEConst*>(lsb_ex);
|
||||
if (lsb_c == 0) {
|
||||
cerr << index_tail.lsb->get_fileline() << ": error: "
|
||||
"Part select expressions must be constant."
|
||||
"Part select expressions must be constant integral values."
|
||||
<< endl;
|
||||
cerr << index_tail.lsb->get_fileline() << ": : "
|
||||
"This lsb expression violates the rule: "
|
||||
"The lsb expression violates that rule: "
|
||||
<< *index_tail.lsb << endl;
|
||||
des->errors += 1;
|
||||
/* Attempt to recover from error. */
|
||||
|
|
@ -4107,10 +4107,10 @@ bool PEIdent::calculate_parts_(Design*des, NetScope*scope,
|
|||
NetEConst*msb_c = dynamic_cast<NetEConst*>(msb_ex);
|
||||
if (msb_c == 0) {
|
||||
cerr << index_tail.msb->get_fileline() << ": error: "
|
||||
"Part select expressions must be constant."
|
||||
"Part select expressions must be constant integral values."
|
||||
<< endl;
|
||||
cerr << index_tail.msb->get_fileline() << ": : "
|
||||
"This msb expression violates the rule: "
|
||||
"The msb expression violates that rule: "
|
||||
<< *index_tail.msb << endl;
|
||||
des->errors += 1;
|
||||
/* Attempt to recover from error. */
|
||||
|
|
@ -4714,8 +4714,8 @@ NetExpr* PEIdent::elaborate_expr_(Design*des, NetScope*scope,
|
|||
// then create a NetESignal node to handle it.
|
||||
if (sr.net != 0) {
|
||||
if (NEED_CONST & flags) {
|
||||
cerr << get_fileline() << ": error: A reference to a wire "
|
||||
"or reg (`" << path_ << "') is not allowed in "
|
||||
cerr << get_fileline() << ": error: A reference to a net "
|
||||
"or variable (`" << path_ << "') is not allowed in "
|
||||
"a constant expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -4723,7 +4723,7 @@ NetExpr* PEIdent::elaborate_expr_(Design*des, NetScope*scope,
|
|||
if (sr.net->scope()->type() == NetScope::MODULE) {
|
||||
if (scope->need_const_func()) {
|
||||
cerr << get_fileline() << ": error: A reference to a "
|
||||
"non-local wire or reg (`" << path_ << "') is "
|
||||
"non-local net or variable (`" << path_ << "') is "
|
||||
"not allowed in a constant function." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -5141,13 +5141,21 @@ NetExpr* PEIdent::elaborate_expr_param_bit_(Design*des, NetScope*scope,
|
|||
NetExpr*sel = elab_and_eval(des, scope, index_tail.msb, -1, need_const);
|
||||
if (sel == 0) return 0;
|
||||
|
||||
perm_string name = peek_tail_name(path_);
|
||||
|
||||
if (sel->expr_type() == IVL_VT_REAL) {
|
||||
cerr << get_fileline() << ": error: Index expression for "
|
||||
<< name << "[" << *sel
|
||||
<< "] cannot be a real value." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_fileline() << ": debug: Calculate bit select "
|
||||
<< "[" << *sel << "] from range "
|
||||
<< name << "[" << *sel << "] from range "
|
||||
<< "[" << par_msv << ":" << par_lsv << "]." << endl;
|
||||
|
||||
perm_string name = peek_tail_name(path_);
|
||||
|
||||
// Handle the special case that the selection is constant. In this
|
||||
// case, just precalculate the entire constant result.
|
||||
if (NetEConst*sel_c = dynamic_cast<NetEConst*> (sel)) {
|
||||
|
|
@ -5767,6 +5775,13 @@ NetExpr* PEIdent::elaborate_expr_net_part_(Design*des, NetScope*scope,
|
|||
NetESignal*net, NetScope*,
|
||||
unsigned expr_wid) const
|
||||
{
|
||||
if (net->sig()->data_type() == IVL_VT_STRING) {
|
||||
cerr << get_fileline() << ": error: Cannot take the part select of a string ('"
|
||||
<< net->name() << "')." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
list<long> prefix_indices;
|
||||
bool rc = calculate_packed_indices_(des, scope, net->sig(), prefix_indices);
|
||||
if (!rc)
|
||||
|
|
@ -6192,6 +6207,14 @@ NetExpr* PEIdent::elaborate_expr_net_bit_(Design*des, NetScope*scope,
|
|||
if (!mux)
|
||||
return 0;
|
||||
|
||||
if (mux->expr_type() == IVL_VT_REAL) {
|
||||
cerr << get_fileline() << ": error: Index expression for "
|
||||
<< net->sig()->name() << "[" << *mux
|
||||
<< "] cannot be a real value." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (const netdarray_t*darray = net->sig()->darray_type()) {
|
||||
// Special case: This is a select of a dynamic
|
||||
// array. Generate a NetESelect and attach it to
|
||||
|
|
|
|||
17
elab_lval.cc
17
elab_lval.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2022 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2023 Stephen Williams (steve@icarus.com)
|
||||
* Copyright CERN 2012-2013 / Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
|
|
@ -508,6 +508,14 @@ bool PEIdent::elaborate_lval_net_bit_(Design*des,
|
|||
NetExpr*mux = elab_and_eval(des, scope, index_tail.msb, -1);
|
||||
long lsb = 0;
|
||||
|
||||
if (mux && mux->expr_type() == IVL_VT_REAL) {
|
||||
cerr << get_fileline() << ": error: Index expression for "
|
||||
<< reg->name() << "[" << *mux
|
||||
<< "] cannot be a real value." << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NetEConst*index_con = dynamic_cast<NetEConst*> (mux)) {
|
||||
// The index has a constant defined value.
|
||||
if (index_con->value().is_defined()) {
|
||||
|
|
@ -685,6 +693,13 @@ bool PEIdent::elaborate_lval_net_part_(Design*des,
|
|||
NetScope*scope,
|
||||
NetAssign_*lv) const
|
||||
{
|
||||
if (lv->sig()->data_type() == IVL_VT_STRING) {
|
||||
cerr << get_fileline() << ": error: Cannot part select assign to a string ('"
|
||||
<< lv->sig()->name() << "')." << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
list<long> prefix_indices;
|
||||
bool rc = calculate_packed_indices_(des, scope, lv->sig(), prefix_indices);
|
||||
ivl_assert(*this, rc);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
./ivltests/bitsel_real_idx.v:11: error: Index expression for in[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:11: error: Unable to elaborate r-value: in[ridx]
|
||||
./ivltests/bitsel_real_idx.v:12: error: Index expression for in[0.500000] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:12: error: Unable to elaborate r-value: in[0.500000]
|
||||
./ivltests/bitsel_real_idx.v:13: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/bitsel_real_idx.v:13: error: Bit select expressions must be a constant integral value.
|
||||
./ivltests/bitsel_real_idx.v:13: : This expression violates that rule: ridx
|
||||
./ivltests/bitsel_real_idx.v:14: error: Bit select expressions must be a constant integral value.
|
||||
./ivltests/bitsel_real_idx.v:14: : This expression violates that rule: 0.500000
|
||||
./ivltests/bitsel_real_idx.v:20: error: Index expression for in[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:21: error: Index expression for in[0.500000] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:22: error: Index expression for vlv[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:23: error: Index expression for vlc[0.500000] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:24: error: Index expression for pval[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:25: error: Index expression for pval[0.500000] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:26: error: Index expression for sval[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:27: error: Index expression for sval[0.500000] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:28: error: Index expression for strv[+ridx] cannot be a real value.
|
||||
./ivltests/bitsel_real_idx.v:29: error: Index expression for strc[0.500000] cannot be a real value.
|
||||
17 error(s) during elaboration.
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
./ivltests/partsel_real_idx.v:13: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:13: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:13: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:13: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:13: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:13: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:14: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:14: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:14: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:14: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:15: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:15: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:15: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:15: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:15: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:15: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:16: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:16: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:16: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:16: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:17: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:17: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:17: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:18: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:18: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:19: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:19: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:19: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:20: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:20: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:26: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:26: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:26: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:26: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:26: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:26: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:27: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:27: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:27: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:27: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:28: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:28: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:28: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:28: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:28: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:28: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:29: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:29: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:29: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:29: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:30: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:30: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:30: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:31: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:31: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:32: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:32: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:32: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:33: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:33: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:34: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:34: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:34: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:34: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:34: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:34: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:35: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:35: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:35: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:35: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:36: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:36: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:36: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:36: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:36: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:36: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:37: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:37: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:37: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:37: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:38: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:38: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:38: : The msb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:38: error: Cannot take the part select of a string ('sval').
|
||||
./ivltests/partsel_real_idx.v:39: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:39: : The msb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:39: error: Cannot take the part select of a string ('sval').
|
||||
./ivltests/partsel_real_idx.v:40: error: A reference to a net or variable (`ridx') is not allowed in a constant expression.
|
||||
./ivltests/partsel_real_idx.v:40: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:40: : The lsb expression violates that rule: ridx
|
||||
./ivltests/partsel_real_idx.v:40: error: Cannot take the part select of a string ('sval').
|
||||
./ivltests/partsel_real_idx.v:41: error: Part select expressions must be constant integral values.
|
||||
./ivltests/partsel_real_idx.v:41: : The lsb expression violates that rule: 0.500000
|
||||
./ivltests/partsel_real_idx.v:41: error: Cannot take the part select of a string ('sval').
|
||||
./ivltests/partsel_real_idx.v:42: error: Cannot part select assign to a string ('strvm').
|
||||
./ivltests/partsel_real_idx.v:43: error: Cannot part select assign to a string ('strcm').
|
||||
./ivltests/partsel_real_idx.v:44: error: Cannot part select assign to a string ('strvl').
|
||||
./ivltests/partsel_real_idx.v:45: error: Cannot part select assign to a string ('strcl').
|
||||
62 error(s) during elaboration.
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
./ivltests/sv_default_port_value3.v:3: error: A reference to a wire or reg (`v') is not allowed in a constant expression.
|
||||
./ivltests/sv_default_port_value3.v:3: error: A reference to a net or variable (`v') is not allowed in a constant expression.
|
||||
./ivltests/sv_default_port_value3.v:3: error: Failed to elaborate port default value.
|
||||
2 error(s) during elaboration.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
./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: A reference to a net or variable (`bound') is not allowed in a constant expression.
|
||||
./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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
./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: A reference to a net or variable (`bound') is not allowed in a constant expression.
|
||||
./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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
./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: A reference to a net or variable (`bound') is not allowed in a constant expression.
|
||||
./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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
./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: A reference to a net or variable (`bound') is not allowed in a constant expression.
|
||||
./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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
module top;
|
||||
parameter pval = 7;
|
||||
string sval, strv, strc;
|
||||
real ridx;
|
||||
integer in;
|
||||
reg cav, cac;
|
||||
reg vv, vc, pv, pc, sv, sc;
|
||||
integer calv, calc;
|
||||
integer vlv, vlc;
|
||||
|
||||
assign cav = in[ridx];
|
||||
assign cac = in[0.5];
|
||||
assign calv[ridx] = 1'b1;
|
||||
assign calc[0.5] = 1'b1;
|
||||
|
||||
initial begin
|
||||
in = 7;
|
||||
sval = "ABC";
|
||||
ridx = 0.5;
|
||||
vv = in[ridx];
|
||||
vc = in[0.5];
|
||||
vlv[ridx] = 1'b1;
|
||||
vlc[0.5] = 1'b1;
|
||||
pv = pval[ridx];
|
||||
pc = pval[0.5];
|
||||
sv = sval[ridx];
|
||||
sc = sval[0.5];
|
||||
strv[ridx] = "a";
|
||||
strc[0.5] = "a";
|
||||
end
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
module top;
|
||||
parameter pval = 7;
|
||||
string sval, strvm, strcm, strvl, strcl;
|
||||
real ridx;
|
||||
integer in;
|
||||
reg cavm, cacm, cavl, cacl;
|
||||
reg vvm, vcm, vvl, vcl;
|
||||
reg pvm, pcm, pvl, pcl;
|
||||
reg svm, scm, svl, scl;
|
||||
integer calvm, calcm, calvl, calcl;
|
||||
integer vlvm, vlcm, vlvl, vlcl;
|
||||
|
||||
assign cavm = in[ridx:1];
|
||||
assign cacm = in[0.5:1];
|
||||
assign cavl = in[1:ridx];
|
||||
assign cacl = in[1:0.5];
|
||||
assign calvm[ridx:1] = 1'b1;
|
||||
assign calcm[0.5:1] = 1'b1;
|
||||
assign calvl[1:ridx] = 1'b1;
|
||||
assign calcl[1:0.5] = 1'b1;
|
||||
|
||||
initial begin
|
||||
in = 7;
|
||||
ridx = 0.5;
|
||||
sval = "ABC";
|
||||
vvm = in[ridx:1];
|
||||
vcm = in[0.5:1];
|
||||
vvl = in[1:ridx];
|
||||
vcl = in[1:0.5];
|
||||
vlvm[ridx:1] = 1'b1;
|
||||
vlcm[0.5:1] = 1'b1;
|
||||
vlvl[1:ridx] = 1'b1;
|
||||
vlcl[1:0.5] = 1'b1;
|
||||
pvm = pval[ridx:1];
|
||||
pcm = pval[0.5:1];
|
||||
pvl = pval[1:ridx];
|
||||
pcl = pval[1:0.5];
|
||||
svm = sval[ridx:1];
|
||||
scm = sval[0.5:1];
|
||||
svl = sval[1:ridx];
|
||||
scl = sval[1:0.5];
|
||||
strvm[ridx:1] = "a";
|
||||
strcm[0.5:1] = "a";
|
||||
strvl[1:ridx] = "a";
|
||||
strcl[1:0.5] = "a";
|
||||
end
|
||||
endmodule
|
||||
|
|
@ -994,3 +994,5 @@ br_gh823a CE,-g2012 ivltests
|
|||
br_gh823b CE,-g2012 ivltests
|
||||
br_gh840a CE,-g2012 ivltests
|
||||
br_gh840b CE,-g2012 ivltests
|
||||
bitsel_real_idx CE,-g2012 ivltests gold=bitsel_real_idx.gold
|
||||
partsel_real_idx CE,-g2012 ivltests gold=partsel_real_idx.gold
|
||||
|
|
|
|||
Loading…
Reference in New Issue