"Russell Fredrickson" <
[email protected]> wrote in message news:<ci7vvp$638$
[email protected]>...
>
> So is $sformat specified in the LRM like this -- or is this a restriction of
> the Cadence simulator? If the behavior is correct according to the LRM --
> what bozo didn't keep the same syntax rules for $sformat as $display? I
> suppose I <could> write my own PLI routine that did the right thing -- but
> never having done that -- it seems like it would be a lot more pain than I'm
> willing to go through.
Yes, $sformat is specified in the LRM like that. Only one of the arguments
is treated as a format string.
What you want to use is not $sformat, but $swrite. This works the same
way as $write (which is the same as $display except without the carriage
return at the end). It allows for multiple format strings mixed with the
arguments, just like $display.
The reason that $sformat was added also is that it allows the format string
to be supplied in a variable, rather than just a string literal. Since you
can't tell whether a variable should be interpreted as a format string or a
value to be printed, one specific argument is always treated as a format
string and the others are not. Personally, I think the reasons for adding
the $sformat task were dubious.