Simulating ATTARC With Logisim-Evolution

My next step for this project is to develop an emulator of some sort to speed software development and debugging. Minecraft computers are very slow, even ATTARC, and I can produce working software faster with a system that will run it faster. For example, in Minecraft it takes ATTARC about 5 minutes to calculate the Fibonacci sequence to 16 bits. Reminds me of the bad old days when I would run "make" and get a cup of coffee.

My first thought was to write a software virtual machine. ATTARC is a trivial architecture so that should not be too difficult.

But as I sat down to start coding I realized that, while I could produce a simple emulator that runs the code as fast as possible and NOT simulating timing hazards, it would need to be cycle-accurate to really validate software, and it would take a lot more work to make it "cycle-accurate". Nothing I can't handle, but it does bump up the complexity,

So then I got to wondering if there might be an existing simulation system I could adapt to my architecture. I poked around ye olde internets until I found Logisim-Evolution.

Logisim is quite old these days, but Evolution has spruced it up quite a bit, and it's really quite a nice little digital logic simulator with a few advanced features for VHDL and FPGA developoment.

So I started modeling ATTARC 1.0 in Logisim-Evolution. Here's how far I got.

As you can see I've modeled the program counter, ROM, the three busses, and a few of the functional units.

And it works, sort of, but it is SLOWER THAN MINECRAFT REDSTONE.  I did not expect Logisim to run ATTARC at 6GHz... But I did not expect it to be slower than Minecraft. 

Logisim can only simulate this thing at about 2Hz, and since logisim ticks are basically game ticks, that's equivalanet a 1Hz redstone clock; 1/10th the speed of Minecraft Bedrock Edition's 10Hz redstone clock.

So this will NOT be useful for my goal of accelerating software development.

However I have a few ideas for how it might be useful in the end.

1. Even thought it's simulation is slower than Minecraft, it's must easier to build and instrument circuits. It's useful as for timing analysis, hardware validation, and prototyping smaller units of functionality.

2. This model uses something like 2,400 registers to implement the redstone repeaters. I'm 100% certain this model would be more efficient with a more efficient repeater model. I modeled repeaters this way so the schematic would visual resemble Minecraft, but the performance cost is huge. Merging all of these 1 tick repeaters into one 20-tick repeater or whatever would make the simulation hugely cheaper.

So I'm not sure what my next steps are. I will either continue with Logisim and try to remodel my repeaters to be more efficient, or I will punt and go back to writing a software emulator.

Stay tuned!

Comments

Popular posts from this blog

Introducing ATTARC: Advanced Transport Triggered Architecture for Redstone Computing

Calculating the Fibonacci sequence using 16 bit words on ATTARC 1.0