A Brainfuck CPU in FPGA
gergo.erdi.hu
gergo.erdi.hu
I had a run in with FPGA's in school in a course where we were tasked with building "a digital device". Initially we planned to make a CPU which ran brainfuck, but in the end we made one which ran Redcode and fulfilled the corewars 88 standard [1].
I'm by no means a hardware fantast, but it was still extremely fun to build. We made a microprogrammed processor with accompanied assembler. An exercise I recommend to everyone.
[1]: http://stuff.mit.edu/afs/sipb/project/corewars/koth/doc/ICWS...
For now I'm satisfying myself with plans for a diode-matrix-microprogrammed CPU :-)
Where is your god now, high level language snobs? ;)
https://github.com/gergoerdi/brainfuck-cpu-fpga/blob/master/...
- faster design time, as you write less code to get the same things done
- reusable high level specifications
- access to high level optimizations not easily possible on the VHDL level
- easier to formally verify the high level spec matches implementation
(Aside, I used to work for a company that designed and sold these types of toolchains).
I was mostly surprised by the choice of a Haskell-based DSL. I think such languages miss their target audience. Most people writing in an HDL are hardware designers without significant software training (I am fortunate to be a software-turned-hardware person). For them making the jump to, f.e. a functional paradigm (as in Bluespec), is much harder compared to a lesser, more popular evil (C/C++ based DSLs like SystemC or AutoESL).
Also, TMs are not entirely formal in the sense that there exists multiple TMs which all are equivalent - but there is no correct implementation. So when people say TM, or even BrainFuck, then it is not entirely clear what machine they mean.