Comments (4)
Hi @slosar, thanks for asking the question.
Renode simulations operate based on fully-controlled virtual time flow which allows us to obtain reproducible results and recreate scenarios where timing of events is important from the perspective of a simulated application.
Having said that, at the CPU level we operate on a simplified model where we assume that on average execution of each instruction takes the same amount of time. The performance of the CPU itself (the number of executed instructions per virtual second) can be controlled with the PerformanceInMIPS
parameter.
For simulation performance reasons accesses to MappedMemory
are optimized and executed as pointer operations directly at CPU level to avoid the necessity of executing C# layer.
To assess performance of your system taking into account memory accesses, you might use the post-mortem analysis of the execution traces. Please take a look at https://antmicro.com/blog/2023/07/risc-v-co-design-using-trace-based-simulation-with-renode-and-tbm/ and https://antmicro.com/blog/2022/09/execution-tracing-in-renode/.
Of course extending current CPU model with the notion of long-running instructions is technically possible, but would require some design and implementation work.
from renode.
@mateusz-holenko - that's interesting. In a fit of trying to understand what the assumption behind the average execution time is, I simulated an STM32F4 and ran 1M loops of 100 asm("nop")
at PerformanceInMIPS = 168
. Then I compared this to the runtime on the actual STM32F4 discovery board, which is clocked at 168MHz.
It turns out that the HW board performs only marginally better than the Renode simulation (613.1ms on HW vs 625ms on renode).
This seems to indicate that the average execution time that renode assumes for a Cortex-M4 is only very slightly (~2%) higher than 1. Is that an expected result? Can I tweak that number somewhere?
from renode.
A somewhat related question, would it be possible to implement something like that as a python peripheral. Can python peripheral force "wait" cycles to the CPU? In practice any modern system does not use a constant time to fetch contents of memory location, but any effects of cache, etc should still be quite straightforward to deterministically simulate.
from renode.
It turns out that the HW board performs only marginally better than the Renode simulation (613.1ms on HW vs 625ms on renode).
I think any NOP takes exactly one cycle to execute. What you are seeing is almost certainly time "quantization" I think. Have you tried taking 10M loops vs 1M and see if the discrepancy changes?
from renode.
Related Issues (20)
- LimitTimer can be created with Frequency '-1' and resetting it sets freq to 0.
- Failed to emulate mbed-os-socket-example for both wireless and wired board
- Support with adding Goodix GT911 I2C Touch Device
- CAN Bus Example HOT 4
- Usage with EFM32GG, board STK3700 HOT 3
- Adding external spi flash to nrf5340 (using Macronix_MX25R) HOT 1
- STM32_PWR peripheral initialization HOT 3
- Way to jump to specific PC while running the firmware directly via monitor or pyrenode? HOT 12
- Compatibility Issue with HSS Version When Booting Ubuntu Server Image on Simulated Icicle in Renode
- Zynq-7000 peripheral limitations? HOT 1
- STM32F2 Timer triggered DMA sampled ADC
- Add command line display of `renode` version? HOT 5
- bug report? Is it considered a bug when a stm32f4 based open-source software can't boot in renode? HOT 2
- Request to support SiLabs' EFM32PG28 & PG28-PK2506A HOT 1
- Error while using CC2520 SPI peripheral on STM32F4
- Error when running HSS in Renode with PolarFire SoC Icicle Example .resc files HOT 4
- STM32 Timer limits behaviour
- Trying to write to a disabled Tx
- STM32F2 DMA driven SPI
- STM32F2 DMA driven I2C
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from renode.