<div dir="ltr"><div>Hi all,</div><div><br></div><div>I've hit a small milestone on a personal project that I would like to share. It is a Squeak implementation of the RISC-V ISA, along with a (very basic for now) CPU and memory for simulation and testing. You can find the project <a href="https://github.com/darth-cheney/safe-bet/">here</a>.<br></div><div><br></div><div>So far I have only implemented the basic 32I instructions from <a href="https://riscv.org/specifications/isa-spec-pdf/">the unprivileged ISA</a>. My goal is to get the basic extension instructions implemented too, along with the 64I instructions. In terms of personal goals for the project, I'm thinking of doing something stupid like writing my own OS and Squeak seems like the kind of reduced-frustration environment that might curtail some of the inevitable hair-pulling.<br></div><div><br></div><div>Disclaimer: my knowledge of the low-level systems stuff is quite limited, so writing this package has been a learning experience. That's a polite way of saying "I have no idea what I'm actually doing." So if you spot any design choices you think are offensive or downright insane, please do file an issue or send me a message. I'm hoping that somehow this will be useful to the community.</div><div><br></div><div>If you'd like to give this a whirl, your best bet is to check out RVCPUBasic >> #bootstrap:, which takes an ordered collection of RVInstructions and loads them into the simulated memory starting at address 0. You can then send the #start message to the CPU and it will run through the instructions in memory one by one. For the moment there aren't any example "programs" to run here -- I'm open to suggestions! <br></div><div><br></div><div>I've tried to write tests as comprehensively as possible, but I'm sure I'm missing some important cases and there are certainly going to be bugs. <br></div><div><br></div><div>Shout out to the <a href="http://www.squeaksource.com/TwosComplement/">TwosComplement package</a>, which really helped me figure things out when I was in a bind.<br></div><div><br></div><div>The repo is called "Safe Bet" because it's a "small(talk) risc"<br></div><div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Eric</div></div></div></div></div>