cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joe306
Scholar
Scholar
521 Views
Registered: ‎12-07-2018

Which printf or xil_print?

Jump to solution

Hello, quick question relating to printing to the counsel during debugging. Is there any difference between xil_print and printf? Does one use more resources than the other?

Thank you

Tags (2)
1 Solution

Accepted Solutions
savula
Moderator
Moderator
487 Views
Registered: ‎10-30-2017

Hi @joe306 ,

Both are same. you can use any one of them. 

Best Regards,

Srikanth

View solution in original post

5 Replies
savula
Moderator
Moderator
488 Views
Registered: ‎10-30-2017

Hi @joe306 ,

Both are same. you can use any one of them. 

Best Regards,

Srikanth

View solution in original post

maps-mpls
Mentor
Mentor
466 Views
Registered: ‎06-20-2017

@savula are you sure?  At one time they were not the same.  I thought one was lightweight (i.e., didn't support %f), the other was not (e.g., supported %f).  I don't have time to check right now.

*** Destination: Rapid design and development cycles *** Please remember to give internet points to those who help you here. ***
dpaul24
Scholar
Scholar
460 Views
Registered: ‎08-07-2014

@savula ,

If both are same why was xil_print created after all (from a developer's point of view it does not make much sense)?

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem
Asking for solutions to problems via PM will be ignored.

barriet
Xilinx Employee
Xilinx Employee
443 Views
Registered: ‎08-13-2007

I'm not the expert here, but definitely also remember them NOT being the same.

A quick check of the current OS libraries reveals
/*
xil_printf
xil_printf() is a light-weight implementation of printf. It is much smaller in size (only 1 Kb). It
does not have support for floating point numbers. xil_printf() also does not support
printing of long (such as 64-bit) numbers.

...


*/
from https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/oslib_rm.pdf page 10.

Cheers,
bt

joe306
Scholar
Scholar
435 Views
Registered: ‎12-07-2018

Thank you very much

0 Kudos