I had some problems getting the Algol CPU tests compiled and run:
The compiler I built didn't recognize the "-m32" flag specified in the makefile.
The "riscv_test.h" header file was missing.
The tests would stall because a memory leak consumed all the RAM after 25% of the tests were run.
I solved these problems by:
Installing an earlier version of the compiler.
Grabbing some files from a development branch and adding them into the master branch of my Algol repo.
Increasing the RAM size of my VM. (This doesn't fix the root cause, but avoids memory exhaustion before the end of the tests.)
With these changes, I decided to record a complete set of the steps to get to this point in case I need to do it again.
First, create the VM and start it up:
mkdir xenial64
cd xenial64
vagrant init ubuntu/xenial64
Edit the Vagrantfile to increase the RAM size:
config.vm.provider "virtualbox"do |vb|
# Customize the amount of memory on the VM:
vb.memory = "4096"
end
vagrant up
vagrant ssh
On the VM, install an earlier version of the RISC-V compiler that was originally used to test this CPU:
There are 115 tests in the suite: 96 passed and 19 failed. The failures were the timer instruction, the fence_i instruction, and all the atomic memory operation (amo*) instructions.
At this point, I have a (mostly) working simulation of the Algol CPU in MyHDL for me to start experimenting on.
Unfortunately, the build.sh failed. I tried some other linux distros (ubuntu/trusty64, debian/jessie64) without success: the toolchain failed to build for a variety of reasons. Finally, I edited the build.sh file to remove the build of the riscv-openocd tool. (I figured I wouldn't need the on-chip debugger right now.) After that, the build was successful.