Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floogen: Add NoC generation framework #24

Merged
merged 128 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
c394a22
refactor: Rename `src` folder to `hw`
fischeti Jan 3, 2024
2bef31d
refactor: Move testbenches into `hw/tb`
fischeti Jan 3, 2024
1be7787
refactor: Move test modules into `hw/test` folder
fischeti Jan 3, 2024
bfc929e
refactor: Create new `hw/tb/wave` directory for all wave scripts
fischeti Jan 3, 2024
dee6f1a
refactor: Move `typedef.svh` in `hw/include` folder
fischeti Jan 3, 2024
67d3694
refactor: Modify `Bender.yml` accordingly
fischeti Jan 3, 2024
2893672
refactor: Change paths in Makefile
fischeti Jan 3, 2024
205b46b
refactor: Update `fusesoc.core`
fischeti Jan 3, 2024
daabf1a
refactor: Update links in README
fischeti Jan 3, 2024
7748e2d
refactor: fix directory of `test/include` folder in `Bender.yml`
fischeti Jan 3, 2024
e0a153a
refactor: Fix more include folders
fischeti Jan 3, 2024
2d98d27
refactor: Fix more paths
fischeti Jan 3, 2024
b88a4d2
floogen: Copy in repository
fischeti Jan 3, 2024
f91d30b
license: Update license headers in python and YAML files
fischeti Jan 3, 2024
ace071e
ci: Add pylint
fischeti Jan 3, 2024
c41c489
ci: Install floogen as package before linting
fischeti Jan 3, 2024
b826a56
py: Build only `floogen` package
fischeti Jan 3, 2024
ba67660
ci: Install pylint before linting
fischeti Jan 3, 2024
9005c5e
py: Add click as python dependency
fischeti Jan 3, 2024
7257365
py: Update Homepage in `pyproject.toml`
fischeti Jan 3, 2024
7857c72
py: Lint python files
fischeti Jan 3, 2024
a0e2e6b
py: add `jsonref` as python dependency
fischeti Jan 3, 2024
c11a053
py: Ignore similar python code lint warning for now
fischeti Jan 3, 2024
1d66d73
jobs: Minor fix to pass CI
fischeti Jan 3, 2024
f553569
ci: Remove Whitespace
fischeti Jan 3, 2024
0ce9a1c
ci: Add NoC generation to CI
fischeti Jan 3, 2024
6628908
ci: Try to execute floogen as executable
fischeti Jan 3, 2024
0f82457
ci: Write output to SV files
fischeti Jan 3, 2024
1ca27e4
ci: Format and upload the specific file
fischeti Jan 3, 2024
4d428f4
ci: Lint generated SV files
fischeti Jan 3, 2024
e7cda02
ci: Update action versions
fischeti Jan 3, 2024
bbc31d8
ci: Minor Change
fischeti Jan 3, 2024
6e31a0a
routing: Check for mismatched start, end and size of `AddrRange`
fischeti Jan 4, 2024
74527f6
tests: Add first unit tests with pytest
fischeti Jan 4, 2024
4f2fbb6
py: Add `pylint` to dependencies
fischeti Jan 4, 2024
37c672e
ci: Run pytests
fischeti Jan 4, 2024
bfbccf6
test: Add more unit tests for routing tables
fischeti Jan 4, 2024
7c20f27
test: Add graph creation unit tests
fischeti Jan 4, 2024
6b982e0
py: Remove `requirements.txt` file since this is now integrated into …
fischeti Jan 4, 2024
c367cc9
ci: Cache `pip` + use python version 3.10
fischeti Jan 4, 2024
2b7eba3
LICENSE: Use different licenses for HW and SW
fischeti Jan 4, 2024
25c97cd
LICENSE: Change wording sligthly
fischeti Jan 4, 2024
0135963
LICENSE: Change a couple of license headers
fischeti Jan 4, 2024
5cce47f
floogen(org): Move utils to `floogen` folder
fischeti Jan 5, 2024
0bfc0a0
floogen(util): Add functions for rendering system verilog declaration…
fischeti Jan 5, 2024
4a16204
floogen(utils): Add function for formatting code with verible
fischeti Jan 5, 2024
8617f20
floogen(routing): Implement rendering functions as class methods inst…
fischeti Jan 5, 2024
424a4ce
floogen(link): Render flits with a class method instead of templating
fischeti Jan 5, 2024
962c09d
floogen(protocol): Render parameters and typdefs as class methods ins…
fischeti Jan 5, 2024
fde1037
floogen: Add support for rendering package-only configurations
fischeti Jan 5, 2024
6a5dbf7
floogen(examples): Add package-only example configurations for narrow…
fischeti Jan 5, 2024
48d1431
floogen(examples): Fix ID widths of AXI protocols
fischeti Jan 5, 2024
3e2019a
floogen(pkg): Remove hjson dumping
fischeti Jan 5, 2024
30fc254
floogen(protocol): Don't render `axi` prefix twice
fischeti Jan 5, 2024
01b7cd3
floogen(pkg): Move pkg template to floogen template folder and clean up
fischeti Jan 5, 2024
8e85133
floogen: Source formatting
fischeti Jan 5, 2024
236eb45
hw(pkg): Regenerate the SV packages
fischeti Jan 5, 2024
f5c9751
hw(chimney): Align with the slightly new naming conventions of the pa…
fischeti Jan 5, 2024
7507915
floogen: Lint sources
fischeti Jan 5, 2024
ed38617
make: Add `floogen` targets
fischeti Jan 5, 2024
2acce74
py: Bump the `floogen` version to `0.1.0` for release
fischeti Jan 5, 2024
cba7943
ci: Install `floogen` as non-editable
fischeti Jan 5, 2024
75a565a
ci: Fix argument usage
fischeti Jan 5, 2024
0c42c58
py: Support non-editable installation with pip
fischeti Jan 5, 2024
ed8c0c4
floogen(lint): Refactor nested f-string
fischeti Jan 5, 2024
fe06a14
ci: Disable formatting of `floogen` and use github action instead
fischeti Jan 5, 2024
a0179c1
ci(verible): Specify required `config_file`
fischeti Jan 5, 2024
a1e15aa
make: Make it possible to pass additional arguments to the `source` t…
fischeti Jan 5, 2024
3f08f74
Revert "ci(verible): Specify required `config_file`"
fischeti Jan 5, 2024
9dabd64
ci(lint): Update hw folder
fischeti Jan 5, 2024
ae770fb
ci(verible): Add `config_file` parameter
fischeti Jan 5, 2024
5d2c72a
hw(lint): Whole bunch of linting fixes and aligning with the new nami…
fischeti Jan 5, 2024
db2700f
ci: Ignore reviewdog folder which causes unclean state after linting
fischeti Jan 5, 2024
79f613c
hw(lint): More fixes
fischeti Jan 5, 2024
3a7b1e8
hw(lint): Fix directory in waiver file
fischeti Jan 5, 2024
ae26e94
ci(gitlab): Install `floogen` before running script
fischeti Jan 5, 2024
94a543c
ci(gitlab): Try using installed `floogen`
fischeti Jan 5, 2024
19d4eb0
ci(gitlab): Create conda environment to install python 3.10
fischeti Jan 5, 2024
a171ed1
ci(gitlab): Fix small typo
fischeti Jan 5, 2024
161ae12
ci(gitlab): Try again with other python installation
fischeti Jan 5, 2024
1dc585c
ci(gitlab): Remove old python venv creation
fischeti Jan 5, 2024
92f54d7
bender: Remove deprecated `axi_channel_compare`
fischeti Jan 5, 2024
2ad7673
tb(axi_chimney): Add missing ports
fischeti Jan 5, 2024
43db584
hw(pkg): Use previous configuration that is actually supported
fischeti Jan 5, 2024
0be807b
util(jobs): Re-add removed python shabang
fischeti Jan 5, 2024
42e3cde
test(dma_mesh): Fix a couple of stuff
fischeti Jan 5, 2024
f0d9dd3
test(hbm_model): Remove unused `TCK` parameter
fischeti Jan 5, 2024
bd37a5e
tb(nw_chimney): Set `IgnoreId` parameter
fischeti Jan 8, 2024
5e8c6a1
tb(nw_chimney): Add a cut between the chimneys
fischeti Jan 8, 2024
18db751
make(vsim): Disable accessibility, when running in batch/console mode
fischeti Jan 8, 2024
7729866
sim(nw_chimney): Update the wave script
fischeti Jan 8, 2024
e905348
hw(pkg): Increase the number of X and Y bits, as well as the address …
fischeti Jan 8, 2024
bd1c4e1
tb(dma_mesh): Use types from the generated package
fischeti Jan 8, 2024
598d44f
floogen(pkg): Fix names for address offset bits
fischeti Jan 8, 2024
824e991
tb(dma_mesh): Use parameters from package
fischeti Jan 8, 2024
84ee6bb
tb(dma_mesh): Add a couple of assertions
fischeti Jan 8, 2024
1198e22
ci: Disable the reviewdog when formatting
fischeti Jan 8, 2024
92dde8d
Revert "ci: Disable the reviewdog when formatting"
fischeti Jan 8, 2024
dfde1a4
test(hbm_model): Remove `HBMSize` parameter and use only `AddrWidth` …
fischeti Jan 8, 2024
749afd1
test(dma_model): Remove unused `TCK` parameter
fischeti Jan 8, 2024
0d397d9
hw(pkg): Use 3 bits for X and Y ID, and fix address offset
fischeti Jan 8, 2024
34abb08
tb(dma_mesh): Fix coordinates of east HBMs
fischeti Jan 8, 2024
6a1219f
util(gen_jobs): Fix base address calculation
fischeti Jan 8, 2024
de1abc4
ci(gitlab): Make the virtual environment an artifact
fischeti Jan 8, 2024
7eb290c
floogen(routing): Declare `UseIdTable` parameteer in package
fischeti Jan 8, 2024
7e97af6
floogen(routing): Render the address tables as parameter instead of s…
fischeti Jan 8, 2024
3b36e16
floogen(routing): Provide default values for all routing parameters
fischeti Jan 8, 2024
98ef41f
floogen(render): Fix whitespaces when rendering address tables
fischeti Jan 8, 2024
0f52a13
hw(chimney): Move routing related parameters to the package
fischeti Jan 8, 2024
ef71bbb
floogen(pkg): Render routing related information in the package
fischeti Jan 8, 2024
b142632
util(flitgen)!: Remove previous flitgen script and config files
fischeti Jan 8, 2024
aabffb6
hw(tb): Remove parameters from chimney instances that were removed
fischeti Jan 9, 2024
cbb8fc8
hw(chimney): Define Address Map as parameter instead of input
fischeti Jan 9, 2024
ccbf202
hw(tb): Fix missing signal in BW monitor
fischeti Jan 9, 2024
e280161
hw(test): Add void casts to get rid of warnings
fischeti Jan 9, 2024
53c5e22
hw(tb): Remove `xy_id_t` typedefs
fischeti Jan 9, 2024
2abe86c
hw(pkg): Align coordinate dimensions in rob testbench
fischeti Jan 9, 2024
12b249d
doc: Update README with information about `floogen`
fischeti Jan 9, 2024
cfb8279
doc: Move around sections in README
fischeti Jan 9, 2024
ff8d64d
doc: Try to fix the generation link in the README
fischeti Jan 9, 2024
b3e661c
floogen(vis): Fix visualization feature
fischeti Jan 9, 2024
bb8b778
doc: Update required python version in README
fischeti Jan 9, 2024
19780ed
doc: Update the CHANGELOG
fischeti Jan 9, 2024
cf58e50
doc: Add `floogen` documentation
fischeti Jan 9, 2024
f8fb12d
doc: Small fix in CHANGELOG
fischeti Jan 9, 2024
0ab002d
doc: Add `route_comp` module in README
fischeti Jan 9, 2024
7144d83
doc: Move both licenses to the root directory
fischeti Jan 9, 2024
de16e9d
make: Bump QuestaSim default version
fischeti Jan 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/floogen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright 2024 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51

# Author: Tim Fischer <[email protected]>

name: floogen

on: [push, pull_request]

jobs:

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Run unit tests
run: |
python -m pytest -v

#####################
# Generate SV files #
#####################
gen-nocs:
runs-on: ubuntu-latest
strategy:
matrix:
examples: ["single_cluster", "occamy_mesh", "occamy_tree"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install floogen
run: |
python -m pip install .
- name: Generate NoCs
run: |
floogen -c floogen/examples/${{ matrix.examples }}.yml -o generated --no-format
- name: Format generated NoCs
uses: chipsalliance/verible-formatter-action@main
with:
files:
./generated/${{ matrix.examples }}_floo_noc.sv
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.examples }}
path: generated/${{ matrix.examples }}_floo_noc.sv
if-no-files-found: error
retention-days: 1

#################
# Lint SV files #
#################
lint-nocs:
runs-on: ubuntu-latest
needs: gen-nocs
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: generated
- name: Lint SV files
uses: chipsalliance/verible-linter-action@main
with:
config_file: ''
paths:
./generated
github_token: ${{ secrets.GITHUB_TOKEN }}
79 changes: 57 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,28 @@ jobs:
check-clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Install dependencies and package
run: |
python -m pip install --upgrade pip
pip install .
- name: Install bender
uses: pulp-platform/pulp-actions/bender-install@v2
- name: Install verible
- name: Make clean sources
run: |
curl -Ls -o verible.tar.gz https://github.com/chipsalliance/verible/releases/download/v0.0-3313-gddcea377/verible-v0.0-3313-gddcea377-Ubuntu-22.04-jammy-x86_64.tar.gz
mkdir verible && tar -xzf verible.tar.gz -C verible --strip-components 1
- name: Check clean make targets
make clean sources FLOOGEN_ARGS="--no-format"
- name: Format with verible
uses: chipsalliance/verible-formatter-action@main
with:
files:
./hw/**/*.sv
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check clean
run: |
make clean sources VERIBLE_FMT=verible/bin/verible-verilog-format
git status && test -z "$(git status --porcelain)"

###############
Expand All @@ -39,22 +46,29 @@ jobs:
check-stale:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Install dependencies and package
run: |
python -m pip install --upgrade pip
pip install .
- name: Install bender
uses: pulp-platform/pulp-actions/bender-install@v2
- name: Install verible
- name: Make clean sources
run: |
curl -Ls -o verible.tar.gz https://github.com/chipsalliance/verible/releases/download/v0.0-3313-gddcea377/verible-v0.0-3313-gddcea377-Ubuntu-22.04-jammy-x86_64.tar.gz
mkdir verible && tar -xzf verible.tar.gz -C verible --strip-components 1
- name: Check clean makefile
make -B sources FLOOGEN_ARGS="--no-format"
- name: Format with verible
uses: chipsalliance/verible-formatter-action@main
with:
files:
./hw/**/*.sv
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check clean
run: |
make -B sources VERIBLE_FMT=verible/bin/verible-verilog-format
git status && test -z "$(git status --porcelain)"
git status && test -z "$(git status --porcelain)"

#####################
# Bender up-to-date #
Expand All @@ -68,19 +82,40 @@ jobs:
################
# Verible Lint #
################
lint:
verible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: chipsalliance/verible-linter-action@main
with:
config_file: ''
paths: |
./src
./hw
extra_args: "--waiver_files util/verible.waiver"
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
reviewdog_reporter: github-check

##########
# PyLint #
##########
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies and package
run: |
python -m pip install --upgrade pip
pip install .
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')

#################
# Check License #
#################
Expand Down
85 changes: 75 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,85 @@
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
.DS_Store

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea
.vscode
.dvt
tags

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
.coverage.*
.tox
junit*.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# Per-project virtualenvs
.venv*/
.conda*/
.python-version

# bender
.bender
*modelsim.ini
*transcript
*work
Bender.lock
Bender.local
deps

# Auto generated sources
generated
*.png
hw/test/jobs

# QuestaSim
work
work-vsim
modelsim.ini
transcript
vsim.wlf
scripts/compile_vsim.tcl
working_dir/*
compile.log
Bender.lock
.dvt
dvt_build.log
.vscode

# Verible
verible*

# spyglass
scripts/spyglass/*

test/jobs
# Misc
*.csv
**/*.log
reviewdog
17 changes: 15 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,40 @@
variables:
VSIM: questa-2023.4 vsim
BENDER: bender
PYTHON: /home/fischeti/micromamba/envs/floo/bin/python

stages:
- sources
- init
- build
- run

collect-bender-sources:
stage: sources
stage: init
script:
- $BENDER checkout
artifacts:
paths:
- .bender/
- Bender.lock

python-virtualenv:
stage: init
script:
- $PYTHON -m venv .venv
- source .venv/bin/activate
- pip install .
artifacts:
paths:
- .venv/

compile-vsim:
stage: build
script:
- source .venv/bin/activate
- make compile-sim | tee compile.log 2>&1
- '! grep "Error: " compile.log'
needs:
- python-virtualenv
- collect-bender-sources
artifacts:
paths:
Expand Down
Loading
Loading