Extend the format specifiers in the sprintf block
Added by Johan Henning 10 months ago
At this moment only these specifiers are supported:
%u, %i, %o, %x: uint32
%e, %g, %f: single
%s: vector of data type uint8
It would be very nice if flags, width, .precision and modifiers can be specified as well (like in the standard (s)printf functions to align values in colums.
RE: Extend the format specifiers in the sprintf block - Added by Shawn Sebastian Pulle (ฌอน) 10 months ago
Thank you for the feedback.
The Xilinx tools use a slightly different version of the printf function named xil_printf. It does not contain the same functionality of the printf function commonly used.
One of the differences is, it not supporting floating point numbers. Currently the floating point numbers are processed as strings in our block set as a work around for this problem. Therefore, getting precision would be difficult for certain data types.
It is possible to give width/padding for other data types, but it would be inconsistent across all data types and ultimately a bit confusing as to why one thing works and the other doesn't work.
We will consider your suggestion to be implemented in the future after testing, as long as it can be implemented without creating further confusion to the users.
RE: Extend the format specifiers in the sprintf block - Added by Johan Henning 10 months ago
There is a very nice (native) Simulink block (compose string). According to the documentation and in simulation mode it does everything I want. But when using it for the 7000 it does not work right. Do you understand why not?