FPGA Archive

Fixed a bug in the FPGA-Elf

My friend Ken pointed out that unlike a real Elf, my FPGA-Elf didn’t display the contents of memory if you repeatedly press the input button while in load mode with memory protect enabled.  At first I couldn’t figure out how the real Elf did that, but careful study of the schematic and the 1802 manual [...]

The original COSMAC Elf ran at 1 to 2 MHz.  Every machine cycle required eight oscillator cycles, and each instruction required two or three machine cycles, so each instruction took 8 to 12 microseconds at 2 MHz, or 16 to 24 microseconds at 1 MHz.
The FPGA-Elf runs at 25 MHz when using a Spartan-3E FPGA [...]

Video of demo of FPGA-Elf

Richard Ottosen used my cell phone to shoot a short video of me demonstrating the FPGA-Elf, toggling in and running the dice demo.
Thanks to Jim Donnelly, Richard Ottosen, and Jim Phillips for helping me put together the FPGA-Elf front panel!  I never would have been able to get the project completed by the deadline without [...]

I needed a demo program for the FPGA-Elf that was at least a little more interesting than simply counting, so I wrote a dice program.  When you press the input button, it simulates rolling a pair of six-sided dice.  Perfect for playing board games.  The program is 49 bytes long, so it is somewhat tedious [...]

After much gnashing of teeth and pulling of hair, I finally figured out what was causing load mode to fail on the real hardware despite working on the simulator.  My “next state” logic didn’t have a default value, so both the simulator and the synthesizer were inferring a latch.  However, somehow the synthesizer wasn’t doing [...]

I’ve added some photos of the completed hardware, showing the Avago hexadecimal displays to my FPGA-Elf set.  I also shot a brief video showing an LED test, though it is not using the 1802 core.  (I got the 1802 core working last night a few hours after I shot the video.)
While I’m on vacation my [...]

I got the switches wired up and working, with a little help from Richard Ottosen.  I tested the debouncer, which worked.  Then I went for broke and loaded the complete Elf system into the FPGA.  After a bit more debugging, it partially works.
What doesn’t work is load mode, so I can’t yet toggle in a [...]

I’ve wired up the Avago hexadecimal LEDs to the FPGA board and verified that they work with some VHDL test code (not yet tried with the VHDL Elf code). Now I need to wire up the switches.
Does anyone have an interesting game that can be toggled into a basic Elf (just the toggle switches, LEDs, [...]

I changed the state machine in my Elf code to something much simpler, based on the observation that in load mode the DMA input cycle *always* is acknowledged immediately, and that I don’t have to wait for the 1802 core state code output to indicate DMA before deasserting the DMA input.
Now I can (in simulation) [...]

I threw together a testbench for the Elf, with the switch debouncing disabled.  The testbench tries to use load mode to load a program that has an infinite loop setting and clearing the Q flag, which is available as an output.
The GHDL simulator can dump the state of all the signals as a VCD file, [...]