Skip to content

quentinlintz/digital-design-labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Design Labs

This repo has my solutions to labs from Sarah and David Harris' Digital Design and Computer Architecture, RISC-V Edition (2021).

I won't include the instructions, but you can download them as PDFs from Elsevier.

SystemVerilog Simulation Instructions

Source your Vivado settings:

source /tools/Xilinx/Vivado/2024.1/settings64.sh

Change directory into ./SIM. To compile and run a file, use the following commands:

xvlog --sv ../SRC/thunderbird.sv ../SRC/thunderbird_tb.sv
xelab -debug typical -top thunderbird_tb -snapshot thunderbird_tb_snapshot
xsim thunderbird_tb_snapshot --tclbatch xsim_cfg.tcl  

To view the waveform:

xsim --gui thunderbird_tb_snapshot.wdb

Assembly Simulation Instructions

To make and run the assembly files, use the following commands:

make TARGET=div9
./bin/div9

Where "div9" is the name of the file without the .s extension.

C Compilation Instructions

I'm running this code on a Sparkfun Thing Plus - ESP32-C6 which is Espressif so I'm using the idf.py tool to build, debug, and flash.

If you want to use gdbgui you need to use Python version 3.11.6.

idf.py set-target esp32c6
idf.py build
idf.py -p /dev/ttyACM0 flash
idf.py openocd gdbgui monitor

Hit Ctrl+] to exit the debugger.