Skip to content

Commit

Permalink
[IN] Improved GPIO coverage
Browse files Browse the repository at this point in the history
And fixed README.md
  • Loading branch information
matgla committed Dec 12, 2024
1 parent 22af84d commit 060be52
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}✓}$$ | |
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.resc
Original file line number Diff line number Diff line change
@@ -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

24 changes: 24 additions & 0 deletions tests/testcases/gpio/hello_gpio_irq/hello_gpio_irq.robot
Original file line number Diff line number Diff line change
@@ -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




1 change: 1 addition & 0 deletions tests/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 060be52

Please sign in to comment.