Tag Archives: cpu

Writing an assembler

I have a rough assembler written for the CPU I’m designing. Enough so far to convert simple programs such as :

shoved 12 shoved 12 add

Into:

14 00 0c 14 00 0c 00

This will make generating code for testing the instruction fetch / decode unit a lot more convenient. I’m also using a python module titled ‘IntelHex’. Quartus II requires Intel Hex format or a proprietary Altera format for ROM and memory initialization files. This python module makes it easy to generate  hex files. You can find it here: https://pypi.python.org/pypi/IntelHex/1.1 . I’m documenting my assembler at this page: http://www.dillo.us/wiki/projects/doku.php?id=fpga_stack_machine_assembler

 

Memory stuff with verilog

I’m working on a LIFO module for the CPU I’m designing and was wondering whether or not I should use the megafunction for a ram block or just use an array of  regs. I went with an array of regs because that’s simpler. I expected it to just create a pile of FFs but the compiler used some of the on chip SRAM instead. Cool. I’d rather use of some of the M9K blocks than chew up a bunch of LEs  for that.

inferred_ram