I have a SystemVerilog testbench in which I want to use a case
statement in other case
statements from my program.
For example, I have:
task a(string b,string c)
case(b)
"a1": x(x1,case(c) "b1":y=1; "b2":y=2;);
"a2": x(x2,case(c) "b3":y=4; "b4":y=5;);
This is the structure I want to implement, to use the case with string c in multiple different case items.
If I guess correctly,
x
represents a task or a function and you are trying to pass a case statement as an argument. right? impossible.But this should work:
or for case within a case in general use begin/end: