Close

Procrastination

A project log for SPAM-1 - 8 Bit CPU

8 Bit CPU in 7400 with full Verilog simulator and toolchain

John LonerganJohn Lonergan 12/02/2021 at 17:410 Comments

So it's nearly Christmas again and everyone at work is doing Advent Of Code. I did that for a couple of years and eventually I get hacked off with it and bail.

So this year rather than finishing off the hardware for SPAM-1 I'm going to learn something new seeing if I have the energy to write an emulator for SPAM-1 to speed up software development.

 Currently I road test my software on a timing accurate emulation built using my 7400 verilog model. Whilst Verilog been a really useful tool for checking hardware ideas I found that the Icarus Verilog engine is quite slow and so my Sims take too long. For instance running the Chip-8 tertis have via the Verilog model/SIM is super slow motion.

So I have the Verilog for hardware verification but what is want is something faster for simulation for software dev purposes.

So if I have the patience then I will write an emulator in multiple languages and that can be my advent of code.

I'm most of the way there with a typescript impl and have already come to the conclusion that although the language ecosystem has a few niggles the lack of good doco on building a basic typescript app and what certain errors mean is a pain in the arse. Still I'll push ahead. Disclosure I am historically a C/C++/Java/Scala programmer with a bit of assembler and python. 

Once that's done maybe I'll have a look at go and maybe even rust again. My last look at rush left me feeling that it would be unproductive to take a team and adopt it because it's so hard to get a program to even compile successfully, but on the other hand I had the feeling that if you can get a rust program to compile then it probably had relatively few coding bugs in it. Strange tradeoff, getting fired Vs accepting a high bug rate.

I did say to myself I'd try Nim or Elixir but I'd also like to do something more substantial like my emulator in kotlin. I have most experience in the last 10 years with Scala and I'd like to have a better go at kotlin because right now I'm using Java and remembering why I was glad to start functional programming in Scala.

Anyway seasons greetings (if it's tolerable to say that on 2 Dec)

Discussions