Format error message

Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
Kamil Danecki 2026-03-26 13:00:27 +01:00
parent 7982361aaf
commit e7cc286dec
2 changed files with 16 additions and 16 deletions

View File

@ -443,12 +443,12 @@ class DynScopeVisitor final : public VNVisitor {
if (!isEvent && m_afterTimingControl && nodep->varp()->isWritable()
&& nodep->access().isWriteOrRW()) {
// The output variable may not exist after a delay, so we can't just write to it
nodep->v3error(
"Writing to an "
<< nodep->varp()->verilogKwd()
<< " variable of a "
<< (m_inFunc ? "function" : "task")
<< " after a timing control is not allowed");
nodep->v3error(
"Writing to an "
<< nodep->varp()->verilogKwd()
<< " automatic variable of a "
<< (m_inFunc ? "function" : "task")
<< " after a timing control is not allowed");
}
if (!framep->instance().initialized()) framep->createInstancePrototype();
framep->captureVarInsert(nodep->varp());

View File

@ -1,41 +1,41 @@
%Error: t/t_timing_func_fork_bad.v:13:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:13:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
13 | f1 = 0;
| ^~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: t/t_timing_func_fork_bad.v:14:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:14:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
14 | o1 = 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:22:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:22:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
22 | f2 = #5 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:24:9: Writing to an inout variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:24:9: Writing to an inout automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
24 | io2 = 0;
| ^~~
%Error: t/t_timing_func_fork_bad.v:34:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:34:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
34 | f3 = 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:35:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:35:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
35 | o3 = 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:43:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:43:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
43 | f4 = @e 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:45:9: Writing to an inout variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:45:9: Writing to an inout automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
45 | io4 = 0;
| ^~~
%Error: t/t_timing_func_fork_bad.v:56:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:56:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
56 | f5 = 0;
| ^~
%Error: t/t_timing_func_fork_bad.v:57:9: Writing to an output variable of a function after a timing control is not allowed
%Error: t/t_timing_func_fork_bad.v:57:9: Writing to an output automatic variable of a function after a timing control is not allowed
: ... note: In instance 't'
57 | o5 = 0;
| ^~