Skip to content

Commit

Permalink
Project Structure Update (#469)
Browse files Browse the repository at this point in the history
* Introduce bittide-experiments

* Move simulation (library part)

* Introduce bittide-tools and move simulation tools

* Move all remaining tools to bittide-tools
  • Loading branch information
kleinreact authored Mar 12, 2024
1 parent 073c5ef commit 51aa848
Show file tree
Hide file tree
Showing 56 changed files with 1,184 additions and 1,131 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ jobs:
- run: cache push cargo
- run: cache push build

elastic-buffer-sim-topologies-matrix:
name: elastic-buffer-sim-topologies simulation matrix generation
cc-sim-topologies-matrix:
name: cc-sim-topologies simulation matrix generation
runs-on: [self-hosted, compute]
defaults:
run:
Expand Down Expand Up @@ -179,18 +179,18 @@ jobs:
sim_matrix: ${{ steps.set-sim-matrix.outputs.sim_matrix }}
artifact_names: ${{ steps.set-sim-matrix.outputs.artifact_names }}

elastic-buffer-sim-topologies:
cc-sim-topologies:
name: Simulate network
runs-on: [self-hosted, compute]
timeout-minutes: 1200
defaults:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
needs: [build, lint, elastic-buffer-sim-topologies-matrix]
needs: [build, lint, cc-sim-topologies-matrix]

strategy:
matrix:
target: ${{ fromJson(needs.elastic-buffer-sim-topologies-matrix.outputs.sim_matrix) }}
target: ${{ fromJson(needs.cc-sim-topologies-matrix.outputs.sim_matrix) }}
fail-fast: false

container:
Expand All @@ -210,7 +210,7 @@ jobs:

- name: Plot mesh grid
run: |
cabal run -- elastic-buffer-sim:sim \
cabal run -- bittide-tools:cc-sim \
+RTS -M${{ matrix.target.hmem }}M -RTS \
--output-mode pdf \
--get-rusty \
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
defaults:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
needs: [build, lint, elastic-buffer-sim-topologies-matrix, elastic-buffer-sim-topologies, bittide-instances-hardware-in-the-loop]
needs: [build, lint, cc-sim-topologies-matrix, cc-sim-topologies, bittide-instances-hardware-in-the-loop]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
Expand All @@ -283,7 +283,7 @@ jobs:
# https://github.com/marketplace/actions/download-multiple-workflow-artifacts,
# but this action is currently broken. Once a working solution
# is available again, 'artifact_names' from
# 'elastic-buffer-sim-topologies-matrix' can be used to only download
# 'cc-sim-topologies-matrix' can be used to only download
# the required artifacts instead.
path: artifacts

Expand All @@ -292,7 +292,7 @@ jobs:
mkdir -p reports
mkdir -p hitl-plots/hw
./cargo.sh build --frozen --release
cabal run -- elastic-buffer-sim:plot artifacts/_build-fullMeshHwCcTest-debug/Bittide.Instances.Hitl.FullMeshHwCc.fullMeshHwCcTest/ila-data/CC/ hitl-plots/hw
cabal run -- bittide-tools:cc-plot artifacts/_build-fullMeshHwCcTest-debug/Bittide.Instances.Hitl.FullMeshHwCc.fullMeshHwCcTest/ila-data/CC/ hitl-plots/hw
cp .github/hitl/FullMeshHwCcReportTemplate.tex hitl-plots/hw/report.tex
cp .github/hitl/topology.tikz hitl-plots/hw/topology.tikz
export RUNREF="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Expand All @@ -304,7 +304,7 @@ jobs:
cd ../..
mv hitl-plots/hw/report.pdf reports/HITL-FullMeshHwCc-Report.pdf
mkdir -p hitl-plots/sw
cabal run -- elastic-buffer-sim:plot artifacts/_build-fullMeshSwCcTest-debug/Bittide.Instances.Hitl.FullMeshSwCc.fullMeshSwCcTest/ila-data/CC/ hitl-plots/sw
cabal run -- bittide-tools:cc-plot artifacts/_build-fullMeshSwCcTest-debug/Bittide.Instances.Hitl.FullMeshSwCc.fullMeshSwCcTest/ila-data/CC/ hitl-plots/sw
cp .github/hitl/FullMeshSwCcReportTemplate.tex hitl-plots/sw/report.tex
cp .github/hitl/topology.tikz hitl-plots/sw/topology.tikz
mv hitl-plots/hw/datetime hitl-plots/sw/datetime
Expand All @@ -328,8 +328,8 @@ jobs:
path: reports
retention-days: 14

elastic-buffer-sim-tests:
name: elastic-buffer-sim unittests
bittide-experiments-tests:
name: bittide-experiments unittests
runs-on: [self-hosted, compute]
defaults:
run:
Expand All @@ -353,7 +353,7 @@ jobs:

- name: Run unittests
run: |
cabal run elastic-buffer-sim:unittests
cabal run bittide-experiments:unittests
bittide-tests:
name: Bittide tests
Expand Down Expand Up @@ -762,9 +762,9 @@ jobs:
bittide-instances-unittests,
bittide-tests,
build,
elastic-buffer-sim-tests,
elastic-buffer-sim-topologies-matrix,
elastic-buffer-sim-topologies,
bittide-experiments-tests,
cc-sim-topologies-matrix,
cc-sim-topologies,
firmware-limit-checks,
firmware-support-tests,
generate-full-clock-control-simulation-report,
Expand Down
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Files: .vscode/*
Copyright: 2022 Google LLC
License: CC0-1.0

Files: elastic-buffer-sim/imgs/*
Copyright: 2022 Google LLC
Files: bittide-tools/clockcontrol/sim/imgs/*
Copyright: 2022-2024 Google LLC
License: Apache-2.0

Files: bittide-instances/imgs/*
Expand Down
1 change: 1 addition & 0 deletions elastic-buffer-sim/LICENSE → bittide-experiments/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cabal-version: 2.4
name: elastic-buffer-sim
name: bittide-experiments
synopsis: Infrastructure and configurations needed for running
experiments with the Bittide systems under development
version: 0.1
License: Apache-2.0
license-file: LICENSE
author: QBayLogic B.V.
maintainer: [email protected]
Copyright: Copyright © 2022 Google LLC
Copyright: Copyright © 2024 Google LLC

common common-options
default-extensions:
Expand Down Expand Up @@ -74,84 +76,46 @@ library
import: common-options
hs-source-dirs: src
build-depends:
array,
aeson,
aeson-pretty,
array,
bittide,
bytestring,
cassava,
clash-cores,
clash-lib,
containers,
directory,
filepath,
happy-dot,
matplotlib,
optparse-applicative,
random,
text,
typelits-witnesses
exposed-modules:
Bittide.ClockControl.ElasticBuffer
Bittide.Domain
Bittide.Hitl
Bittide.Plot
Bittide.Simulate
Bittide.Simulate.ElasticBuffer
Bittide.Simulate.Topology
Bittide.Topology
Bittide.Topology.Graph
default-language: Haskell2010

executable sim
import: common-options
main-is: exe/Main.hs
build-depends:
aeson,
array,
random,
bytestring,
containers,
directory,
happy-dot,
filepath,
elastic-buffer-sim,
optparse-applicative,
default-language: Haskell2010
default-extensions: ImplicitPrelude
-- enable rtsopts so we can setup memory limits
ghc-options: -Wall -Wcompat -threaded -rtsopts -with-rtsopts=-xm20000000 +RTS -xm20000000 -RTS

executable plot
import: common-options
main-is: plot/Main.hs
build-depends:
array,
bittide,
bittide-instances,
bytestring,
cassava,
cassava-conduit,
conduit,
containers,
directory,
elastic-buffer-sim,
filepath,
text,
typelits-witnesses,
vector
default-language: Haskell2010
default-extensions: ImplicitPrelude
-- enable rtsopts so we can setup memory limits
ghc-options: -Wall -Wcompat -threaded -rtsopts -with-rtsopts=-xm20000000 +RTS -xm20000000 -RTS

test-suite unittests
import: common-options
type: exitcode-stdio-1.0
main-is: unittests.hs
ghc-options: -Wall -Wcompat -threaded -rtsopts "-with-rtsopts=-N -xm20000000" +RTS -xm20000000 -RTS
ghc-options: -Wall -Wcompat -threaded
-rtsopts "-with-rtsopts=-N -xm20000000" +RTS -xm20000000 -RTS
default-language: Haskell2010
hs-source-dirs: tests
other-modules:
Tests.Bittide.Simulate
build-depends:
base
, bittide
, bittide-experiments
, clash-prelude
, elastic-buffer-sim
, tasty
, tasty-hedgehog
, tasty-hunit
Expand All @@ -161,9 +125,10 @@ test-suite doctests
hs-source-dirs: tests
main-is: doctests.hs
ghc-options: -threaded
ghc-options: -Wall -Wcompat -threaded -rtsopts -with-rtsopts="-xm20000000" +RTS -xm20000000 -RTS
ghc-options: -Wall -Wcompat -threaded
-rtsopts "-with-rtsopts=-xm20000000" +RTS -xm20000000 -RTS
build-depends:
base,
elastic-buffer-sim,
bittide-experiments,
doctest-parallel >= 0.3.0.1 && < 0.4,
default-language: Haskell2010
3 changes: 3 additions & 0 deletions bittide-experiments/bittide-experiments.cabal.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Google LLC

SPDX-License-Identifier: CC0-1.0
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
-- 3. Shake builds a bitstream, programs the FPGA, and runs the HITL tests using
-- the configuration file and @HardwareTest.tcl@.
--
module Clash.Hitl
module Bittide.Hitl
( HitlTests
, Probes
, FpgaIndex
Expand Down
Loading

0 comments on commit 51aa848

Please sign in to comment.