Skip to main content
This guide will walk you through setting up your development environment for Tiny TPU. The project uses cocotb for testing, iverilog for simulation, and GTKwave for viewing waveforms.

Prerequisites

Before you begin, ensure you have:
  • Python 3.7 or later
  • Git (for version control)
  • A package manager (Homebrew for MacOS, apt for Ubuntu/Linux)

Platform-specific setup

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install cocotb
pip install cocotb

# Install iverilog using Homebrew
brew install iverilog

GTKwave installation

On MacOS, you must build GTKwave from source. Other installation methods (like Homebrew) do not currently work correctly.

Building GTKwave from source (MacOS only)

1

Download GTKwave source

Visit the GTKwave website or GitHub repository to download the latest source code.
2

Build and install

Follow the build instructions provided in the GTKwave source distribution.
3

Verify installation

gtkwave --version

Installing GTKwave (Ubuntu/Linux)

On Ubuntu/Linux, GTKwave can be installed directly from the package manager:
sudo apt install gtkwave

Verify your installation

After completing the setup, verify that all tools are installed correctly:
# Check cocotb
python -c "import cocotb; print(cocotb.__version__)"

# Check iverilog
iverilog -v

# Check GTKwave
gtkwave --version

Project structure

Once your environment is set up, familiarize yourself with the project structure:
  • src/ - SystemVerilog source files for all modules
  • test/ - Cocotb test files and dump modules
  • waveforms/ - Generated VCD waveform files
  • sim_build/ - Simulation build artifacts
  • Makefile - Build and test automation

Next steps

Adding modules

Learn how to add new modules to the Tiny TPU

Testing

Understand the testing framework and workflow

Waveforms

View and analyze waveforms with GTKwave

Build docs developers (and LLMs) love