%* format specifier

This is a discussion on %* format specifier within the verilog forums in Programming Languages category; I cannot seem to find the Verilog 2001, or SystemVerilog equivalent to %* format specifier in C/C++! Example found below: $sformat( str, "[%-*s] : %5d", name_max_length, name, value ); Is there a way to achieve this in SystemVerilog somehow? -- Amal...

Go Back   Application Development Forum > Programming Languages > verilog

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-19-2008, 04:32 PM
Amal
Guest
 
Default %* format specifier

I cannot seem to find the Verilog 2001, or SystemVerilog equivalent to
%* format specifier in C/C++! Example found below:

$sformat( str, "[%-*s] : %5d", name_max_length, name, value );

Is there a way to achieve this in SystemVerilog somehow?
-- Amal
Reply With Quote
  #2  
Old 08-25-2008, 09:46 AM
Amal
Guest
 
Default Re: %* format specifier

On Aug 19, 4:32*pm, Amal <akhailt...@gmail.com> wrote:
> I cannot seem to find the Verilog 2001, or SystemVerilog equivalent to
> %* format specifier in C/C++! *Example found below:
>
> * $sformat( str, "[%-*s] : %5d", name_max_length, name, value );
>
> Is there a way to achieve this in SystemVerilog somehow?
> -- Amal


Anyone has any ideas about this? Or should this be implemented as a
function?
-- Amal
Reply With Quote
  #3  
Old 08-26-2008, 06:43 PM
sharp@cadence.com
Guest
 
Default Re: %* format specifier

On Aug 19, 4:32*pm, Amal <akhailt...@gmail.com> wrote:
> I cannot seem to find the Verilog 2001, or SystemVerilog equivalent to
> %* format specifier in C/C++! *Example found below:
>
> * $sformat( str, "[%-*s] : %5d", name_max_length, name, value );
>
> Is there a way to achieve this in SystemVerilog somehow?


There is no equivalent to the %* format specifier in Verilog or
SystemVerilog.

The best suggestion I can come up with is to write your own code to
extract name_max_length characters (or fewer, if there are fewer) out
of name into a separate string variable, and print that instead.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:26 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.