Talc is a Verilator Testbench harness designed to test hardware implementations of networking-related logic, implemented on the Corundum NIC.
There are a few systems in this repo, the primary system being Talc.
Warning
Generally, I cannot guarantee that any of these will run outside of the provided containers due to the dependencies of the the simulation tools and environment.
Talc and CorunTB have both Docker Containers and accompanying DevContainer configuration files for use with VSCode. I provide pure docker instructions for all the containers, to not force any particular system on anyone, though, using a DevContainer is my preferred development environment.
As such, prerequisites are:
- Docker (obviously)
If using VSCode and DevContainers:
This is the primary testbench container that I have developed for my FYP.
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Open in VSCode
- If you don't have GPUs or haven't set them up to work with docker, comment out
--gpus=allindevcontainer.json > Reopen in Container(selecting thetalcoption)- Begin development
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Execute docker instructions laid out at the bottom of the Dockerfile:
- Run from repository root
docker build -t talc -f containers/talc.Dockerfile .docker run -d --name tlc --gpus=all --cap-add=NET_RAW --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun --mount type=bind,src=./src/tb,dst=/talc/tb/testbench/ --mount type=bind,src=./src/utils/py,dst=/talc/pyutils --mount type=bind,src=./nics/corundum/fpga/app/talc/rtl,dst=/talc/rtl talc- If you don't have GPUs or haven't set them up to work with docker, remove the
--gpus=alloption (argv[5])
- If you don't have GPUs or haven't set them up to work with docker, remove the
docker exec -it tlc bash
- Begin Development
CorunSim is an alternative, isolated DUT, based on SimBricks' adaptation of Corundum. It features an extracted version of the older Corundum implementation that was tweaked for use with the version of SimBricks, that I started with.
This container just contains an extracted version of the old SimBricks implementation of the Corundum NIC, which exposes two sockets to connect to for PCIe and MAC communication.
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Execute docker instructions laid out at the bottom of the Dockerfile:
- Run from repository root
docker build -t corunsim_test -f containers/corunsim.Dockerfile .docker run -d --name corunsim_tb corunsim_testdocker exec -it corunsim_tb bash
- Begin Work
CorunTB is an outdated version of the Talc system that doesn't contain a lot of the newer additions to the environment, but I kept it here in case one wishes to use a very simple version of this testbench, without the full development toolset, and large codebase refactoring.
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Open in VSCode
- If you don't have GPUs or haven't set them up to work with docker, comment out
--gpus=allindevcontainer.json > Reopen in Container(selecting thecoruntboption)- Begin development
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Execute docker instructions laid out at the bottom of the Dockerfile:
- Run from repository root
docker build -t coruntb -f containers/coruntb.Dockerfile .docker run -d --name cortb --gpus=all --cap-add=NET_RAW --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun --mount type=bind,src=./src/tb,dst=/corundum/fpga/app/template/tb/coruntb --mount type=bind,src=./src/tap/py/,dst=/tapaz/ coruntb- If you don't have GPUs or haven't set them up to work with docker, remove the
--gpus=alloption (argv[5])
- If you don't have GPUs or haven't set them up to work with docker, remove the
docker exec -it cortb bash
- Begin Development
Tunic is based off of this fork, of the Tonic system. This was intended to be fixed up and merged into the Corundum App Logic block, to provide a further template for hardware implementation.
Warning
There really is not much use in opening this container, since it's unfinished and still has a lot of the bugs present in the original repo.
- Clone repo
- Initialise and Update git submodule
git submodule update --init --recursivewould pull in all submodules
- Execute docker instructions laid out at the bottom of the Dockerfile:
- Run from repository root
docker build -t tunic_test -f containers/tunic.Dockerfile .docker run -d --name tunic_tb tunic_testdocker exec -it tunic_tb bash
source /tunic/venv/bin/activate- Begin Work
./tools/runtest --type sim --config tonic/tonic_reno.yaml
VSCode's special devcontainer directory.
devcontainer.json- contains the devcontainer configs for Talc
coruntb/devcontainer.json- contains the devcontainer configs for
coruntb
- contains the devcontainer configs for
A directory to hold container Dockerfiles and various other helper files.
configs/- contains VSCode configuration files for talc and coruntb, as well as a
requirements.txtfor those containers
- contains VSCode configuration files for talc and coruntb, as well as a
patches/(README)Dockerfiles- the 4 Dockerfiles for each of the available containers
A directory to hold nic submodules, as well as some helper files relating to the NICs.
A directory to hold the bash scripts that I make use of.
basic_net/- the scripts that I wrote to spin up the infrastructure for namespaced mock devices that could be used to test the NIC
global/(README)- these are pulled into the Talc and CorunTB containers for use there
c_tap/- contains the file written by my supervisor (using GPT-4o), to create a TAP device in C++
tb- this is the main testbench codebase that's mounted into the Talc and CorunTB containers for development
utils/py/- contains the python utility libraries used (and globally available) within the Talc container
When moving onto testing for specific boards, the base assumption is that none of Corundum's source files have been modified: only the top-level files in talc/rtl/ that modify the App block, i.e. none of the files in talc/rtl/common/, only the files like mqnic_app_block.v. If any of these are changed, it's alright, but they will need to be copied over, too.
All other directories, as a result of all the Corundum symlinks, should be pulled in everywhere needed, so, as long as you remember to port your specific app logic over to where it's needed, too, you should be all set to use the Corundum system, using their README.