[sw/common] added new makefile target "sim"

can be used for in-console simulation of current application using GHDL and the default processor testbench ("simple"/script-based testbench setup)
This commit is contained in:
stnolting 2021-09-10 16:24:06 +02:00
parent 2c66af5cf1
commit 6246f0e8c0
3 changed files with 29 additions and 1 deletions

View file

@ -1050,13 +1050,30 @@ the compiler's _USER_FLAGS_ variable (do not forget the `-D` suffix flag):
sw/example/blink_led$ make USER_FLAGS+=-DUART0_SIM_MODE clean_all all
----
The provided define will change the default UART0/UART1 setup function in order to set the simulation mode flag in the according UART's control register.
The provided define will change the default UART0/UART1 setup function in order to set the simulation
mode flag in the according UART's control register.
[NOTE]
The UART simulation output (to file and to screen) outputs "complete lines" at once. A line is
completed with a line feed (newline, ASCII `\n` = 10).
:sectnums:
=== In-Console Application Simulation
To directly compile and run a program in the console (using the default testbench and GHDL
as simulator) you can use the `sim` makefile target. Make sure to use the UART simulation mode
(`USER_FLAGS+=-DUART0_SIM_MODE` and/or `USER_FLAGS+=-DUART1_SIM_MODE`) to get
faster / direct-to-console UART output.
[source, bash]
----
sw/example/blink_led$ make USER_FLAGS+=-DUART0_SIM_MODE clean_all sim
[...]
Blinking LED demo program
----
:sectnums:
=== Simulation using GHDL