Update test scripts to exercise the UART and PLIC. Change-Id: I625beeaee0a355030541d1ad72c2e320e5317e63
diff --git a/shodan_plic_test.robot b/shodan_plic_test.robot new file mode 100644 index 0000000..d3c503d --- /dev/null +++ b/shodan_plic_test.robot
@@ -0,0 +1,35 @@ + +*** Settings *** +Suite Setup Setup +Suite Teardown Teardown +Test Setup Reset Emulation +Library DebugLibrary +Resource ${RENODEKEYWORDS} + +*** Variables *** +${BOOTROM_ELF} @${PATH}/out/shodan/build-bin/sw/device/boot_rom/boot_rom_sim_verilator.elf +${SHODAN_SECURE_REPL} @${PATH}/sim/config/shodan_secure.repl +${PLIC_SANITY_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/dif_plic_sanitytest_sim_verilator.elf +${UART} sysbus.uart + +*** Keywords *** +Create Machine + [Arguments] ${elf} + + Execute Command mach create + Execute Command machine LoadPlatformDescription @${SHODAN_SECURE_REPL} + Execute Command sysbus LoadELF @${BOOTROM_ELF} + Execute Command sysbus LoadELF @${elf} + Execute Command sysbus.cpu_0 PC 0x8084 + + +*** Test Cases *** + +PLIC Sanity Test + Create Machine ${PLIC_SANITY_TEST} + + Create Terminal Tester ${UART} + + Start Emulation + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart PASS! timeout=1
diff --git a/shodan_uart_test.robot b/shodan_uart_test.robot index 0245db6..3efed05 100644 --- a/shodan_uart_test.robot +++ b/shodan_uart_test.robot
@@ -3,20 +3,48 @@ Suite Setup Setup Suite Teardown Teardown Test Setup Reset Emulation +Library DebugLibrary Resource ${RENODEKEYWORDS} -*** Test Cases *** -Should Boot from BootROM +*** Variables *** +${BOOTROM_ELF} @${PATH}/out/shodan/build-bin/sw/device/boot_rom/boot_rom_sim_verilator.elf +${SHODAN_SECURE_REPL} @${PATH}/sim/config/shodan_secure.repl +${UART_SANITY_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/dif_uart_sanitytest_sim_verilator.elf +${UART_TX_RX_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/uart_tx_rx_test_sim_verilator.elf +${UART} sysbus.uart + +*** Keywords *** +Create Machine + [Arguments] ${elf} + Execute Command mach create - Execute Command machine LoadPlatformDescription @${PATH}/sim/config/shodan_secure.repl - Execute Command sysbus LoadELF @${PATH}/out/opentitan/build-bin/sw/device/boot_rom/boot_rom_sim_verilator.elf - Execute Command sysbus LoadELF @${PATH}/out/opentitan/build-out/sw/device/tests/dif_uart_sanitytest_sim_verilator.elf + Execute Command machine LoadPlatformDescription @${SHODAN_SECURE_REPL} + Execute Command sysbus LoadELF @${BOOTROM_ELF} + Execute Command sysbus LoadELF @${elf} Execute Command sysbus.cpu_0 PC 0x8084 - Create Terminal Tester sysbus.uart + +*** Test Cases *** + +UART Sanity Test + Create Machine ${UART_SANITY_TEST} + + Create Terminal Tester ${UART} + + Start Emulation + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart PASS! timeout=1 + + +UART TX RX Test + Create Machine ${UART_TX_RX_TEST} + + Create Terminal Tester ${UART} Start Emulation - Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! - - + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart UART TX RX test timeout=1 + Wait For Line On Uart Initializing the UART timeout=1 + Wait For Line on Uart Initializing the PLIC timeout=1 + Wait For Line on Uart Executing the test. timeout=1
diff --git a/shodan_unit_tests.robot b/shodan_unit_tests.robot new file mode 100644 index 0000000..4b1d89e --- /dev/null +++ b/shodan_unit_tests.robot
@@ -0,0 +1,60 @@ + +*** Settings *** +Suite Setup Setup +Suite Teardown Teardown +Test Setup Reset Emulation +Library DebugLibrary +Resource ${RENODEKEYWORDS} + +*** Variables *** +${BOOTROM_ELF} @${PATH}/out/shodan/build-bin/sw/device/boot_rom/boot_rom_sim_verilator.elf +${SHODAN_SECURE_REPL} @${PATH}/sim/config/shodan_secure.repl +${UART_SANITY_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/dif_uart_sanitytest_sim_verilator.elf +${UART_TX_RX_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/uart_tx_rx_test_sim_verilator.elf +${PLIC_SANITY_TEST} @${PATH}/out/shodan/build-out/sw_shodan/device/tests/dif_plic_sanitytest_sim_verilator.elf +${UART} sysbus.uart + +*** Keywords *** +Create Machine + [Arguments] ${elf} + + Execute Command mach create + Execute Command machine LoadPlatformDescription @${SHODAN_SECURE_REPL} + Execute Command sysbus LoadELF @${BOOTROM_ELF} + Execute Command sysbus LoadELF @${elf} + Execute Command sysbus.cpu_0 PC 0x8084 + + +*** Test Cases *** + +UART Sanity Test + Create Machine ${UART_SANITY_TEST} + + Create Terminal Tester ${UART} + + Start Emulation + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart PASS! timeout=1 + + +UART TX RX Test + Create Machine ${UART_TX_RX_TEST} + + Create Terminal Tester ${UART} + + Start Emulation + + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart UART TX RX test timeout=1 + Wait For Line On Uart Initializing the UART timeout=1 + Wait For Line on Uart Initializing the PLIC timeout=1 + Wait For Line on Uart Executing the test. timeout=1 + +PLIC Sanity Test + Create Machine ${PLIC_SANITY_TEST} + + Create Terminal Tester ${UART} + + Start Emulation + Wait For Line On Uart Boot ROM initialisation has completed, jump into flash! timeout=1 + Wait For Line On Uart PASS! timeout=1