Hermes is a Haskell library that generates flit-based on-chip network (NoC) descriptions targeting BlueSpec SystemVerilog (BSV). Given hardware pin-budget constraints, it solves for an optimal topology, generates synthesisable BSV, and reports analytical performance metrics.
import Hermes
main :: IO ()
main = do
let constraints = ButterflyConstraints
{ targetBandwidth = 2.0 -- GBytes/s
, signalBandwidth = 1.0 -- Gbit/s per pin
, maxPinsPerChip = 150
, totalEndpoints = 64
, overheadSignals = 2
}
let spec = solveTopology constraints
let bsvText = generateBluespec spec
let metrics = computeMetrics constraints spec
putStr (formatMetrics metrics)
writeFile "HermesNoc.bsv" bsvTextSample metrics output:
=== Butterfly NoC Performance Metrics ===
Hop count (stages) : 3
Analytical latency (hops) : 3
Total router instances : 48
Bisection bandwidth : 4.0 GBytes/s
Theoretical throughput : 8.0 GBytes/s
==========================================
After generating HermesNoc.bsv, compile with BSC, pointing it to the bundled
bsv_libs/Router/ directory:
bsc -p +:path/to/bsv_libs/Router -u -verilog HermesNoc.bsvOr use the generated Makefile (written to ./build/ by cabal test):
cd build && makeThe bundled bsv_libs/Router/ directory includes a Verilator testbench for
the mkRouter2x2 module:
cd bsv_libs/Router
make build # compile Router.bsv → mkRouter2x2.v
make link_verilator # build C++ simulation model
./build/verilator/Vmk_router2x2 +traceWaveforms are written to waveform.vcd and can be viewed with GTKWave.
- GHC ≥ 9.6 & Cabal ≥ 3.10 (via GHCup)
- Bluespec Compiler (BSC) - to compile generated BSV
- Verilator ≥ 5.0 - optional, for simulation
From Hackage:
cabal install hermes-noc-genFrom source:
git clone https://github.com/JoyenBenitto/Hermes.git
cd Hermes-noc-generator
cabal build
cabal testAs a library dependency in cabal.project:
source-repository-package
type: git
location: https://github.com/JoyenBenitto/Hermes.git
| Topology | Status | Notes |
|---|---|---|
| Butterfly | v0.1.0.0 | Radix-k, arbitrary stage count |