View on GitHub

CompactRISC16

CompactRISC (CR16) CPU (with an assembler) for the Computer Design Laboratory ECE 3710 class at The University of Utah

CompactRISC16 (CR16) CPU

This is an implementation of the CompactRISC (CR16) CPU written in Verilog and SystemVerilog with an assembler written in Java for the Computer Design Laboratory ECE 3710 class at The University of Utah. This CPU was designed to run on an FPGA and interface with peripheral components and hardware. Our group’s final project for this class is entitled “FSS Prototype” and uses this CPU and assembler. More information on our final project can be found here.

Authors

How This Repository is Organized

Assembler

To compile an assembly code file in accordance with the CR16 ISA, run the assembler/assembler shell script with the given arguments as outlined below. Some example programs are given in src/asm. A good example showing the capabilities of the ISA and the assembler is shown in src/asm/test_all/all.asm. Note that the Java Runtime Environment is required to run the assembler and must be of version 11 or greater. Also note that you may need to make the script executable via: chmod 755 assembler/assembler.

Usage: assembler [options] <assembly code file path>
  Options:
    -d, --debug
      Turns on debug mode.
      Default: false
    -p, --max-padding-line
      The line number to which padding lines should be added to an output
      binary.
      Default: 0
    -v, --max-padding-line-value
      The decimal value of the padding lines.
      Default: 0
    -b, --number-base
      The number base of the output binary.
      Default: HEX
      Possible Values: [BINARY, DECIMAL, HEX]
    -o, --output
      The output binary file path. Defaults to <input assembly file>.dat.
    -s, --output-processed
      True to write the processed assembly to <output binary file
      path>.processed.asm.
      Default: false

Verilog Source Naming Conventions and Format For This Repository

Verilog Source Formatting For This Repository

To format verilog source code, use the istyle-verilog-formatter tool via the format script:

.formatter/verilog/format <paths to files or directories>

For example, to recursively format Verilog source files in the src directory, use the following command:

.formatter/verilog/format src

The istyle-verilog-formatter is used as a submodule in the .formatter/verilog directory. Either clone this repository with git clone --recurse-submodules or use git submodule init; git submodule update to clone the istyle-verilog-formatter repository into the .formatter/verilog directory so that the format script can run properly. The format shell script will run make if the iStyle binary is not already present in the istyle-verilog-formatter directory. Note: you may need to make the script executable via: chmod 755 .formatter/verilog/format.