Skip to content
hw.dev
hw.dev/signal/sky130-crypto-cocotb-decorator-coverage-2026
SignalSky130 Crypto RoT

A Gate-Level Check Finds Cocotb Tests It Used to Miss

A gate-level coverage check now finds every Cocotb test declaration instead of silently skipping valid decorator forms.

Thesis connection

Chip teams get a trustworthy test inventory before a design reaches the slower gate-level simulation stage.

#eda#testing#verification#software
Read Original

The Sky130 Crypto Root of Trust (RoT) project found that its gate-level coverage check could report success while skipping valid Cocotb tests. Cocotb is a Python framework for testing digital hardware simulations. The check used a regular expression that recognized only one spelling of a test declaration, so tests with a timeout, an expected error, or a bare decorator disappeared from both the run list and the exclusion list.

The replacement parses the Python file into an abstract syntax tree, the structured representation a compiler uses, and walks every function for Cocotb test decorators. A new regression covers eight legal forms and requires each test to be run or excluded with a reason. The project's current 19 tests produce the same result, but a future test can no longer vanish because its author wrote the decorator differently.

This is a small fix with a large consequence for chip verification: a green coverage gate now means the test inventory was complete, not just that a pattern matched. Teams with script-built test manifests should add one deliberately unusual declaration and confirm that their gate fails when it is omitted.