| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.