The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 18th, 2024, 12:30am
Pages: 1
Send Topic Print
Is there any way in vams to convert strings to hierarchal references? (Read 2217 times)
Dan Clement
Community Member
***
Offline



Posts: 95
Salt Lake City, Utah, USA
Is there any way in vams to convert strings to hierarchal references?
Mar 05th, 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 Smiley.


Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: Is there any way in vams to convert strings to hierarchal references?
Reply #1 - 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
Back to top
 
 
View Profile WWW   IP Logged
Dan Clement
Community Member
***
Offline



Posts: 95
Salt Lake City, Utah, USA
Re: Is there any way in vams to convert strings to hierarchal references?
Reply #2 - Mar 6th, 2012, 4:25am
 
Thanks Ken!
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.