Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 22, 2024
15a8324 · Jan 22, 2024

History

247 Commits
Jan 22, 2024
Dec 24, 2016
Jul 19, 2022
Jul 18, 2022
Jan 7, 2019
Jul 19, 2022
Jul 15, 2022
Jul 19, 2022
Dec 31, 2016
Dec 24, 2016
Dec 24, 2016
Aug 21, 2018
Dec 26, 2016
Dec 24, 2016

Repository files navigation

CI Codacy Badge

This is a simple microcontroller that runs a compiled LISP dialect. Details of operation are in the wiki.

Running in simulation

This uses Icarus Verilog for simulation (http://iverilog.icarus.com/). Tests are located in the tests/ directory. Run them as follows:

make test

The test runner searches files for patterns that begin with 'CHECK:'. The output of the program will be compared to whatever comes after this declaration. If they do not match, an error will be flagged.

Manually running a program

  • Compile the LISP sources. This produces two files: program.hex, which has the raw program machine code and is loaded by the simulator, and program.lst, which is informational and shows details of the generated code. For example:

      ./compile.py tests/test1.lisp
    

Note that any writes to register index 0 will be printed to standard out by the simulation test harness, which is how most simulation tests work.

  • Run simulation. The simulator will read rom.hex each time it starts.

      vvp sim.vvp
    

Running in hardware

This has only been tested under Quartus/Altera with the Cyclone II starter kit. There are a couple of projects located under the fpga/ directory:

  • 7seg: simple program that displays numbers on the 4-digit, 7 segment display
  • game: a little arcade-style demo with animated sprites

To build:

  • Compile the LISP sources. These are located in the project directory, but must be compiled from the top directory. For example, from LispMicrocontroller/

      ./compile.py fpga/game/game.lisp
    

    rom.hex will be created in the top level LispMicrocontroller/ directory.

  • Synthesize the design Open the program file (for example, fpga/game/game.qpf). Note that the synthesis tools will read rom.hex to create the values for program ROM. If you recompile the LISP sources (thereby changing rom.hex), the design must be re-synthesized.

  • Run using the programmer included with Quartus.