When I started playing around with a SoC design that I wanted to implement on the iCEbreaker, I quickly realized that without proper testing tools even a moderately ambiteous design would quickly become too complex to change and improve.
There exist of course tools to simulate verilog designs and even perform formal verification but my skill level is not quite up to that yet. On top of that I am convinced that many changes that I want to try out in the cpu would benefit from regression tests that are based on real code, i.e. code generated by a compiler instead of artificial tiny bits of code: code that you do not directly implement yourself tends to expose issues in the instruction set or bugs in it hardware implementation quicker than when you deliberately try to construct tiny test cases.
For these more realistic tests an assembler and a C compiler were created and they were used to implement small string and floating point libraries mimicking some of the functions in the C standard library. And they proved their worth as they uncovered among other things bugs in the handling of conditional branches for example.
However, as we will use the assembler and compiler to perform regression tests on the cpu it is important that these tools themselves are as bug free as possible, even when we add new functionality or change implementation details. Ideally some contineous integration would be implemented using GitHub actions that would be triggered on every push.
There is one catch here though: we cannot perform the final test in our chain of dependencies simply because the GitHub machines do not have an iCEbreaker board attached ☺️
We can deal with this challenge by creating a program the will simulate the cpu we have implemented on our fpga. This way we should be able to perform the tests for the compiler/assembler toolchain against this simulator with the added benefit of having more debugging options available (because they are much easier to implement in a bit of Python that in our resource constrained hardware.
The first version of this simulator is now commited and i hope to create some contineous integration actions in the near future.
Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
Saturday, 8 February 2020
Friday, 13 December 2019
New hobby, new blog!
Recently bought an IceStick fpga development board to play around with self designed CPUs.
I already have quite a bit of things working, including a 8-bit cpu (soc actually) that can be controlled from a terminal program or dedicated monitor. Even wrote a suitable assembler.
Because some of the things I will encounter might be interesting to write about and GitHub is a lot but not actually much of a blog, I thought why not create blog alongside my other ones?
So here it is. Nothing much yet and I have to work on the layout etc. but I hope it might be interesting to some, so watch this space if you are interested in fpga's, especially the IceStick and the Icebreaker!
I already have quite a bit of things working, including a 8-bit cpu (soc actually) that can be controlled from a terminal program or dedicated monitor. Even wrote a suitable assembler.
Because some of the things I will encounter might be interesting to write about and GitHub is a lot but not actually much of a blog, I thought why not create blog alongside my other ones?
So here it is. Nothing much yet and I have to work on the layout etc. but I hope it might be interesting to some, so watch this space if you are interested in fpga's, especially the IceStick and the Icebreaker!
Subscribe to:
Posts (Atom)
CPU design
The CPU design as currently implemented largely follows the diagram shown below. It features a 16 x 32bit register file and 16 bit instructi...