|A RISC-V model, in C, in just a couple of pages of code
|Page 1 of 1|
|Author:||BigEd [ Thu Apr 02, 2020 7:14 pm ]|
|Post subject:||A RISC-V model, in C, in just a couple of pages of code|
https://microcorelabs.wordpress.com/202 ... c-version/
https://github.com/MicroCoreLabs/Projec ... /C_Version
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!
|Page 1 of 1||All times are UTC|
|Powered by phpBB® Forum Software © phpBB Group