PULP Community
Printf Statements Breaking Post Simulation - Printable Version

+- PULP Community (https://pulp-platform.org/community)
+-- Forum: PULP's Community forum (https://pulp-platform.org/community/forumdisplay.php?fid=1)
+--- Forum: PULP General questions (https://pulp-platform.org/community/forumdisplay.php?fid=2)
+--- Thread: Printf Statements Breaking Post Simulation (/showthread.php?tid=256)



Printf Statements Breaking Post Simulation - vignajeth - 04-20-2021

Hi,
   I am unable to run C code with printf statements using synthesized netlist. I have attached a simulation image of the stdout peripheral bus and FSM of Lint 2 AXI module. I notice that the C code runs successfully when no printf statements are given. 

The C code run when I get this issue is

#include <stdio.h>
int main()
{
  printf("Testing !\n");

  return 0;
}


Any thoughts on this issue?


RE: Printf Statements Breaking Post Simulation - meggiman - 05-04-2021

The default stdout used in the current runtime makes use of a virtual stdout interface that is only usable during simulation. The interface is probed by the testbench using hierarchical access and is most likely optimized away during synthesis. For actual hardware, you should use UART as your default stdout. You can do so by compiling your application with 'make all io=uart'. This will cause the runtime to print all stdout to the UART interface at a default baudrate of 115200 baud.