I have a question about doing something tricky in verilogams that may not be possible...
I would like to be able to have a task that I can call where I pass a string (converted to a number while passing to task) representing a signal probed with a hierarchy operator.
In tb something like this:
Junk = $sscanf(stringnum, "%s", "tb.dut.inputa");
Mytaskcall(stringnum, expectedvalue);
And inside task:
$swrite(mystring, "%0s", stringnum);
if(mystring != expectedvalue) begin
...
Basically I want to be able pass the hierarchical lookup operator to probe a signal inside the task. I am excited if this is possible because I would like to probe a signal inside of a task, then apply a stimulus, and then look at the same signal again all inside of one task.
I have a feeling this is not possible due to the architecture of the language and I think the hierarchical lookup operator is probably fixed at compile time so dynamically it's not possible to change it.
In interpreted languages it's common to dynamically create strings that are then evaluated as code using some kind of veal operator but since this is a HDL language it seems this is not possible.
Do any of you gurus have any feedback on this? I'm really hoping Ken K. Has some clever trick
.