Compare commits

...

3 Commits

Author SHA1 Message Date
Yilou Wang 190d64c3cf remove timescale arg, update .v, 5ns -> 5 2026-03-30 14:47:44 +02:00
Yilou Wang ebbc54409c ready to go 2026-03-30 14:39:37 +02:00
Yilou Wang 78b7679fd4 refine comments and update test 2026-03-30 14:20:59 +02:00
4 changed files with 12 additions and 10 deletions

View File

@ -892,8 +892,8 @@ class TimingControlVisitor final : public VNVisitor {
m_underProcedure = true;
// Workaround for killing `always` processes (doing that is pretty much UB)
// TODO: Disallow killing `always` at runtime (throw an error)
// Combo blocks (always @*) must not become coroutines -- they have no
// suspend points and would spin forever.
// Skip for combinational blocks; if the body has timing controls
// iterateChildren will add T_SUSPENDEE, otherwise it would spin.
if (hasFlags(nodep, T_HAS_PROC)
&& !(m_activep && m_activep->sentreep() && m_activep->sentreep()->hasCombo()))
addFlags(nodep, T_SUSPENDEE);

View File

@ -4464,12 +4464,6 @@ class WidthVisitor final : public VNVisitor {
if (AstNodeFTask* const ftaskp
= VN_CAST(m_memberMap.findMember(ifacep, nodep->name()), NodeFTask)) {
UINFO(5, __FUNCTION__ << "AstNodeFTask" << nodep);
// VIF function may write any member; prevent constant-folding.
if (adtypep->isVirtual()) {
for (AstNode* itemp = ifacep->stmtsp(); itemp; itemp = itemp->nextp()) {
if (AstVar* const mvarp = VN_CAST(itemp, Var)) { mvarp->sensIfacep(ifacep); }
}
}
userIterate(ftaskp, nullptr);
if (ftaskp->isStatic()) {
AstArg* const argsp = nodep->argsp();

View File

@ -11,7 +11,7 @@ import vltest_bootstrap
test.scenarios('simulator')
test.compile(verilator_flags2=['--binary', '--timing', '--timescale 1ns/1ps'])
test.compile(verilator_flags2=['--binary'])
test.execute()

View File

@ -45,7 +45,7 @@ class Driver;
virtual my_if vif;
task run();
vif.set_period(5ns);
vif.set_period(5);
#10;
vif.start_clk();
endtask
@ -54,11 +54,19 @@ endclass
module t;
my_if intf();
// Verify combinational always with timing controls still works as coroutine
int combo_timing_count = 0;
always @* begin
combo_timing_count = combo_timing_count + 1;
#1;
end
initial begin
automatic Driver d = new;
d.vif = intf;
d.run();
repeat (4) @(posedge intf.clk);
if (combo_timing_count == 0) $stop;
$write("*-* All Finished *-*\n");
$finish;
end