The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 27th, 2024, 12:14pm
Pages: 1
Send Topic Print
string parameter?? (Read 2983 times)
Aigneryu
Senior Member
****
Offline



Posts: 102

string parameter??
Dec 05th, 2006, 12:43pm
 
Dear all,

Can we pass a string parameter into an instance for a verilog-A macro?
I know there are real, integer,.. but I cannot find anything about the string.
Can somebody tell me if it is possible or not?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: string parameter??
Reply #1 - Dec 6th, 2006, 4:13am
 
I don't think you meant string parameter.  I believe your question should have been: is it legal to use a string literal as an actual argument for a macro?  And the answer is: yes.

For example, if you define this:
`define mydebug(x) $strobe("DEBUG: ", x)

then you should be able to call it with the string literal "line 101"

`mydebug("line 101")


If you really were asking about string parameters, they were added to Verilog-AMS LRM 2.2, and maybe that's why you can't find them where you are looking; they're not supported by all simulators yet.  I'm not exactly sure what your question is; are you trying to override an instance parameter?  Or trying to pass a string parameter as the argument to a macro?  Using the definition above, if you also have

parameter string myname = "X1";

you should be able to

`mydebug(myname)

-Geoffrey
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Aigneryu
Senior Member
****
Offline



Posts: 102

Re: string parameter??
Reply #2 - Dec 6th, 2006, 6:26pm
 
Thanks Geoffrey,

 That's exactly the information I need.

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.