RE: define and strings

From: Muranyi, Arpad <arpad.muranyi_at_.....>
Date: Wed Jul 27 2005 - 09:55:33 PDT
Geoffrey,

Thanks for the explanation, it certainly makes sense.  However,
what bothers me a little is that in this discussion you used
the phrase "I would expect" quite frequently.  This gives me
the impression that you are not 100 % certain about what you
are saying.  I would have liked to hear responses like: the
spec says this and that on such and such page, etc...  Are
any of these things spelled out somewhere?

As a newcomer to Verilog-AMS, I am going by what I can find
in the Verilog-AMS LRM and don't see enough detail on questions
like this.  I know there is a bunch of inherited stuff from the
worlds of other older languages, but this language (Verilog-AMS)
has its own manual, shouldn't it describe it all?  (Or at least
reference the other manuals to point out what the details are
on certain inherited items)?

I am just concerned that this loose style may open a lot of
room for different interpretations when tool vendors implement
the language...

Arpad
================================================================

-----Original Message-----
From: geoffrey.coram@analog.com [mailto:geoffrey.coram@analog.com] 
Sent: Wednesday, July 27, 2005 5:12 AM
To: Muranyi, Arpad
Cc: VerilogAMS Reflector
Subject: Re: define and strings

Arpad -
In the Spice tradition, parameters can be varied -- eg,
you can sweep beta for a BJT and see how this affects
your circuit.  This doesn't quite fit the Verilog-AMS
paradigm, but nevertheless, you could have

prtest X1 #(.strParName("different string")) (.port1(a), .port2(b))
prtest X2 #(.strParName("yet another string")) (.port1(b), .port2(c))

where prtest is the name of the module that has the `PRT macro.

I would expect that the simulator would compile the module
and get $strobe(strParName), which would then get filled in
at elaboration time by the parameter overrides.

-Geoffrey



"Muranyi, Arpad" wrote:
> 
> Geoffrey,
> 
> Thanks for your explanation, it does start making
> sense.  But I sill have a question.  What if I modify
> your example this way:
> 
> parameter string strParName = "print a string";
> `define PRT(x) $strobe(x);
> `PRT(strParName)
> 
> What is $strobe(x) going to get from x?
> 
> $strobe("print a string") or
> $strobe(print a string)   or
> $strobe(strParName)       ?
> 
> Now I am getting the impression that it would be the
> last one, but before I though it should be the second.
> It all boils down to when strParName is evaluated, and
> I thought that would happen at compile time while the
> macro is expanded.
> 
> Thanks,
> 
> Arpad
Received on Wed Jul 27 09:55:36 2005

This archive was generated by hypermail 2.1.8 : Wed Jul 27 2005 - 09:55:38 PDT