Last visit was: Mon Jan 25, 2021 1:34 pm
It is currently Mon Jan 25, 2021 1:34 pm



 [ 1 post ] 
 A RISC-V model, in C, in just a couple of pages of code 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1540
.
Notable:
https://microcorelabs.wordpress.com/202 ... c-version/
https://github.com/MicroCoreLabs/Projec ... /C_Version

Quote:
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
 [ 1 post ] 

Who is online

Users browsing this forum: CCBot 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

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software