Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 2.71 KB

File metadata and controls

73 lines (47 loc) · 2.71 KB

Building

To build the application, you must have installed the following:

  • Rust
  • Verilator and/or Icarus Verilog (I recommend Verilator, as it is much faster)
  • Bash (to use the provided scripts, otherwise you will need to run the commands / write scripts manually for your shell)
    • For Windows, you can get Bash through Mingw or WSL

Warning

For Windows, I highly recommend to use WSL, as this project was built and verified for Linux first. You may have problems trying to run it on bare Windows.

Included in the repo is a script to build everything.

To build, simply run from the project directory:

$ ./scripts/build_all.sh

Running

Included in the repo is a script to assemble and run a program.

To run the included hello_world program, simply run from the project directory:

$ ./scripts/run.sh verilator programs/hello_world.asm

or, using Icarus Verilog:

$ ./scripts/run.sh iverilog programs/hello_world.asm

Assemble

Usually it's fine to just use the run.sh script, which will assemble and run the application all in one, but you may want to only assemble a program.

Included in the repo is a script to assemble a program.

To assemble the included hello_world program, simply run from the project directory:

$ ./scripts/assmeble.sh programs/hello_world.asm

Note

By default, the assembler will print the machine code to stdout. You can optionally write the output to a file using redirection or using the -o <OUTPUT> option. For a full list of options the assembler supports, use the -h option.

Simulate

The simulator allows you to run a program by passing in the machine code for that program.

Included in the repo is a script to run the simulator.

To simulate a program hello_world (which contains the machine code of hello_world.asm), simply run from the project directory:

$ ./scripts/simulate.sh verilator +src=hello_world

or, using Icarus Verilog:

$ ./scripts/simulate.sh iverilog +src=hello_world

Note

The scripts will simply delegate all inputs after the first to the simulator. Therefore, all Verilator or Icarus Verilog options can also be passed through this script.

Binaries

x86_64 Linux binaries can found in the releases page. These binaries will not work with the scripts.