|
|
Last visit was: Thu May 01, 2025 11:57 am
|
It is currently Thu May 01, 2025 11:57 am
|
A RISC-V model, in C, in just a couple of pages of code
Author |
Message |
BigEd
Joined: Wed Jan 09, 2013 6:54 pm Posts: 1821
|
. Notable: https://microcorelabs.wordpress.com/202 ... c-version/https://github.com/MicroCoreLabs/Projec ... /C_VersionQuote: There are a few RISC-V software versions out there, but my hope was to write something very simple and accessible. It only has 130 lines of code including comments!
Each loop though main() is effectively a single RISC-V clock tick. So one instruction per tick/loop. At the end of each loop I print out the program counter, the instruction’s name, some registers and decoded opcode parameters, then it waits for a keypress. This way you can single-step through your code and see the internals of the CPU!
|
Thu Apr 02, 2020 7:14 pm |
|
Who is online |
Users browsing this forum: AhrefsBot, claudebot and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|