How to find the relation between ProceduralBlockSymbol and SequenceSymbol #705
-
Hi Mike, I have one question module test;
int a = 5;
int b = 10;
bit clk;
always #10 clk = ~clk;
sequence seq(int y, int x = a + b);
@(posedge clk) 1 == 1;
endsequence
assert property (seq(0)) $display("pass");
else $display("fail");
endmodule In this case,
But the second
Since |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The second ProceduralBlock isn't the inside of the sequence, it's the (implicit) wrapper around the It's not generally possible to inspect the body of a sequence or property in AST form until you know how it's being instantiated, due to the formal arguments acting essentially like a macro and being replaced as-is. You can get an approximation by using AssertionInstanceExpression::makeDefault() to get an expression that instantiates the sequence with placeholder arguments but I think you'll be better off just walking into the |
Beta Was this translation helpful? Give feedback.
The second ProceduralBlock isn't the inside of the sequence, it's the (implicit) wrapper around the
assert property
statement, as specified by the LRM.It's not generally possible to inspect the body of a sequence or property in AST form until you know how it's being instantiated, due to the formal arguments acting essentially like a macro and being replaced as-is. You can get an approximation by using AssertionInstanceExpression::makeDefault() to get an expression that instantiates the sequence with placeholder arguments but I think you'll be better off just walking into the
assert property
statement and finding the actual instantiation there.