A centralized infrastructure repository for RTL hardware development. This ecosystem provides two core functions:
- The "Golden Pipeline": A unified GitHub Actions CI/CD architecture for automated linting, simulation, and synthesis.
- The Local Build System: A standardized
Makefileenvironment for compiling and simulating SystemVerilog IP blocks using ModelSim and Verilator.
By centralizing these tools, hardware repositories remain lightweight and do not require redundant local CI environment maintenance or complex script duplication.
The central-builder.yml workflow enforces a unified standard across all target repositories. It utilizes a dynamic "Scatter-Gather" 2D matrix architecture to run targets and modules in parallel.
Supported Toolchain:
- Linting: Verible
- Simulation: Verilator (Fast) & ModelSim / VSIM 32-bit (Slow)
- Synthesis: Yosys + Slang (ASIC & FPGA targets)
To attach a hardware repository to the CI/CD pipeline, delete any local simulation workflows and create .github/workflows/pr.yml with the following boilerplate:
name: PR Build Pipeline
on:
push:
branches: [ main ]
pull_request:
permissions:
pull-requests: write
contents: read
jobs:
call-central-builder:
uses: QREM-CORE/build-tools/.github/workflows/central-builder.yml@main
with:
rtl_repo: ${{ github.repository }}
commit_sha: ${{ github.sha }}
# Comma-separated list of top-level modules for Synthesis
top_modules: 'keccak_core, mlkem_core'
# Toggles (Default is true)
enable_synth: true
enable_lint: true
enable_verilator: true
enable_vsim: truetop_modules: This string is dynamically parsed usingjqinto a JSON array, spawning parallel Yosys synthesis jobs for every module across both ASIC and FPGA targets.- Toggles: Bypassing heavy jobs (like
enable_vsim: false) is highly recommended for minor documentation or lint-only PRs. - Outputs: The pipeline automatically aggregates the scattered matrix metrics into a unified Markdown table and posts it as a PR comment.
The common.mk file provides a dual-simulator Make environment that automatically discovers testbenches and resolves transitive dependencies in hierarchical .f filelists.
In your target hardware repository, add this tools repository as a submodule:
git submodule add https://github.com/QREM-CORE/build-tools.git build-tools
git submodule update --init --recursiveCreate a Makefile in the root of your hardware repository. It only requires one include directive:
# Optional: Override defaults here
# SIM = verilator
# INCDIRS = +incdir+rtl +incdir+lib/common_rtl
# Import the central build system
include build-tools/common.mkThe build system automatically discovers all testbenches ending in _tb.sv inside your local tb/ directory.
- Run all tests (Default: ModelSim):
make - Run all tests (Verilator):
make SIM=verilator - Run a specific testbench:
make run_keccak_core_tb SIM=verilator - Clean build artifacts:
make clean
CRITICAL: Both the local Makefile (via flatten_f.py) and the cloud Yosys pipeline strictly depend on your filelists being formatted correctly.
Your .f files must follow these four rules to ensure paths resolve correctly and "Diamond Dependency" conflicts are prevented:
- No Wildcards: Explicitly list every
.svfile (e.g.,rtl/my_module.sv). Do not use*.sv. - Relative Paths Only: List files relative to the directory where the
.ffile is located. Avoid environment variables or absolute paths. - Include Submodules via
-f: To include a submodule's filelist, use the-fflag. - Order Matters: Place package files (
*_pkg.sv) at the absolute top of your list.
Example rtl.f:
# 1. Submodules
-f lib/keccak-fips202-sv/rtl.f
# 2. Local Packages
rtl/my_pkg.sv
# 3. Local RTL
rtl/my_core.sv