mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 20:22:41 +00:00
Support as a task call
This commit is contained in:
parent
fb04765c0e
commit
7081ea0ede
@ -4118,7 +4118,7 @@ task_subroutine_callNoMethod<nodeExprp>: // function_subroutine_callNoMethod
|
||||
// // IEEE: randomize_call
|
||||
// // We implement randomize as a normal funcRef, since randomize isn't a keyword
|
||||
// // Note yNULL is already part of expressions, so they come for free
|
||||
//UNSUP funcRef yWITH__CUR constraint_block { }
|
||||
| funcRef yWITH__CUR constraint_block { $$ = new AstWithParse{$2, $1, $3}; }
|
||||
;
|
||||
|
||||
function_subroutine_callNoMethod<nodeExprp>: // IEEE: function_subroutine_call (as function)
|
||||
|
@ -134,6 +134,13 @@ module mwith();
|
||||
if (cls.b != 1) $stop;
|
||||
`check_rand(cls2, cls2.a);
|
||||
`check_rand(cls2, cls2.c);
|
||||
|
||||
// Check randomize as a task
|
||||
// verilator lint_off IGNOREDRETURN
|
||||
cls.randomize() with { b == 2;};
|
||||
// verilator lint_on IGNOREDRETURN
|
||||
if (cls.b != 2) $stop;
|
||||
|
||||
// Check capture of a static variable
|
||||
if (foo.randomize() with { a > sub1.sub_var; } != 1) $stop;
|
||||
// Check reference to a function
|
||||
|
Loading…
Reference in New Issue
Block a user