From 060be525ae9d17bd33450d067e00695735bf4517 Mon Sep 17 00:00:00 2001 From: Mateusz Stadnik Date: Thu, 12 Dec 2024 22:07:28 +0100 Subject: [PATCH] [IN] Improved GPIO coverage And fixed README.md --- README.md | 13 ++++++---- .../gpio/hello_gpio_irq/hello_gpio_irq.resc | 7 ++++++ .../gpio/hello_gpio_irq/hello_gpio_irq.robot | 24 +++++++++++++++++++ tests/tests.yaml | 1 + 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.resc create mode 100644 tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot diff --git a/README.md b/README.md index 081a6f8..646fa68 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ There is predefined Raspberry Pico board description in: 'boards/raspberry_pico. | **IRQ** | $${\color{yellow}✓}$$ | Propagation from some peripherals is implemented | | **DMA** | $${\color{green}✓}$$ | DMA implemented with ringing and control blocks support | | **Clocks** | $${\color{yellow}✓}$$ | Clocks are mostly just stubs, but with tree propagation, but virtual time is always correct | -| **GPIO** | $${\color{green}✓}$$ | Pins manipulation implemented, with interrupts support. PIO may needs to be manually reevaluated due to CPU emulation (it's not step by step). Look for RP2040_SPI (PL022) peripheral as an example. Statuses may not be adequate to simplify simulation for now . | +| **GPIO** | $${\color{green}✓}$$ | Pins manipulation implemented, with interrupts support. PIO may needs to be manually reevaluated due to CPU emulation (it's not step by step). Look for RP2040_SPI (PL022) peripheral as an example. Statuses may not be adequate to simplify simulation for now . |readm | **XOSC** | $${\color{green}✓}$$ | | | **ROSC** | $${\color{green}✓}$$ | | | **PLL** | $${\color{green}✓}$$ | | @@ -48,7 +48,7 @@ Due to that PIO is modelled as additional CPU. Renode executes more than 1 step at once on given CPU, so manual synchronization is necessary in some cases, like interworking between SPI and PIO. > [!IMPORTANT] -> For Windows piosim.dll is delivered in piosim/redist directory +> For Windows piosim.dll must be compiled inside msys environment: > If you want to modify you have to setup msys environment with mingw-gcc and mingw-make. > Exactly the same as for Verilator modules: [CoSimulation Renode](https://renode.readthedocs.io/en/latest/tutorials/co-simulating-custom-hdl.html). > Otherwise expect segmentation faults or Renode crashing on reading file header. @@ -147,7 +147,10 @@ You can check example usages inside tests/pio/pio_blink/pio_blink.resc or tests/ # Renode Version This respository is highly coupled with Renode version. -Use this repository with Renode **1.15.3** +Use this repository with stable Renode **1.15.3** + +On linux only mono version is supported. +For some reason dotnet version reports problems with IronPython, but it may be issue visible only on my machine. # Testing I am testing simulator code using official pico-examples and some custom made build on top of pico-examples. For more informations look at pico_example_patches. Current tests list with statuses: @@ -203,8 +206,8 @@ I am testing simulator code using official pico-examples and some custom made bu | Example | Passed | | :---: | :---: | | [dht_sensor](https://github.com/raspberrypi/pico-examples/tree/master/gpio/dht_sensor) | $${\color{red}✗}$$ | -| [hello_7segment](https://github.com/raspberrypi/pico-examples/tree/master/gpio/hello_7segment) | $${\color{red}✗}$$ | -| [hello_gpio_irq](https://github.com/raspberrypi/pico-examples/tree/master/gpio/hello_gpio_irq) | $${\color{red}✗}$$ | +| [hello_7segment](https://github.com/raspberrypi/pico-examples/tree/master/gpio/hello_7segment) | $${\color{green}✓}$$ | +| [hello_gpio_irq](https://github.com/raspberrypi/pico-examples/tree/master/gpio/hello_gpio_irq) | $${\color{green}✓}$$ | ## Hello World diff --git a/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.resc b/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.resc new file mode 100644 index 0000000..47ac4b1 --- /dev/null +++ b/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.resc @@ -0,0 +1,7 @@ +$global.TEST_FILE=$ORIGIN/../../../pico-examples/build/gpio/hello_gpio_irq/hello_gpio_irq.elf +$machine_name="pico_tests" + +include $ORIGIN/../../../prepare.resc + +showAnalyzer sysbus.uart0 + diff --git a/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot b/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot new file mode 100644 index 0000000..9539c50 --- /dev/null +++ b/tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot @@ -0,0 +1,24 @@ +*** Settings *** + +Suite Setup Setup +Suite Teardown Teardown +Test Teardown Test Teardown +Test Timeout 300 seconds + +Library ${CURDIR}/DisplayTester.py + +*** Test Cases *** +Run successfully 'hello_gpio_irq' example + Execute Command include @${CURDIR}/hello_gpio_irq.resc + + Create Terminal Tester sysbus.uart0 + + Wait For Line On Uart Hello GPIO IRQ timeout=4 + Execute Command sysbus.gpio WritePin 2 true + Wait For Line On Uart GPIO 2 EDGE_RISE timeout=4 + Execute Command sysbus.gpio WritePin 2 false + Wait For Line On Uart GPIO 2 EDGE_FALL timeout=4 + + + + diff --git a/tests/tests.yaml b/tests/tests.yaml index 37e4641..3ed53ec 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -29,6 +29,7 @@ - testcases/flash/ssi_dma/ssi_dma.robot - testcases/flash/nuke/flash_nuke.robot - testcases/gpio/hello_7segment/hello_7segment.robot +- testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot - testcases/hello_world/serial/hello_serial.robot - testcases/multicore/hello_multicore/hello_multicore.robot - testcases/multicore/multicore_fifo_irqs/multicore_fifo_irqs.robot