Add "_zicsr_zifencei" to "rv32imac" when describing the CPU core. This
is required by newer versions of the spec, and will eventually be a
requirement of Renode.
Signed-off-by: Sean Cross <sean@xobs.io>
The riscv foundation changed the descriptor of riscv cores. We must now
add "_zicsr_zifencei" to the "rv32i" designation in order to ensure we
have access to CSRs and the "FENCE.I" instruction.
Signed-off-by: Sean Cross <sean@xobs.io>
For some reason renode is now complaining about a C# error where
a (ulong) cannot be cast to a (uint) type without an explicit
type cast.
This fixes that error. Seems to work ok.
Many of the devicse have changed from `uint` to `ulong`, so forward-port
the peripherals to work with the new format.
Signed-off-by: Sean Cross <sean@xobs.io>
The ticktimer wasn't properly adjusting the upper bits, meaning delays
of more than 42 days did not function properly. This was discovered as
part of the libstd tests.
Signed-off-by: Sean Cross <sean@xobs.io>
Precursor has a custom TIMER0 module that is different from other LiteX
timers. Adapt the Renode model to match the hardware.
Signed-off-by: Sean Cross <sean@xobs.io>
When we started this project, all Renode Litex modules were 8-bits, and
we had to custom-make a 32-bit timer module. However, in the interim,
upstream has grown a 32-bit variant of this timer. As of this writing,
this change was made two years ago.
Remove our custom variant and use the upstream version instead.
Signed-off-by: Sean Cross <sean@xobs.io>
Give a "Betrusted" namespace to all of the peripherals. This will enable
us to upstream various modules without breaking compatibility with our
own versions of these peripherals.
Signed-off-by: Sean Cross <sean@xobs.io>
if anyone objects to these feel free to revert them, but it's
nice to have some helper scripts local to my machine in the root
dir that don't always show up in my status.
Use the `BackingFile` property of the SPI flash block in order to allow
SPI flash writes to persist across runs. This will write out the SPI
flash contents as data is written.
Signed-off-by: Sean Cross <sean@xobs.io>
This audio codec lives on I2C and doesn't really do much for us.
However, by adding this device we can now pass `test oqc`.
The next step will be to implement `BetrustedI2S` which is where the
actual audio emulation occurs.
Signed-off-by: Sean Cross <sean@xobs.io>
Because of the previous commit, endianness was incorrect and we weren't
reading the full range of values.
Correct the endianness and support continuous reads. Also expose various
settings so they may be adjusted.
Signed-off-by: Sean Cross <sean@xobs.io>
Previously, the code would only allow for reading one register at a
time. This caused that one register to be duplicated repeatedly.
As a result, readings such as Voltage were incorrect.
Signed-off-by: Sean Cross <sean@xobs.io>
Add the loader into the main workspace, removing it from its own
sub-workspace. We can do this now that we can specify the linker script
in `build.rs`.
This improves IDE support, and should shrink disk storage requirements.
Signed-off-by: Sean Cross <sean@xobs.io>
This adds a working Ethernet implementation based on the WF200. It
currently gets connected to a Linux machine running a udhcpd server,
however it could also get connected to a TUN/TAP connection on Linux or
Mac.
Signed-off-by: Sean Cross <sean@xobs.io>
The COM bus is fundamentally three things: The SoC, the EC, and the glue
that binds the two together.
Now that we have the `EnsureTypeIsLoaded` trick, split the file into
three different groups.
Signed-off-by: Sean Cross <sean@xobs.io>
Emulate both the SPINOR block as well as the OSPI flash attached to it.
With this change, the PDDB can now be initialized and resets itself
properly. Additionally, data persists across virtual reboots.
Data does not persist across runs of the emulator. That will follow in
an upcoming patch.
Signed-off-by: Sean Cross <sean@xobs.io>