diff --git a/doc/dev/release-procedure.md b/doc/dev/release-procedure.md index 1d3afe82b..1e5586a22 100644 --- a/doc/dev/release-procedure.md +++ b/doc/dev/release-procedure.md @@ -62,7 +62,18 @@ cp sonata-vX.Y.bit.slot3.uf2 ../ ### Automated testing +Run tests on simulation (note python3.11 or above required). +FPGA testing is currently done in CI and requires quite a few add-ons to your board. + +```shell +# Build the simulator +fusesoc --cores-root=. run --target=sim --tool=verilator --setup --build lowrisc:sonata:system +# Run the tests +util/test_runner.py sim -e sw/cheri/build/tests/test_runner --simulator-binary build/lowrisc_sonata_system_0/sim-verilator/Vtop_verilator +``` + Run tests on FPGA (note python3.11 or above required), adjust the /dev part to the UART as required. +You will need to connect a Raspberry Pi sense HAT and a temperature sensor to QWIIC 1. ```shell ./util/test_runner.py fpga -e ./sw/cheri/build/tests/test_runner -t ./util/sonata-openocd-cfg.tcl /dev/ttyUSB2 @@ -105,6 +116,61 @@ Got second flash read: 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ``` +Run the USB connection test: +```shell +util/mem_helper.sh load_program -e sw/cheri/build/checks/usbdev_check +``` +Connect the user USB to a laptop's USB-A port. +The UART should show this: +``` +Initialising USB +Connected +Test passed; disconnected from USB. +``` + +Run the USB echo test. +First you need to apply the following diff: +```diff +diff --git a/sw/cheri/checks/usbdev_check.cc b/sw/cheri/checks/usbdev_check.cc +index 4212ae7..7c68507 100644 +--- a/sw/cheri/checks/usbdev_check.cc ++++ b/sw/cheri/checks/usbdev_check.cc +@@ -26,7 +26,7 @@ using namespace CHERI; + // - if disconnection is not enabled then a terminator emulator may be attached to `/dev/ttyUSB` + // and a sign-on message should be observed. Any characters entered into the terminal will + // be echoed on the UART output. +-static constexpr bool do_disconnect = true; ++static constexpr bool do_disconnect = false; + + static void write_strn(UartPtr uart, const char *str, size_t len) { + while (len-- > 0u) { +``` +Then use the following commands: +```shell +cmake --build sw/cheri/build +util/mem_helper.sh load_program -e sw/cheri/build/checks/usbdev_check +``` + +Check the UART output is: +``` +Initialising USB +Connected +Sent sign-on message over USB. +``` + +Open USB serial output. +For me this is `screen /dev/ttyUSB1`. +Check that the output is: +``` +Hello from CHERI USB! +``` +Also type into the USB screen instance and see that it is echoed on the UART side. + +Here are some checks that you should also do for which there are no detailed instructions: +- Check the Ethernet is working. +- Check the manual pinmux test over PMOD. +- Check the RS-485 is working. + #### Vivado - Known errors None at the moment. @@ -153,9 +219,12 @@ Open screen: screen /dev/ttyUSB2 921600 ``` -You should see output from the simple demo after you press the reset button (SW5): +You should see output from the simple demo after you press the reset button (SW5). +The git SHA will depend on the commit your built your bitstream on, please confirm this is the same as you expect. ``` +bootloader: Sonata system git SHA: 9f794fe3bd4eec8d +bootloader: Selected software slot: 1 bootloader: Loading software from flash... bootloader: Booting into program, hopefully. Led Walk Raw: Look pretty LEDs! @@ -201,13 +270,13 @@ These values will change as you move your hand over the proximity sensor. ### Snake demo -Load snake demo and play snake: +Load snake demo, set your software switch to 2 and play snake: ```shell # Copy to parent release dir -cp ./build/cheriot/cheriot/release/snake_demo.slot1.uf2 ../snake_demo_vX.Y.slot1.uf2 +cp ./build/cheriot/cheriot/release/snake_demo.slot2.uf2 ../snake_demo_vX.Y.slot2.uf2 # Program onto the FPGA -cp ../snake_demo_vX.Y.slot1.uf2 /path/to/SONATA/ +cp ../snake_demo_vX.Y.slot2.uf2 /path/to/SONATA/ ``` Check that you see capability the exception LEDs light up and fade out when you hit the game boundaries ('tag' exception for top and left boundaries, 'bounds' exception for bottom and right boundaries). @@ -246,8 +315,10 @@ Test runner: All tests finished in 42895559 cycles In your release directory from the procedures above you should have: - `sonata-vX.Y.bit.slot1.uf2` + - `sonata-vX.Y.bit.slot2.uf2` + - `sonata-vX.Y.bit.slot3.uf2` - `sonata_simple_demo_vX.Y.slot1.uf2` - - `snake_demo_vX.Y.slot1.uf2` + - `snake_demo_vX.Y.slot2.uf2` Use these to create the GitHub release, remember to include the RP2040 UF2 and include appropriate release notes. @@ -303,4 +374,4 @@ An example release notes looks something like this: > 5. Once programming is successful, you should see the "CHERI" LED light up and the "LEGACY" LED turn off. If this is not the case, the bitstream loading may have failed and you should retry by unplugging and replugging the main USB on the Sonata board. Then re-drag the bitstream into the "SONATA" drive. > 6. After programming the bitstream, drag the `sonata_simple_demo_vX.Y.slot1.uf2` into the "SONATA" drive. > 7. You should now see the user LEDs turn on and off, as well as the lowRISC logo appear on the LCD. -> 8. You can also drag `snake_demo_vX.Y.slot1.uf2` into the SONATA drive to play snake using the joystick. Watch the CHERI error LEDs as you hit the boundary. +> 8. You can also drag `snake_demo_vX.Y.slot2.uf2` into the SONATA drive to play snake using the joystick. Make sure to switch to the second software slot (SW7) and reset the board with SW5. Watch the CHERI error LEDs as you hit the boundary.