Comments (18)
I just reread the spec in that section again.
Would a good approach be to, inside the emulator, emulate the AMOs as other atomics. I.e. make them appear as LR.W
/SC.W
? It feels like that is easier to emulate than actual AMOs.
from mini-rv32ima.
For the time being, I've added the following note:
†: Zifence+RV32A are stubbed. So, tweaks will need to be made if you want to emulate a multiprocessor system with this emulator.
from mini-rv32ima.
Please be more specific about what is needed? Keep in mind this is a single-core hart + there is no memory ordering constraints as everything happens synchronously.
Do you have any tests I can test against?
I have considered also reducing functionality of A to AMOSwap
only though I am unsure how to clarify this. Do you have any feedback? Considering A's SW will invalidate any other pending load operations, I don't see any harm in allowing all operations to pass synchronously. Maybe I'm misunderstanding something?
from mini-rv32ima.
Please be more specific about what is needed? Keep in mind this is a single-core hart + there is no memory ordering constraints as everything happens synchronously.
Documentation.
You should explain how the Zicsr and Zifencei extensions are also implemented and the caveats of the atomic extension being non-atomic.
Do you have any tests I can test against?
I have considered also reducing functionality of A to
AMOSwap
only though I am unsure how to clarify this. Do you have any feedback? Considering A's SW will invalidate any other pending load operations, I don't see any harm in allowing all operations to pass synchronously. Maybe I'm misunderstanding something?
There are none as there is only one CPU.
from mini-rv32ima.
also idk if u know this but you can have GCC emulate multiplication and just omit the M extension. there is also an option in BR to do so.
from mini-rv32ima.
I am aware of this, but it added to the complexity significantly for the targets where I could do that and I couldn't figure out how to build the kernel against RV32IA using buildroot.
I will need to do more research to really understand RV32A. I still don't actually understand how it works. It would be "nice" to make it actually atomic.
from mini-rv32ima.
Tbh I'm impressed it works without it but nice to know it's not actually necessary in practice.
from mini-rv32ima.
I mean I Would like to add proper support, at least for AMOSwap
but I don't understand what to do based on the language used in the spec.
from mini-rv32ima.
Go look at libgcc it's what implements multiplication when there is no hw multiplier. Look in the gcc root gcc/libgcc/config/riscv/atomic.c
I think that emulates C atomics when HW doesn't support it. So I would take that as a reference.
from mini-rv32ima.
I guess I don't understand what it is overall you are recommending I do?
from mini-rv32ima.
Just add documentation of the caveats I explained. If you want to fix the caveats you can refer to my last post. Or just document them. You should also explained what you did with the fence and friends instructions.
from mini-rv32ima.
What I'm trying to explain is I still don't understand how what I've done is different from how it should be. I can't really document what I don't understand.
from mini-rv32ima.
What I'm trying to explain is I still don't understand how what I've done is different from how it should be. I can't really document what I don't understand.
That's fine I don't understand it well either. Just a general explanation that they are not to spec. Which you have done now!
from mini-rv32ima.
If you want this will make Linux without M extension and also shortens both the defconfigs
https://github.com/Mr-Bossman/buildroot/commits/mini
from mini-rv32ima.
@Mr-Bossman how long does boot take? How big is your kernel image?
from mini-rv32ima.
@Mr-Bossman how long does boot take? How big is your kernel image?
Ignore the file ext.
4MiB
Image.zip
this / is in qemu in yours it takes ~0.3s for my PC.
from mini-rv32ima.
Wow that's really impressive. I didn't think that would be possible w/o M.
from mini-rv32ima.
its very much a hack lol
from mini-rv32ima.
Related Issues (20)
- Doom build fails since 32-bit libraries not installed (I think?) HOT 3
- (Suggestion) extension to G(IMAFD)-spec? HOT 4
- vi with no filename faults with access fault HOT 12
- Human readable unit tests for rv64imafdc instructions
- Bare-metal libc HOT 3
- Kernel panics on emulator compiled for ARM (trying to run linux on the Raspberry Pi Pico) HOT 8
- inittab for buildroot HOT 1
- "make testdlimage" => "./mini-rv32ima -f DownloadedImage" ... hangs (tested on 3 different platforms). HOT 4
- I Made it! esp32c3 can run linux with this wonderful emulator HOT 10
- Test page trimming
- Use as an embedded application loader HOT 2
- U-BOOT HOT 5
- Can it run OpenSBI? HOT 9
- Customizing allowed instruction set? HOT 1
- Possible to get a full debian running on this? HOT 1
- Virtual Graphical interface HOT 1
- Invalid Discord Invite HOT 3
- Integrating Kernel on FPGA HOT 3
- Simplify sign-extension of immediates during instruction decoding HOT 3
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 mini-rv32ima.