mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-08 04:20:49 +02:00
Report when the task port return type does not match the connection
This commit is contained in:
+13
-3
@@ -4915,9 +4915,19 @@ NetProc* PCallTask::elaborate_build_call_(Design*des, NetScope*scope,
|
||||
rv = cast_to_int4(rv, lv_width);
|
||||
break;
|
||||
default:
|
||||
/* Don't yet know how to handle this. */
|
||||
ivl_assert(*this, 0);
|
||||
break;
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Argument " << (idx+1) << " for task '"
|
||||
<< task->basename() << "' is called with '";
|
||||
lv->dump_lval(cerr);
|
||||
cerr << "' which has type '"
|
||||
<< lv->expr_type() << "'." << endl;
|
||||
cerr << get_fileline() << ": : "
|
||||
"The task expects to return type '"
|
||||
<< rv->expr_type() << "'." << endl;
|
||||
des->errors += 1;
|
||||
delete lv;
|
||||
delete rv;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
rv = pad_to_width(rv, lv_width, *this);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
./ivltests/br_gh716.v:8: error: Argument 1 for task 't1' is called with 'bf' which has type 'darray'.
|
||||
./ivltests/br_gh716.v:8: : The task expects to return type 'logic'.
|
||||
1 error(s) during elaboration.
|
||||
@@ -0,0 +1,10 @@
|
||||
module test();
|
||||
logic [7:0] bf [];
|
||||
|
||||
task t1(output logic [7:0] buffer);
|
||||
buffer=0;
|
||||
endtask
|
||||
|
||||
initial t1(bf);
|
||||
|
||||
endmodule
|
||||
@@ -148,6 +148,7 @@ br_gh4a normal,-g2009 ivltests
|
||||
br_gh72a normal,-g2009 ivltests gold=br_gh72a.gold
|
||||
br_gh72b normal,-g2009 ivltests gold=br_gh72b.gold
|
||||
br_gh72b_fail CE,-g2009 ivltests gold=br_gh72b_fail.gold
|
||||
br_gh716 CE,-g2009 ivltests gold=br_gh716.gold
|
||||
br_gh104a normal,-g2009 ivltests
|
||||
br_gh104b normal,-g2009 ivltests
|
||||
br_gh105a normal,-g2009 ivltests gold=br_gh105a.gold
|
||||
|
||||
Reference in New Issue
Block a user