Introduction #
The cocotb documentation is very good and can be followed for this step. However, I recommend installation of cocotb in a virtual environment. Assuming you have Python 3.6+ and Pip installed you can follow these steps:
1. Create a Python Virtual Environment #
python3 -m venv /path/to/new/virtual/environment
2. Start Virtual Environment #
shell | command |
---|---|
bash/zsh | source /bin/activate |
csh/tcsh | source /bin/activate.csh |
3. Install Requirements #
put whatever python packages you want in a file called requirements.txt
cocotb
numpy
matplotlib
then call pip install -r requirements.txt
in your virtual environment
4. Install iverilog and gtkwave #
Most of the tutorials in this book use the icarus simulator and gtkwave to view output waveforms. To follow along you’ll need to install both.
-
Install icarus verilog simulator for simulating verilog
- mac (with homebrew installed):
brew install icarus-verilog
- windows: follow this guide
- linux:
sudo apt install iverilog
- mac (with homebrew installed):
-
Install gtkwave for viewing
.vcd
files- mac (with homebrew installed):
brew install --cask gtkwave
- windows: follow instructions on main page
- linux:
sudo apt install gtkwave
- in browser alternative: vc.drom.io
- mac (with homebrew installed):