Sentry is a hardware ransomware detector designed for TinyTapeout. It monitors a compact stream of block-level storage operations from a storage controller and extracts behavioural features such as write activity, address access patterns, request sizes, and entropy-related information.
These features are accumulated over observation windows and passed to one or more hardware classifiers, which produce ransomware suspicion scores or predictions. The project explores how much useful ransomware detection can be implemented using a small amount of ASIC area and state.
.
├── src/ # Verilog/SystemVerilog RTL
├── test/ # Cocotb testbenches and simulation infrastructure
│ └── unit/ # Unit tests for individual RTL modules
├── docs/ # TinyTapeout documentation
├── Makefile # Development and testing commands
├── info.yaml # TinyTapeout project configuration
└── README.md
Windows users should use WSL2 with Ubuntu 24.04 for development. The project relies on Linux development tools such as GNU Make, Icarus Verilog, cocotb, and svlint, so native Windows development is not currently recommended. MacOS has not been tested.
Open PowerShell as Administrator and run:
wsl --install -d Ubuntu-24.04Restart your computer if prompted, then open Ubuntu 24.04 and complete the initial setup.
Inside the Ubuntu/WSL terminal, run:
sudo apt update
sudo apt install -y git make iverilog python3 python3-pip python3-venv wget unzip cargoClone the repository inside the WSL filesystem:
cd ~
git clone https://github.com/uoftasic/sentry.git
cd sentryIt is recommended to keep the repository inside the Linux filesystem, such as ~/sentry, rather than under /mnt/c/.
python3 -m venv .venv
source .venv/bin/activate
pip install -r test/requirements.txtThe virtual environment must be activated again when opening a new terminal:
source .venv/bin/activateSVLINT_VERSION="0.9.3"
SVLINT_ZIP_NAME="svlint-v${SVLINT_VERSION}-x86_64-lnx.zip"
SVLINT_ZIP_URL="https://github.com/dalance/svlint/releases/download/v${SVLINT_VERSION}/${SVLINT_ZIP_NAME}"
mkdir -p /tmp/svlint
cd /tmp/svlint
wget "${SVLINT_ZIP_URL}"
unzip "${SVLINT_ZIP_NAME}"
sudo mv bin/* /usr/local/bin/
cd ~
rm -rf /tmp/svlint
svlint --versionIf svlint is not found after installation, make sure /usr/local/bin is included in your PATH.
Integration tests are placed directly under test/ and test the complete TinyTapeout design through tb.sv.
Unit tests are placed under:
test/unit/
Each unit-test filename should match the RTL module it tests. For example:
src/input_decoder.sv
test/unit/test_input_decoder.py
A testbench template is available under test/unit/ and can be copied when creating a new unit test.
The root Makefile provides the main development and testing commands.
Verify that the required tools are installed:
make doctorRun all integration tests against the top-level module:
make testRun the unit test for a specific RTL module:
make unit MODULE=<module_name>Run all detected unit tests:
make unit-allRun all unit and integration tests:
make test-allCompile all .v and .sv files under src/ using Icarus Verilog:
make compileThis provides a quick compilation check without running the cocotb testbenches.
Run svlint on all RTL source files:
make lintRun linting, compilation, and all tests:
make checkThis is the recommended command to run before opening a pull request.
make sourcesThe Makefile automatically detects .v and .sv files placed under src/.
make cleanPlace new Verilog or SystemVerilog modules under:
src/
TinyTapeout also requires source files to be added to info.yaml, so update the project configuration when adding new modules.
Install GTKWave:
sudo apt install -y gtkwaveOr install Surfer:
cargo install surferThen open the waveform with:
gtkwave test/tb.fstor:
surfer test/tb.fstUnit-test waveforms are generated under:
test/unit/sim_build/<module_name>/