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");
endmoduleIn this case, But the second Since |
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 |
The second ProceduralBlock isn't the inside of the sequence, it's the (implicit) wrapper around the
assert propertystatement, 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 propertystatement and finding the actual instantiation there.