doc: Update as we now have also nrf5340 models
And remove non ASCII characters, and align internal implementation description with the new naming convention. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
f4595802d3
commit
54e6e57bc4
|
@ -53,8 +53,8 @@ time(microsecond),port,pin,level
|
|||
101624,0,0,1
|
||||
```
|
||||
|
||||
Where pin 0 in port 0, is toggled at boot, 200µs, 600µs, 800µs, 1ms (up and immediately down),
|
||||
and 101.624ms.
|
||||
Where pin 0 in port 0, is toggled at boot, 200microseconds, 600microseconds, 800microseconds, 1ms
|
||||
(up and immediately down), and 101.624ms.
|
||||
|
||||
### Configuration file format
|
||||
|
||||
|
@ -82,7 +82,7 @@ For example:
|
|||
short 0.1 1.2
|
||||
short 0.1 1.3
|
||||
```
|
||||
To short pint 1 from port 0, to both pins 2 and 3 from port 1,<br>
|
||||
To short pin 1 from port 0, to both pins 2 and 3 from port 1,<br>
|
||||
|
||||
```
|
||||
short 1.0 0.2
|
||||
|
|
|
@ -5,11 +5,14 @@ HAL functions. When used in combination with the real nrfx, these should enable
|
|||
meant for the nrfx to run without needing further changes.
|
||||
This includes Zephyr SW.
|
||||
|
||||
Where relevant
|
||||
[differences](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52.html&cp=5)
|
||||
exist, these models try to align with an
|
||||
[nRF52833](https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52833.html?cp=5_1).
|
||||
Though it is the intention that models of other nordic SOCs will be included in the future.
|
||||
These models include models of peripherals for an
|
||||
[nRF52833](https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52833.html?cp=5_1)
|
||||
and an [nRF5340](https://infocenter.nordicsemi.com/topic/struct_nrf53/struct/nrf5340.html?cp=4_0).
|
||||
<br> Note that for these models use case an nRF52833 is very similar to other
|
||||
[nRF52 series devices](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52.html&cp=5)
|
||||
, so even if you are developing for another variant in that series these models may be enough for
|
||||
you.<br>
|
||||
It is the intention that models of other nordic SOCs will be included in the future.
|
||||
|
||||
These models library is intended to be used as an extension to the
|
||||
[native simulator](https://github.com/BabbleSim/native_simulator/).
|
||||
|
@ -44,12 +47,12 @@ default.
|
|||
The NRF_RADIO peripheral model uses [BabbleSim](http://babblesim.github.io)
|
||||
for the radio environment simulation.
|
||||
|
||||
For more information about the HW models, or how to use them without the
|
||||
nrf52_bsim please refer to [README_HW_models.md](./README_HW_models.md)
|
||||
For more information about the HW models, or how to use them without
|
||||
Zephyr please refer to [README_HW_models.md](./README_HW_models.md)
|
||||
|
||||
## What these models include
|
||||
|
||||
Not all SOC peripherals are modelled yet, and for some of the included peripherals
|
||||
Not all SOCs peripherals are modelled yet, and for some of the included peripherals
|
||||
not all features or options are modelled. This is typically the case for HW functionality
|
||||
which is not used by the Zephyr drivers/OS.
|
||||
You can find what features of which peripherals are included so far, and with what approximations in
|
||||
|
|
|
@ -2,7 +2,7 @@ For general information about these models refer to [README.md](README.md)
|
|||
|
||||
You will only need to continue reading if you are curious about how these
|
||||
models are built, or if you want to use them for some other purpose than
|
||||
with Zephyr's nrf52_bsim.
|
||||
with Zephyr's nrf5*_bsim.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
@ -13,8 +13,8 @@ We are not interested in modelling the particularities of the HW when
|
|||
they are not relevant for the SW execution.
|
||||
Therefore many details can be simplified or omited all together.
|
||||
|
||||
The focus of these models is on the Zephyr BLE stack, and therefore
|
||||
only the peripherals which are necessary for its proper function have
|
||||
The focus of these models is on the BLE and 15.4 stacks, and therefore
|
||||
mostly the peripherals which are necessary for its proper function have
|
||||
been modelled so far.
|
||||
|
||||
Regarding the time accuracy, these models will focus mostly on the radio
|
||||
|
@ -61,13 +61,13 @@ The overall HW scheduler provided by the native_simulator, will advance simulate
|
|||
when needed, and call into the corresponding HW submodule "event|task runner"
|
||||
whenever its event time is reached.
|
||||
|
||||
Note that several HW submodules may be scheduled to run in the same µs.
|
||||
In this case, they will be handled in different "delta cycles" in that same µs.
|
||||
Note that several HW submodules may be scheduled to run in the same microsecond.
|
||||
In this case, they will be handled in different "delta cycles" in that same microsecond.
|
||||
Each timer|event has a given priority, and therefore will always be called
|
||||
in the same order relative to other HW events which may be schedule in the
|
||||
same µs.<br>
|
||||
same microsecond.<br>
|
||||
Note also, that any HW submodule may schedule a new event to be called in the
|
||||
same µs in which it is running. This can be done for any purpose,
|
||||
same microsecond in which it is running. This can be done for any purpose,
|
||||
like for example to deffer a sideeffect of writing to a register from a SW
|
||||
thread into the HW models thread.
|
||||
When they do so, their "event|task runner" will be called right after in the
|
||||
|
@ -81,8 +81,8 @@ This structure will be allocated somewhere in the process memory, but certainly
|
|||
not in the same address as in the real HW.
|
||||
Therefore any access to the real registers must be, in someway, corrected
|
||||
to access this structure instead.
|
||||
In Zephyr's nrf52_bsim case, this is achieved by providing a version of the
|
||||
macros which, in real point to the peripherals base addresses, which points
|
||||
In Zephyr's nrf5*_bsim case, this is achieved by providing a version of the
|
||||
macros which, in real HW point to the peripherals base addresses, which points
|
||||
to these structures.
|
||||
|
||||
Writing to this structure in itself will only cause that memory location to be
|
||||
|
@ -95,26 +95,27 @@ For example, in real HW, writting a `1` to
|
|||
`NRF_RNG->TASKS_START` will start the random number generation.
|
||||
|
||||
For these type of registers with sideeffects, the HW models must be triggered,
|
||||
this is achieved by calling `nrf_<periperal>_regw_sideeffects_<register name>()`
|
||||
this is achieved by calling `nhw_<periperal>_regw_sideeffects_<register name>()`
|
||||
after the write itself.
|
||||
In the nrf52_bsim case, this is done in the replacement nRFx HAL function.
|
||||
In Zephyr's nrf5*_bsim case, this is done in the replacement nRFx HAL function.
|
||||
|
||||
### HW interrupts
|
||||
|
||||
For a HW model to raise an interrupt all it will need to do is call into the
|
||||
interrupt controller model function `hw_irq_ctrl_set_irq(<irq_nbr>)`.
|
||||
interrupt controller model functions
|
||||
`hw_irq_ctrl_raise/lower_level_irq_line(<cpu_nbr>, <irq_number>)`.
|
||||
|
||||
The interrupt controller will update its status, and if the interrupt was not
|
||||
masked, one delta cycle later, awake the CPU by calling
|
||||
`posix_interrupt_raised()`.
|
||||
masked, one delta cycle later, awake the CPU by calling the corresponding
|
||||
`nsif_cpun_irq_raised(<cpu_nbr>)`.
|
||||
|
||||
In the nrf52_bsim `posix_interrupt_raised()` is provided by the Zephyr
|
||||
POSIX arch `inf_clock`.
|
||||
In Zephyr's nrf5*_bsim `nsif_cpun_irq_raised(<cpu_nbr>)` is provided by the Zephyr
|
||||
board code.
|
||||
|
||||
### Structure of the HW models:
|
||||
|
||||
The actual HW models of the SOC peripherals are split in one file per peripheral.
|
||||
The files are named `NRF_<PERIPHERAL>.{c|h}`.
|
||||
The files are named `NHW_<PERIPHERAL>.{c|h}`.
|
||||
|
||||
Mostly all these models have the following functions:
|
||||
|
||||
|
@ -129,14 +130,14 @@ These models use:
|
|||
Overall, they follow a pattern where each peripheral has these types of functions:
|
||||
|
||||
```
|
||||
nrf_<periperal>_init() : To initialize the model
|
||||
nrf_<periperal>_cleanup() : To free any resources used by the model
|
||||
nrf_<periperal>_<TASK name>() : Perform the actions triggered by <TASK>
|
||||
nrf_<periperal>_regw_sideeffects_<register name>()
|
||||
nhw_<periperal>_init() : To initialize the model
|
||||
nhw_<periperal>_cleanup() : To free any resources used by the model
|
||||
nhw_<periperal>_<TASK name>() : Perform the actions triggered by <TASK>
|
||||
nhw_<periperal>_regw_sideeffects_<register name>()
|
||||
: Trigger any possible sideeffect from writing
|
||||
to that regiter
|
||||
Timer_<peripheral> &
|
||||
nrf_<periperal>_timer_triggered() : Models which take time to perform their work
|
||||
nhw_<periperal>_timer_triggered() : Models which take time to perform their work
|
||||
Use a registered event. When that event timer
|
||||
is reached, this function is called to perform
|
||||
any neccessary step, including update that
|
||||
|
@ -154,7 +155,7 @@ specified in the linked documentation.
|
|||
## Integrating these models in another system
|
||||
|
||||
This subsection provides information you would need if you try to use
|
||||
these models without the nrf52_bsim wrapping logic.
|
||||
these models without Zephyr's nrf5*_bsim wrapping logic.
|
||||
|
||||
### Models interface towards a simulation scheduler
|
||||
|
||||
|
@ -206,7 +207,7 @@ Meaning, only one function may be called at a time.<br>
|
|||
This is not going to be a problem if only one thread calls into the HW models.
|
||||
It won't be a problem either if by any other synchronization mechanism it is
|
||||
ensured only one thread calls into these HW models at a time.
|
||||
(this second case is how it is done in the nrf52_bsim)
|
||||
(this second case is how it is done in Zephyr's nrf5*_bsim)
|
||||
|
||||
### Command line intercace arguments
|
||||
|
||||
|
@ -217,5 +218,5 @@ The integration program should support this.
|
|||
The way to describe the command line arguments follows Babblesim's
|
||||
`libUtilv1` command line parsing convention.
|
||||
|
||||
You can check the nrf52_bsim wrapping code for an insight on how
|
||||
You can check Zephyr's nrf5*_bsim wrapping code for an insight on how
|
||||
you can use these component.
|
||||
|
|
|
@ -1,84 +1,64 @@
|
|||
# Current implementation status
|
||||
|
||||
Currently these models aim at modelling the peripherals of a nRF52833 SOC at varying degrees:
|
||||
Currently peripherals of a nRF52833 and nrf5340 SOCs are modelled at varying degrees:
|
||||
|
||||
* ✓ **NVMC** — Non-volatile memory controller
|
||||
* See [NRF_NVMC.c](../src/HW_models/NRF_NVMC.c)
|
||||
* ✓ **FICR** — Factory information configuration registers
|
||||
* See [NRF_FICR.c](../src/HW_models/NRF_FICR.c)
|
||||
* ✓ **UICR** — User information configuration registers
|
||||
* See [NRF_NVMC.c](../src/HW_models/NRF_NVMC.c)
|
||||
* 𐄂 **POWER** — Power supply
|
||||
* Only register stubs
|
||||
* ✓ **CLOCK** — Clock control
|
||||
* See [NRF_CLOCK.c](../src/HW_models/NRF_CLOCK.c)
|
||||
* ✓ **AAR** — Accelerated address resolver
|
||||
* See [NRF_AAR.c](../src/HW_models/NRF_AAR.c)
|
||||
* 𐄂 **ACL** — Access control lists
|
||||
* Not modelled yet
|
||||
* ✓ **CCM** — AES CCM mode encryption
|
||||
* See [NRF_AES_CCM.c](../src/HW_models/NRF_AES_CCM.c)
|
||||
* 𐄂 **COMP** — Comparator
|
||||
* Not modelled yet
|
||||
* ✔ **ECB** — AES electronic codebook mode encryption
|
||||
* Complete
|
||||
* ✔ **EGU** — Event generator unit
|
||||
* Complete
|
||||
* ✓ **GPIO** — General purpose input/output
|
||||
* See [NRF_GPIO.c](../src/HW_models/NRF_GPIO.c)
|
||||
* ✔ **GPIOTE** — GPIO tasks and events
|
||||
* Complete with very minor differences
|
||||
* See [NRF_GPIOTE.c](../src/HW_models/NRF_GPIOTE.c)
|
||||
* 𐄂 **I2S** — Inter-IC sound interface
|
||||
* Not modelled yet
|
||||
* 𐄂 **LPCOMP** — Low-power comparator
|
||||
* Not modelled yet
|
||||
* 𐄂 **MWU** — Memory watch unit
|
||||
* Not modelled yet
|
||||
* 𐄂 **NFCT** — Near field communication tag
|
||||
* Not modelled yet
|
||||
* 𐄂 **PDM** — Pulse density modulation interface
|
||||
* Not modelled yet
|
||||
* ✔ **PPI** — Programmable peripheral interconnect
|
||||
* Complete but some peripheral connections are missing
|
||||
* 𐄂 **PWM** — Pulse width modulation
|
||||
* Not modelled yet
|
||||
* 𐄂 **QDEC** — Quadrature decoder
|
||||
* Not modelled yet
|
||||
* ✓ **RADIO** — 2.4 GHz radio
|
||||
* See [NRF_RADIO.c](../src/HW_models/NRF_RADIO.c)
|
||||
* ✓ **RNG** — Random number generator
|
||||
* See [NRF_RNG.c](../src/HW_models/NRF_RNG.c)
|
||||
* ✓ **RTC** — Real-time counter
|
||||
* See [NRF_RTC.c](../src/HW_models/NRF_RTC.c)
|
||||
* 𐄂 **SAADC** — Successive approximation analog-to-digital converter
|
||||
* Not modelled yet
|
||||
* 𐄂 **SPI** — Serial peripheral interface master
|
||||
* Not modelled yet
|
||||
* 𐄂 **SPIM** — Serial peripheral interface master with EasyDMA
|
||||
* Not modelled yet
|
||||
* 𐄂 **SPIS** — Serial peripheral interface slave with EasyDMA
|
||||
* Not modelled yet
|
||||
* ✔ **SWI** — Software interrupts
|
||||
* See EGU
|
||||
* ✓ **TEMP** — Temperature sensor
|
||||
* See [NRF_TEMP.c](../src/HW_models/NRF_TEMP.c)
|
||||
* 𐄂 **TWI** — I2C compatible two-wire interface
|
||||
* Not modelled yet
|
||||
* ✔ **TIMER** — Timer/counter
|
||||
* Complete
|
||||
* 𐄂 **TWIM** — I2C compatible two-wire interface master with EasyDMA
|
||||
* Not modelled yet
|
||||
* 𐄂 **TWIS** — I2C compatible two-wire interface slave with EasyDMA
|
||||
* Not modelled yet
|
||||
* 𐄂 **UART** — Universal asynchronous receiver/transmitter
|
||||
* Not modelled yet
|
||||
* 𐄂 **UARTE** — Universal asynchronous receiver/transmitter with EasyDMA
|
||||
* Not modelled yet
|
||||
* 𐄂 **USBD** — Universal serial bus device
|
||||
* Not modelled yet
|
||||
* 𐄂 **WDT** — Watchdog timer
|
||||
* Not modelled yet
|
||||
Notation:
|
||||
|
||||
| Mark | Meaning |
|
||||
|---|---|
|
||||
|✔| Fully completed |
|
||||
|✅| Implemented |
|
||||
|☐| Minimal/stubbed implementation |
|
||||
|𐄂| Missing |
|
||||
|
||||
ARM processor peripherals or the AHB interconnect are not part of these models
|
||||
<br>
|
||||
|
||||
| | | **nRF52833** | **nRF5340** | Notes |
|
||||
|---|---|---|---|---|
|
||||
| **AAR** | Accelerated address resolver | ✅ | ✅ | See [NRF_AAR.c](../src/HW_models/NRF_AAR.c) |
|
||||
| **ACL** | Access control lists | 𐄂 | 𐄂 | |
|
||||
| **CACHE** | Instruction/data cache | N/A | 𐄂 | |
|
||||
| **CCM** | AES CCM mode encryption | ✅ | ✅ | See [NRF_AES_CCM.c](../src/HW_models/NRF_AES_CCM.c) |
|
||||
| **CLOCK** | Clock control | ✅ | ✅ | See [NRF_CLOCK.c](../src/HW_models/NRF_CLOCK.c) |
|
||||
| **COMP** | Comparator | 𐄂 | 𐄂 | |
|
||||
| **DPPI** | Distributed programmable peripheral interconnect | N/A | ✔ | |
|
||||
| **ECB** | AES electronic codebook mode encryption | ✔ | ✔ | |
|
||||
| **EGU** | Event generator unit | ✔ | ✔ | |
|
||||
| **FICR** | Factory information configuration registers | ✅ | ✅ | See [NRF_FICR.c](../src/HW_models/NRF_FICR.c) |
|
||||
| **GPIO** | General purpose input/output | ✅ | 𐄂 | For 52: See [NRF_GPIO.c](../src/HW_models/NRF_GPIO.c) |
|
||||
| **GPIOTE** | GPIO tasks and events | ✔ | 𐄂 | For 52: Complete with very minor differences, see [NRF_GPIOTE.c](../src/HW_models/NRF_GPIOTE.c) |
|
||||
| **I2S** | Inter-IC sound interface | 𐄂 | 𐄂 | |
|
||||
| **IPC** | Interprocessor communication | 𐄂 | 𐄂 | |
|
||||
| **KMU** | Key management unit | 𐄂 | 𐄂 | |
|
||||
| **LPCOMP** | Low-power comparator | 𐄂 | 𐄂 | |
|
||||
| **MUTEX** | Mutual exclusive peripheral | N/A | 𐄂 | |
|
||||
| **MWU** | Memory watch unit | 𐄂 | N/A | |
|
||||
| **NFCT** | Near field communication tag | 𐄂 | 𐄂 | |
|
||||
| **NVMC** | Non-volatile memory controller | ✅ | ✅ | See [NRF_NVMC.c](../src/HW_models/NRF_NVMC.c) |
|
||||
| **OSCILLATORS** | Oscillator control | N/A | 𐄂 | |
|
||||
| **PDM** | Pulse density modulation interface | 𐄂 | 𐄂 | |
|
||||
| **POWER** | Power supply | ☐ | ☐ | Only register stubs |
|
||||
| **PPI** | Programmable peripheral interconnect | ✔ | N/A | Complete but some peripheral connections are missing |
|
||||
| **PWM** | Pulse width modulation | 𐄂 | 𐄂 | |
|
||||
| **QDEC** | Quadrature decoder | 𐄂 | 𐄂 | |
|
||||
| **RADIO** | 2.4 GHz radio | ✅ | ✅ | See [NRF_RADIO.c](../src/HW_models/NRF_RADIO.c) |
|
||||
| **REGULATORS** | Regulator control | N/A | 𐄂 | |
|
||||
| **RESET** | Reset control | N/A | ☐ | Only register stubs |
|
||||
| **RNG** | Random number generator | ✅ | ✅ | See [NRF_RNG.c](../src/HW_models/NRF_RNG.c) |
|
||||
| **RTC** | Real-time counter | ✅ | ✅ | See [NRF_RTC.c](../src/HW_models/NRF_RTC.c) |
|
||||
| **SAADC** | Successive approximation analog-to-digital converter | 𐄂 | 𐄂 | |
|
||||
| **[Q]SPI[M/S]** | [Quad] Serial peripheral interface [master/slave] | 𐄂 | 𐄂 | |
|
||||
| **SPU** | System protection unit | N/A | 𐄂 | |
|
||||
| **SWI** | Software interrupts | ✔ | ✔ | |
|
||||
| **TEMP** | Temperature sensor | ✅ | ✅ | See [NRF_TEMP.c](../src/HW_models/NRF_TEMP.c) |
|
||||
| **TIMER** | Timer/counter | ✔ | ✔ | |
|
||||
| **TWI[M/S]** | I2C compatible two-wire interface | 𐄂 | 𐄂 | |
|
||||
| **UART[E]** | Universal asynchronous receiver/transmitter [with EasyDMA] | 𐄂 | 𐄂 | |
|
||||
| **UICR** | User information configuration registers | ✅ | ✅ | See [NRF_NVMC.c](../src/HW_models/NRF_NVMC.c) |
|
||||
| **USBD** | Universal serial bus device | 𐄂 | 𐄂 | |
|
||||
| **USBREG** | Universal serial bus device | N/A | 𐄂 | |
|
||||
| **VREQCTRL** | Voltage request control | N/A | ☐ | Only register stubs |
|
||||
| **VMC** | Volatile memory controller | N/A | 𐄂 | |
|
||||
| **WDT** | Watchdog timer | 𐄂 | 𐄂 | |
|
||||
|
||||
ARM processor peripherals or the AHB interconnect are not part of these models
|
||||
|
|
Loading…
Reference in New Issue