simulating hello_world #960
-
Hey, I have two smaller questions for this thread about the uart. I am simulating the hello_world example in Vivado xsim with the faster uart output (section 13.2 of the user guide) using "make USER_FLAGS+=-DUART0_SIM_MODE clean_all install" and manually having the simulator run for 1 ms. This way I can see the hello world being printed in the tcl console. Question 1: I was going through the main.c code of the hello_world file and saw the "neorv32_uart0_setup(BAUD_RATE, 0)" function call. However, when looking through neorv32_uart.h I don't find that function defined? Only the more general neorv32_uart_setup() seems to be defined but requires a uart pointer argument? Where is the more specific neorv32_uart0_setup) defined? Question 2: I wanted to see the "hello world!" data that is printed in the tcl console move through the uart in the simulator. I don't seem to find the variable however to put on my waveform that shows the data going through. What variable(s) should I have logged to see it moving through with time? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @Sam-Vervaeck.
These are wrappers for the two UARTs that use the same "core" functions. The pointer you are mentioning is the actual "hardware handle" (a pointer to the according UART's memory-mapped interface register struct). They are define in neorv32/sw/lib/include/neorv32_legacy.h Lines 22 to 68 in 00d248c But I no longer see them as legacy artifacts, so maybe those defines should be move (back) the
What kind of "data" do you want to track in your waveform? Note that when "simulation mode" is enabled there is no "physical" UART transmission at all; i.e. you won't see the UART TX signal toggling. If you want to see the data being send to the UART module you could track the UART's bus request port and check for write accesses to the neorv32/rtl/core/neorv32_uart.vhd Line 33 in 00d248c Here is the type definition of the request bus: neorv32/rtl/core/neorv32_package.vhd Lines 124 to 135 in 00d248c And here is the documentation of the bus protocol: https://stnolting.github.io/neorv32/#_bus_interface_protocol |
Beta Was this translation helpful? Give feedback.
Hey @Sam-Vervaeck.
These are wrappers for the two UARTs that use the same "core" functions. The pointer you are mentioning is the actual "hardware handle" (a pointer to the according UART's memory-mapped interface register struct).
They are define in
neorv32_legacy.h
:neorv32/sw/lib/include/neorv32_legacy.h
Lines 2…