Skip to content

JoyenBenitto/Hermes

Repository files navigation

Hermes NoC Generator

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.

Quick Start

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" bsvText

Sample 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
==========================================

Compiling Generated BSV to Verilog

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.bsv

Or use the generated Makefile (written to ./build/ by cabal test):

cd build && make

Simulation

The 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 +trace

Waveforms are written to waveform.vcd and can be viewed with GTKWave.

Prerequisites

Installation

From Hackage:

cabal install hermes-noc-gen

From source:

git clone https://github.com/JoyenBenitto/Hermes.git
cd Hermes-noc-generator
cabal build
cabal test

As a library dependency in cabal.project:

source-repository-package
    type:     git
    location: https://github.com/JoyenBenitto/Hermes.git

Supported Topologies

Topology Status Notes
Butterfly v0.1.0.0 Radix-k, arbitrary stage count

About

Hermes is a spec to on-chip interconnection network generator platform written with haskell and bluespec

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors