The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Is there any way in vams to convert strings to hierarchal references?
https://designers-guide.org/forum/YaBB.pl?num=1331002317

Message started by Dan Clement on Mar 5th, 2012, 6:51pm

Title: Is there any way in vams to convert strings to hierarchal references?
Post by Dan Clement on Mar 5th, 2012, 6:51pm

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 :).



Title: Re: Is there any way in vams to convert strings to hierarchal references?
Post by Ken Kundert on Mar 5th, 2012, 11:33pm

Dan,
   I know no way of doing what you want. I am mostly familiar with the V-AMS standard and there is nothing there that I can think of. If you are using Verilog-AMS you might look into some of the obscure system tasks available from the digital side of your simulator that might help you out.

-Ken

Title: Re: Is there any way in vams to convert strings to hierarchal references?
Post by Dan Clement on Mar 6th, 2012, 4:25am

Thanks Ken!

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.