├── .github └── workflows │ ├── checkfmt.yml │ ├── daily-bump.yml │ └── main.yml ├── .gitignore ├── flake.lock ├── flake.nix ├── readme.md └── templates ├── chisel ├── .gitignore ├── .scalafmt.conf ├── build.mill ├── common.mill ├── configs │ ├── GCD.json │ ├── GCDFormal.json │ └── GCDTestBench.json ├── elaborator │ └── src │ │ ├── GCD.scala │ │ ├── GCDFormal.scala │ │ └── GCDTestBench.scala ├── flake.lock ├── flake.nix ├── gcd │ └── src │ │ ├── GCD.scala │ │ ├── GCDFormal.scala │ │ └── GCDTestBench.scala ├── gcdemu │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ │ ├── dpi.rs │ │ ├── drive.rs │ │ ├── lib.rs │ │ └── plusarg.rs └── nix │ ├── dependencies │ ├── _sources │ │ ├── generated.json │ │ └── generated.nix │ ├── default.nix │ ├── locks │ │ ├── chisel-lock.nix │ │ ├── gcd-lock.nix │ │ └── zaozi-lock.nix │ └── nvfetcher.toml │ ├── gcd │ ├── default.nix │ ├── dpi-lib.nix │ ├── elaborate.nix │ ├── gcd.nix │ ├── jg-fpv.nix │ ├── mlirbc.nix │ ├── rtl.nix │ ├── scripts │ │ ├── FPV.tcl │ │ └── vcs-wrapper.sh │ ├── vcs.nix │ └── verilated.nix │ ├── overlay.nix │ └── pkgs │ ├── cds-fhs-env.nix │ ├── espresso.nix │ └── vcs-fhs-env.nix └── default.nix /.github/workflows/checkfmt.yml: -------------------------------------------------------------------------------- 1 | name: Check the format of a PR 2 | on: 3 | pull_request: 4 | types: 5 | - opened 6 | - synchronize 7 | - reopened 8 | - ready_for_review 9 | - labeled 10 | env: 11 | USER: runner 12 | 13 | # Cancel the current workflow when new commit pushed 14 | concurrency: 15 | group: ${{ github.workflow }}-${{ github.event.pull_request.number }} 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | 20 | check-format: 21 | name: "Check format" 22 | runs-on: [self-hosted, linux, nixos] 23 | strategy: 24 | fail-fast: false 25 | defaults: 26 | run: 27 | working-directory: ./templates/chisel 28 | steps: 29 | - uses: actions/checkout@v4 30 | with: 31 | ref: ${{ github.event.pull_request.head.sha }} 32 | - name: "Check format" 33 | if: "!cancelled()" 34 | run: | 35 | nix fmt -- --fail-on-change 36 | -------------------------------------------------------------------------------- /.github/workflows/daily-bump.yml: -------------------------------------------------------------------------------- 1 | name: Dependencies Bump 2 | on: 3 | schedule: 4 | # Run this job everyday at 5:30 AM UTC+8 5 | - cron: '30 21 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | bump-deps: 10 | name: "Bump Chisel and CIRCT" 11 | if: ${{ !cancelled() }} 12 | runs-on: [self-hosted, linux, nixos] 13 | permissions: 14 | contents: write 15 | defaults: 16 | run: 17 | working-directory: ./templates/chisel 18 | steps: 19 | - uses: actions/checkout@v4 20 | with: 21 | fetch-depth: 0 22 | ref: master 23 | - name: Bump nixpkgs 24 | run: | 25 | nix flake update 26 | - name: Bump Chisel and CIRCT 27 | run: | 28 | cd nix/dependencies 29 | nix run '.#nvfetcher' -- -f '[(^chisel$)(^zaozi$)]' 30 | - name: Bump all mill deps 31 | run: | 32 | mkdir -p nix/dependencies/locks 33 | printf '%s\n' "gcd.dependencies.ivy-chisel.bump" "gcd.dependencies.ivy-omlib.bump" "gcd.gcd-compiled.bump" | xargs -I% nix run ".#%" -j auto -- --force 34 | - name: Commit changes 35 | env: 36 | GH_TOKEN: ${{ secrets.CI_BUMP_TOKEN }} 37 | run: | 38 | git config user.name github-actions[bot] 39 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com 40 | 41 | currentDate=$(date +%F) 42 | branch="dependencies-bumping-$currentDate" 43 | git checkout -b "$branch" 44 | 45 | git add 'nix/dependencies' 46 | git add 'flake.lock' 47 | 48 | if ! git diff --quiet --cached --exit-code; then 49 | updatedFiles=$(git diff --cached --name-only) 50 | echo "File changed" 51 | git commit -m "[deps] Bump dependencies" 52 | git push origin "$branch" --force-with-lease 53 | nix run '.#gh' -- \ 54 | pr create --title "Bump dependencies" --body "Updated: $updatedFiles" 55 | fi 56 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build and Run Simulation 2 | on: 3 | pull_request: 4 | types: 5 | - opened 6 | - synchronize 7 | - reopened 8 | - ready_for_review 9 | - labeled 10 | env: 11 | USER: runner 12 | 13 | # Cancel the current workflow when new commit pushed 14 | concurrency: 15 | group: ${{ github.workflow }}-${{ github.event.pull_request.number }} 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | 20 | build-simulators: 21 | name: "Build Simulators" 22 | runs-on: [self-hosted, linux, nixos, BIGRAM] 23 | strategy: 24 | fail-fast: false 25 | defaults: 26 | run: 27 | working-directory: ./templates/chisel 28 | steps: 29 | - uses: actions/checkout@v4 30 | with: 31 | ref: ${{ github.event.pull_request.head.sha }} 32 | - name: "Build vcs simulator" 33 | run: | 34 | nix build \ 35 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 36 | --impure \ 37 | '.#gcd.vcs' 38 | - name: "Build vcs simulator with trace" 39 | run: | 40 | nix build \ 41 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 42 | --impure \ 43 | '.#gcd.vcs-trace' 44 | - name: "Build verilator simulator" 45 | run: | 46 | nix build \ 47 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 48 | --impure \ 49 | '.#gcd.verilated' 50 | - name: "Build verilator simulator with trace" 51 | run: | 52 | nix build \ 53 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 54 | --impure \ 55 | '.#gcd.verilated-trace' 56 | 57 | run-vcs: 58 | name: "Run VCS" 59 | strategy: 60 | fail-fast: false 61 | runs-on: [self-hosted, linux, nixos] 62 | defaults: 63 | run: 64 | working-directory: ./templates/chisel 65 | steps: 66 | - uses: actions/checkout@v4 67 | with: 68 | ref: ${{ github.event.pull_request.head.sha }} 69 | - name: "Run VCS" 70 | run: | 71 | nix build \ 72 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 73 | --impure \ 74 | -L \ 75 | '.#gcd.vcs.tests.simple-sim' && cat result/urgReport/asserts.txt 76 | 77 | run-verilator: 78 | name: "Run Verilator" 79 | strategy: 80 | fail-fast: false 81 | runs-on: [self-hosted, linux, nixos] 82 | defaults: 83 | run: 84 | working-directory: ./templates/chisel 85 | steps: 86 | - uses: actions/checkout@v4 87 | with: 88 | ref: ${{ github.event.pull_request.head.sha }} 89 | - name: "Run verilator" 90 | run: | 91 | nix run \ 92 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 93 | '.#gcd.verilated' 94 | 95 | run-jg-fpv: 96 | name: "Run JasperGold FPV" 97 | strategy: 98 | fail-fast: false 99 | runs-on: [self-hosted, linux, nixos] 100 | defaults: 101 | run: 102 | working-directory: ./templates/chisel 103 | steps: 104 | - uses: actions/checkout@v4 105 | with: 106 | ref: ${{ github.event.pull_request.head.sha }} 107 | - name: "Run JasperGold FPV" 108 | run: | 109 | nix build \ 110 | --override-input chisel-nix "github:chipsalliance/chisel-nix/${{ github.head_ref || github.ref_name }}" \ 111 | --impure \ 112 | '.#gcd.jg-fpv' \ 113 | && cat result/report.txt && $(exit $(cat result/failed_num)) 114 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .envrc 2 | .direnv/ 3 | .scala-build 4 | /dependencies/ 5 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "root": {} 4 | }, 5 | "root": "root", 6 | "version": 7 7 | } 8 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Chisel Flakes"; 3 | 4 | outputs = { self }: { 5 | templates = import ./templates; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Chisel Nix 2 | 3 | ## Getting started 4 | 5 | Here we provide nix templates for setting up a Chisel project. 6 | 7 | ```bash 8 | mkdir my-shining-new-chip 9 | cd my-shining-new-chip 10 | git init 11 | nix flake init -t github:chipsalliance/chisel-nix#chisel 12 | ``` 13 | 14 | Use the above commands to setup a chisel project skeleton. 15 | It will provide you the below code structure: 16 | 17 | * elaborator/: source code to the chisel elaborator 18 | * gcd/: source code for the [GCD](https://en.wikipedia.org/wiki/Greatest_common_divisor) example 19 | * gcdemu/: source code for the DPI library 20 | * configs/: default configurations for GCD and the testbench, which can be generated by elaborator 21 | * nix/: nix build script for the whole lowering process 22 | * build.mill & common.mill: Scala build script 23 | * flake.nix: the root for nix to search scripts 24 | 25 | ## Usage 26 | 27 | Our packaging strategy is using the `overlay.nix` to "overlay" the nixpkgs. 28 | Every thing that developers want to add or modify should go into the `overlay.nix` file. 29 | 30 | This skeleton provides a simple [GCD](https://en.wikipedia.org/wiki/Greatest_common_divisor) example. 31 | It's build script is in `nix/gcd` folder, providing the below attributes: 32 | 33 | * {gcd,tb,formal}-compiled: JVM bytecode for the GCD/GCDTestbench and elaborator 34 | * {gcd,tb,formal}-compiled.elaborator: A bash wrapper for running the elaborator with JDK 35 | * [{tb,formal}-]elaborate: Unlowered MLIR bytecode output from firrtl elaborated by elaborator 36 | * [{tb,formal}-]mlirbc: MLIR bytecode lowered by circt framework 37 | * [{tb,formal}-]rtl: SystemVerilog generated from the lowered MLIR bytecode 38 | * tb-dpi-lib: DPI library written in Rust for both Verilator and VCS 39 | * verilated[-trace]: C++ simulation executable and libaray generated by Verilator with/without `fst` waveform trace 40 | * vcs[-trace]: C simulation executable compiled by VCS with/without `fsdb` waveform trace and `urgReport` (coverage report) would be generated under `gcd-sim-result/result/` 41 | * jg-fpv: Formal Property Verification report generated by JasperGold 42 | 43 | To get the corresponding output, developers can use: 44 | 45 | ```bash 46 | nix build '.#gcd.' 47 | ``` 48 | 49 | For instance, if developers wish to obtain the final lowered SystemVerilog, they can execute: 50 | 51 | ```bash 52 | nix build '.#gcd.rtl' 53 | ``` 54 | 55 | The build result will be a symlink to nix store placed under the `./result`. 56 | 57 | To have same environment as the build script for developing purpose, developer can use: 58 | 59 | ```bash 60 | nix develop '.#gcd.' 61 | ``` 62 | 63 | For example, to modify the GCD sources, developer might run: 64 | 65 | ```bash 66 | nix develop '.#gcd.gcd-compiled' 67 | ``` 68 | 69 | The above command will provide a new bash shell with `mill`, `circt`, `chisel`... dependencies set up. 70 | 71 | Certain attributes support direct execution via Nix, allowing arguments to be passed using `--`: 72 | 73 | ```bash 74 | nix run '.#gcd.' 75 | ``` 76 | 77 | For example, we use elaborator to generate configs for the design. To generate the config for GCDTestbench, developer can run: 78 | 79 | ```bash 80 | nix run '.#gcd.gcd-compiled.elaborator' -- config --width 16 --useAsyncReset false 81 | ``` 82 | 83 | A JSON file named `GCDMain.json` will be generated in the working directory. 84 | 85 | As another example, we can run a VCS simulation with waveform trace by: 86 | 87 | ```bash 88 | nix run '.#gcd.vcs-trace' --impure -- +dump-start=0 +dump-end=10000 +wave-path=trace +fsdb+sva_success 89 | ``` 90 | 91 | The DPI lib can automatically match the arguments and does not interact with VCS. In this case, the first three parameters will be passed to the DPI lib to control waveform generation, and the last parameter will be passed to the VCS to dump the results of all sva statements. 92 | 93 | * Note that in order to use VCS for simulation, you need to set the environment variables `VC_STATIC_HOME` and `SNPSLMD_LICENSE_FILE` and add the`--impure` flag. 94 | 95 | To run the formal property verification. Then you can run: 96 | 97 | ```bash 98 | nix build '.#gcd.jg-fpv' --impure 99 | ``` 100 | 101 | and the report will be generated in the result/ 102 | 103 | * Note that in order to use jasper gold for formal verification, you need to set the environment variables `JASPER_HOME` and `CDS_LIC_FILE` and add the`--impure` flag. 104 | 105 | ## References 106 | 107 | ### Format the source code 108 | 109 | To format the Nix code, developers can run: 110 | 111 | ```bash 112 | nix fmt 113 | ``` 114 | 115 | To format the Rust code, developers can run following command in `gcdemu/`: 116 | 117 | ```bash 118 | nix develop -c cargo fmt 119 | ``` 120 | 121 | To format the Scala code, developers can run: 122 | 123 | ```bash 124 | nix develop -c bash -c 'mill -i gcd.reformat && mill -i elaborator.reformat' 125 | ``` 126 | 127 | ### Bump dependencies 128 | 129 | To bump nixpkgs, run: 130 | 131 | ```bash 132 | nix flake update 133 | ``` 134 | 135 | To bump Chisel and other dependencies fetched by nvfetcher, run: 136 | 137 | ```bash 138 | cd nix/pkgs/dependencies 139 | nix run '.#nvfetcher' 140 | ``` 141 | 142 | To bump mill dependencies, run: 143 | 144 | ```bash 145 | nix build '.#gcd.gcd-compiled.millDeps' --rebuild 146 | ``` 147 | 148 | and Then update `millDepsHash` in `nix/pkgs/dependencies/default.nix` and `nix/gcd/gcd.nix` 149 | 150 | ### Use the fetchMillDeps function 151 | 152 | Fetch project dependencies for later offline usage. 153 | 154 | The `fetchMillDeps` function accept three args: `name`, `src`, `millDepsHash`: 155 | 156 | * name: name of the mill dependencies derivation, suggest using `-mill-deps` as suffix. 157 | * src: path to a directory that contains at least `build.mill` file for mill to obtain dependencies. 158 | * millDepsHash: same functionality as the `sha256`, `hash` attr in stdenv.mkDerivation. To obtain new hash for new dependencies, replace the old hash with empty string, and let nix figure the new hash. 159 | 160 | This derivation will read `$JAVA_OPTS` environment varialble, to set http proxy, you can export: 161 | 162 | ```bash 163 | export JAVA_OPTS="-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=1234" 164 | ``` 165 | 166 | The returning derivation have `setupHook` attribute to automatically setup dependencies path for mill. 167 | Add the attribute into `nativeBuildInputs`, and let nix run the hook. 168 | 169 | Example: 170 | 171 | ```nix 172 | stdenv.mkDerivation rec { 173 | # ... 174 | passthru = { 175 | millDeps = fetchMillDeps { 176 | inherit name; 177 | src = with lib.fileset; 178 | toSource { 179 | root = ./../..; 180 | fileset = unions [ ./../../build.mill ./../../common.mill ]; 181 | }; 182 | buildInputs = with mill-dependencies; [ chisel.setupHook ]; 183 | millDepsHash = "sha256-NybS2AXRQtXkgHd5nH4Ltq3sxZr5aZ4VepiT79o1AWo="; 184 | }; 185 | }; 186 | # ... 187 | nativeBuildInputs = [ 188 | # ... 189 | millDeps.setupHook 190 | ]; 191 | } 192 | ``` 193 | 194 | ## License 195 | 196 | The build system is released under the Apache-2.0 license, including all Nix and mill build system, All rights reserved by Jiuyang Liu 197 | 198 | # Overlays 199 | 200 | chisel-nix also provides some overlays file that contains common use nix script to help reduce copy-pasting. 201 | 202 | ## `mill-flows` 203 | 204 | The `mill-flows` overlay provide a set of tools to control dependencies in a Mill based project. 205 | Users can add "chisel-nix" to the Nix Flake input to use this overlay. 206 | 207 | * An example `mill-flows` import example 208 | 209 | ```nix 210 | { 211 | description = "Basic Flake"; 212 | 213 | inputs = { 214 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 215 | chisel-nix.url = "github:chipsalliance/chisel-nix"; 216 | flake-utils.url = "github:numtide/flake-utils"; 217 | }; 218 | 219 | outputs = { self, nixpkgs, chisel-nix, flake-utils }@inputs: 220 | flake-utils.lib.eachDefaultSystem (system: { 221 | legacyPackages = import nixpkgs { 222 | overlays = [ chisel-nix.overlays.mill-flows ]; 223 | inherit system; 224 | }; 225 | }) // { inherit inputs; }; 226 | } 227 | ``` 228 | 229 | After importing the `mill-flows` overlay to nixpkgs, users wil have following build script: 230 | 231 | ### `fetchMillDeps` 232 | 233 | The `fetchMillDeps` function will run `mill -i __.prepareOffline` to fetch all the ivy dependencies from internet, 234 | and provide a `setupHook` attribute to help reuse all the dependencies in other derivations. 235 | 236 | * Type 237 | 238 | ```nix 239 | { name :: String; src :: Path; millDepsHash :: String; ... } -> Derivation 240 | ``` 241 | 242 | > This function accept additional attibutes to override the attibute set to be passed to 243 | > `stdenv.mkDerivation` function. 244 | 245 | * Example 246 | 247 | ```nix 248 | { fetchFromGitHub, fetchMillDeps }: 249 | let 250 | chiselSrc = fetchFromGitHub { 251 | owner = "chipsalliance"; 252 | repo = "chisel"; 253 | rev = "8a1f1b66e5e87dff6c8356fae346eb46512756cf"; 254 | hash = "sha256-pB8kzqUmvHTG2FqRRjqig1FK9pGYrgBDOOekCqkwrsE="; 255 | }; 256 | in 257 | fetchMillDeps { 258 | name = "chisel"; 259 | src = chiselSrc; 260 | millDepsHash = "sha256-NBHUq5MaGiiaDA5mjeP0xcU5jNe9wWordL01a6khy7I="; 261 | }; 262 | ``` 263 | 264 | In the above example, `fetchMillDeps` function will resolve all ivy dependencies in chisel project, 265 | return a path to the local coursier repository, and calculate file hash from the returning path. 266 | Users can use the `.setupHook` function in other derivation's `buildInputs` to have coursier repository 267 | automatically setup in build environment. 268 | 269 | ```nix 270 | # ... 271 | stdenv.mkDerivation { 272 | # ... 273 | 274 | buildInputs = [ 275 | chisel.setupHook 276 | # ... 277 | ]; 278 | 279 | buildPhase = '' 280 | # ... 281 | # No need to download dependency again 282 | mill -i obj.assembly 283 | ''; 284 | } 285 | ``` 286 | 287 | ### `publishMillJar` 288 | 289 | The `publishMillJar` function will run `mill -i $target.publishLocal` to pack up the given module. 290 | 291 | * Type 292 | 293 | ```nix 294 | { name :: String; src :: Path; publishTargets :: [String]; ... } -> Derivation 295 | ``` 296 | 297 | > This function accept additional attibutes to override the attibute set to be passed to 298 | > `stdenv.mkDerivation` function. 299 | 300 | * Example 301 | 302 | ```nix 303 | { fetchMillDeps 304 | , publishMillJar 305 | , fetchFromGitHub 306 | , git 307 | }: 308 | let 309 | chiselSrc = fetchFromGitHub { 310 | owner = "chipsalliance"; 311 | repo = "chisel"; 312 | rev = "8a1f1b66e5e87dff6c8356fae346eb46512756cf"; 313 | hash = "sha256-pB8kzqUmvHTG2FqRRjqig1FK9pGYrgBDOOekCqkwrsE="; 314 | }; 315 | chiselDeps = fetchMillDeps { 316 | name = "chisel"; 317 | src = chiselSrc; 318 | millDepsHash = "sha256-NBHUq5MaGiiaDA5mjeP0xcU5jNe9wWordL01a6khy7I="; 319 | }; 320 | in 321 | publishMillJar { 322 | name = "chisel"; 323 | src = chiselSrc; 324 | 325 | publishTargets = [ 326 | "unipublish" 327 | ]; 328 | 329 | buildInputs = [ 330 | chiselDeps.setupHook 331 | ]; 332 | 333 | nativeBuildInputs = [ 334 | # chisel requires git to generate version 335 | git 336 | ]; 337 | 338 | passthru = { 339 | inherit chiselDeps; 340 | }; 341 | } 342 | ``` 343 | 344 | The above declaration will run `mill -i unipublish.publishLocal` command and store the ivy repository 345 | to output directory. And it also provide a `setupHook` attribute, so users can have the ivy repository 346 | automatically installed in other derivation build environment. 347 | 348 | > [!note] 349 | > 350 | > Worth notice that, if user pass other ivy repository to the `publishMillJar` builder, 351 | > the old and new ivy repository will be merged and output JAR will be stored together. 352 | > These will cause the output size increse and larger than expected for those top-level project. 353 | -------------------------------------------------------------------------------- /templates/chisel/.gitignore: -------------------------------------------------------------------------------- 1 | .bloop 2 | .bsp 3 | .jvm-opts 4 | .mill-jvm-opts 5 | .metals/ 6 | .vscode/ 7 | .envrc 8 | .direnv/ 9 | 10 | out/ 11 | result* 12 | gcd-sim-result/ 13 | /dependencies/ 14 | target/ 15 | 16 | *.vcd 17 | *.fst 18 | *.fsdb 19 | *.log 20 | -------------------------------------------------------------------------------- /templates/chisel/.scalafmt.conf: -------------------------------------------------------------------------------- 1 | version = "3.7.15" 2 | runner.dialect = scala213 3 | 4 | maxColumn = 120 5 | align.preset = most 6 | indent.defnSite = 2 7 | assumeStandardLibraryStripMargin = true 8 | docstrings.style = SpaceAsterisk 9 | lineEndings = preserve 10 | includeCurlyBraceInSelectChains = false 11 | danglingParentheses.preset = true 12 | 13 | align.tokens."+" = [{ 14 | code = ":" 15 | }] 16 | 17 | newlines.beforeCurlyLambdaParams = "never" 18 | newlines.alwaysBeforeMultilineDef = false 19 | newlines.implicitParamListModifierForce = [before] 20 | 21 | verticalMultiline.atDefnSite = true 22 | 23 | optIn.annotationNewlines = true 24 | 25 | rewrite.rules = [SortImports, PreferCurlyFors, AvoidInfix] 26 | -------------------------------------------------------------------------------- /templates/chisel/build.mill: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | package build 4 | 5 | import mill._ 6 | import mill.scalalib._ 7 | import mill.define.{Command, TaskModule} 8 | import mill.scalalib.publish._ 9 | import mill.scalalib.scalafmt._ 10 | import mill.scalalib.TestModule.Utest 11 | import mill.util.Jvm 12 | import coursier.maven.MavenRepository 13 | 14 | object deps { 15 | val scalaVer = "2.13.16" 16 | val mainargs = ivy"com.lihaoyi::mainargs:0.5.0" 17 | val oslib = ivy"com.lihaoyi::os-lib:0.9.1" 18 | val upickle = ivy"com.lihaoyi::upickle:3.3.1" 19 | val chisel = ivy"org.chipsalliance::chisel::0.0.0+0-no-vcs-SNAPSHOT" 20 | val chiselPlugin = ivy"org.chipsalliance:chisel-plugin_${scalaVer}:0.0.0+0-no-vcs-SNAPSHOT" 21 | } 22 | 23 | object gcd extends GCD 24 | trait GCD extends common.HasChisel with ScalafmtModule { 25 | def scalaVersion = Task(deps.scalaVer) 26 | 27 | def chiselModule = None 28 | def chiselPluginJar = Task(None) 29 | def chiselPluginIvy = Some(deps.chiselPlugin) 30 | def chiselIvy = Some(deps.chisel) 31 | } 32 | 33 | object elaborator extends Elaborator 34 | trait Elaborator extends common.ElaboratorModule with ScalafmtModule { 35 | def scalaVersion = Task(deps.scalaVer) 36 | 37 | def mlirInstallPath = Task.Input(os.Path(Task.env.getOrElse("MLIR_INSTALL_PATH", "MLIR_INSTALL_PATH not found"))) 38 | def circtInstallPath = Task.Input(os.Path(Task.env.getOrElse("CIRCT_INSTALL_PATH", "CIRCT_INSTALL_PATH not found"))) 39 | 40 | def generators = Seq(gcd) 41 | 42 | def mainargsIvy = deps.mainargs 43 | 44 | def chiselModule = None 45 | def chiselPluginJar = Task(None) 46 | def chiselPluginIvy = Some(deps.chiselPlugin) 47 | def chiselIvy = Some(deps.chisel) 48 | } 49 | -------------------------------------------------------------------------------- /templates/chisel/common.mill: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | package build 4 | 5 | import mill._ 6 | import mill.scalalib._ 7 | 8 | trait HasChisel extends ScalaModule { 9 | // Define these for building chisel from source 10 | def chiselModule: Option[ScalaModule] 11 | 12 | override def moduleDeps = super.moduleDeps ++ chiselModule 13 | 14 | def chiselPluginJar: T[Option[PathRef]] 15 | 16 | override def scalacOptions = T( 17 | super.scalacOptions() ++ chiselPluginJar().map(path => s"-Xplugin:${path.path}") ++ Seq( 18 | "-Ymacro-annotations", 19 | "-deprecation", 20 | "-feature", 21 | "-language:reflectiveCalls", 22 | "-language:existentials", 23 | "-language:implicitConversions" 24 | ) 25 | ) 26 | 27 | override def scalacPluginClasspath: T[Agg[PathRef]] = T(super.scalacPluginClasspath() ++ chiselPluginJar()) 28 | 29 | // Define these for building chisel from ivy 30 | def chiselIvy: Option[Dep] 31 | 32 | override def ivyDeps = T(super.ivyDeps() ++ chiselIvy) 33 | 34 | def chiselPluginIvy: Option[Dep] 35 | 36 | override def scalacPluginIvyDeps: T[Agg[Dep]] = Task( 37 | super.scalacPluginIvyDeps() ++ chiselPluginIvy.map(Agg(_)).getOrElse(Agg.empty[Dep]) 38 | ) 39 | } 40 | 41 | trait ElaboratorModule extends ScalaModule with HasChisel { 42 | def generators: Seq[ScalaModule] 43 | def mlirInstallPath: T[os.Path] 44 | def circtInstallPath: T[os.Path] 45 | override def moduleDeps = super.moduleDeps ++ generators 46 | def mainargsIvy: Dep 47 | override def ivyDeps = Task(super.ivyDeps() ++ Seq(mainargsIvy)) 48 | override def javacOptions = Task(super.javacOptions() ++ Seq("--enable-preview", "--release", "21")) 49 | def libraryPaths = Task(Seq(mlirInstallPath() / "lib", circtInstallPath() / "lib").map(PathRef(_))) 50 | override def forkArgs: T[Seq[String]] = Task( 51 | super.forkArgs() ++ Seq( 52 | "--enable-native-access=ALL-UNNAMED", 53 | "--enable-preview" 54 | ) 55 | ) 56 | } 57 | -------------------------------------------------------------------------------- /templates/chisel/configs/GCD.json: -------------------------------------------------------------------------------- 1 | { 2 | "width": 16, 3 | "useAsyncReset": false 4 | } 5 | -------------------------------------------------------------------------------- /templates/chisel/configs/GCDFormal.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcdParameter": { 3 | "width": 16, 4 | "useAsyncReset": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /templates/chisel/configs/GCDTestBench.json: -------------------------------------------------------------------------------- 1 | { 2 | "testVerbatimParameter": { 3 | "useAsyncReset": false, 4 | "initFunctionName": "gcd_init", 5 | "dumpFunctionName": "dump_wave", 6 | "clockFlipTick": 1, 7 | "resetFlipTick": 100 8 | }, 9 | "gcdParameter": { 10 | "width": 16, 11 | "useAsyncReset": false 12 | }, 13 | "timeout": 70000, 14 | "testSize": 100 15 | } 16 | -------------------------------------------------------------------------------- /templates/chisel/elaborator/src/GCD.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | package org.chipsalliance.gcd.elaborator 4 | 5 | import mainargs._ 6 | import org.chipsalliance.gcd.{GCD, GCDParameter} 7 | import chisel3.experimental.util.SerializableModuleElaborator 8 | 9 | object GCDMain extends SerializableModuleElaborator { 10 | val topName = "GCD" 11 | 12 | implicit object PathRead extends TokensReader.Simple[os.Path] { 13 | def shortName = "path" 14 | def read(strs: Seq[String]) = Right(os.Path(strs.head, os.pwd)) 15 | } 16 | 17 | @main 18 | case class GCDParameterMain( 19 | @arg(name = "width") width: Int, 20 | @arg(name = "useAsyncReset") useAsyncReset: Boolean) { 21 | require(width > 0, "width must be a non-negative integer") 22 | require(chisel3.util.isPow2(width), "width must be a power of 2") 23 | def convert: GCDParameter = GCDParameter(width, useAsyncReset) 24 | } 25 | 26 | implicit def GCDParameterMainParser: ParserForClass[GCDParameterMain] = 27 | ParserForClass[GCDParameterMain] 28 | 29 | @main 30 | def config( 31 | @arg(name = "parameter") parameter: GCDParameterMain, 32 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 33 | ) = 34 | os.write.over(targetDir / s"${topName}.json", configImpl(parameter.convert)) 35 | 36 | @main 37 | def design( 38 | @arg(name = "parameter") parameter: os.Path, 39 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 40 | ) = { 41 | val (firrtl, annos) = designImpl[GCD, GCDParameter](os.read.stream(parameter)) 42 | os.write.over(targetDir / s"${topName}.fir", firrtl) 43 | os.write.over(targetDir / s"${topName}.anno.json", annos) 44 | } 45 | 46 | def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) 47 | } 48 | -------------------------------------------------------------------------------- /templates/chisel/elaborator/src/GCDFormal.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | package org.chipsalliance.gcd.elaborator 4 | 5 | import mainargs._ 6 | import org.chipsalliance.gcd.{GCDFormal, GCDFormalParameter} 7 | import org.chipsalliance.gcd.elaborator.GCDMain.GCDParameterMain 8 | import chisel3.experimental.util.SerializableModuleElaborator 9 | 10 | object GCDFormalMain extends SerializableModuleElaborator { 11 | val topName = "GCDFormal" 12 | 13 | implicit object PathRead extends TokensReader.Simple[os.Path] { 14 | def shortName = "path" 15 | def read(strs: Seq[String]) = Right(os.Path(strs.head, os.pwd)) 16 | } 17 | 18 | @main 19 | case class GCDFormalParameterMain( 20 | @arg(name = "gcdParameter") gcdParameter: GCDParameterMain) { 21 | def convert: GCDFormalParameter = GCDFormalParameter(gcdParameter.convert) 22 | } 23 | 24 | implicit def GCDParameterMainParser: ParserForClass[GCDParameterMain] = 25 | ParserForClass[GCDParameterMain] 26 | 27 | implicit def GCDFormalParameterMainParser: ParserForClass[GCDFormalParameterMain] = 28 | ParserForClass[GCDFormalParameterMain] 29 | 30 | @main 31 | def config( 32 | @arg(name = "parameter") parameter: GCDFormalParameterMain, 33 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 34 | ) = 35 | os.write.over(targetDir / s"${topName}.json", configImpl(parameter.convert)) 36 | 37 | @main 38 | def design( 39 | @arg(name = "parameter") parameter: os.Path, 40 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 41 | ) = { 42 | val (firrtl, annos) = designImpl[GCDFormal, GCDFormalParameter](os.read.stream(parameter)) 43 | os.write.over(targetDir / s"${topName}.fir", firrtl) 44 | os.write.over(targetDir / s"${topName}.anno.json", annos) 45 | } 46 | 47 | def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) 48 | } 49 | -------------------------------------------------------------------------------- /templates/chisel/elaborator/src/GCDTestBench.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | package org.chipsalliance.gcd.elaborator 4 | 5 | import mainargs._ 6 | import org.chipsalliance.gcd.{GCDTestBench, GCDTestBenchParameter, TestVerbatimParameter} 7 | import org.chipsalliance.gcd.elaborator.GCDMain.GCDParameterMain 8 | import chisel3.experimental.util.SerializableModuleElaborator 9 | 10 | object GCDTestBenchMain extends SerializableModuleElaborator { 11 | val topName = "GCDTestBench" 12 | 13 | implicit object PathRead extends TokensReader.Simple[os.Path] { 14 | def shortName = "path" 15 | def read(strs: Seq[String]) = Right(os.Path(strs.head, os.pwd)) 16 | } 17 | 18 | @main 19 | case class GCDTestBenchParameterMain( 20 | @arg(name = "testVerbatimParameter") testVerbatimParameter: TestVerbatimParameterMain, 21 | @arg(name = "gcdParameter") gcdParameter: GCDParameterMain, 22 | @arg(name = "timeout") timeout: Int, 23 | @arg(name = "testSize") testSize: Int) { 24 | def convert: GCDTestBenchParameter = GCDTestBenchParameter( 25 | testVerbatimParameter.convert, 26 | gcdParameter.convert, 27 | timeout, 28 | testSize 29 | ) 30 | } 31 | 32 | case class TestVerbatimParameterMain( 33 | @arg(name = "useAsyncReset") useAsyncReset: Boolean, 34 | @arg(name = "initFunctionName") initFunctionName: String, 35 | @arg(name = "dumpFunctionName") dumpFunctionName: String, 36 | @arg(name = "clockFlipTick") clockFlipTick: Int, 37 | @arg(name = "resetFlipTick") resetFlipTick: Int) { 38 | def convert: TestVerbatimParameter = TestVerbatimParameter( 39 | useAsyncReset: Boolean, 40 | initFunctionName: String, 41 | dumpFunctionName: String, 42 | clockFlipTick: Int, 43 | resetFlipTick: Int 44 | ) 45 | } 46 | 47 | implicit def TestVerbatimParameterMainParser: ParserForClass[TestVerbatimParameterMain] = 48 | ParserForClass[TestVerbatimParameterMain] 49 | 50 | implicit def GCDParameterMainParser: ParserForClass[GCDParameterMain] = 51 | ParserForClass[GCDParameterMain] 52 | 53 | implicit def GCDTestBenchParameterMainParser: ParserForClass[GCDTestBenchParameterMain] = 54 | ParserForClass[GCDTestBenchParameterMain] 55 | 56 | @main 57 | def config( 58 | @arg(name = "parameter") parameter: GCDTestBenchParameterMain, 59 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 60 | ) = 61 | os.write.over(targetDir / s"${topName}.json", configImpl(parameter.convert)) 62 | 63 | @main 64 | def design( 65 | @arg(name = "parameter") parameter: os.Path, 66 | @arg(name = "target-dir") targetDir: os.Path = os.pwd 67 | ) = { 68 | val (firrtl, annos) = designImpl[GCDTestBench, GCDTestBenchParameter](os.read.stream(parameter)) 69 | os.write.over(targetDir / s"${topName}.fir", firrtl) 70 | os.write.over(targetDir / s"${topName}.anno.json", annos) 71 | } 72 | 73 | def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) 74 | } 75 | -------------------------------------------------------------------------------- /templates/chisel/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "chisel-nix": { 4 | "inputs": { 5 | "mill-ivy-fetcher": "mill-ivy-fetcher_2" 6 | }, 7 | "locked": { 8 | "lastModified": 1741628211, 9 | "narHash": "sha256-DBPgfIDXfKk+TjtVjvkV/N2pVWSah38xjJp6M71EPC0=", 10 | "owner": "chipsalliance", 11 | "repo": "chisel-nix", 12 | "rev": "6119fe6835dbf3d39796c5e0809ac94509bf4c93", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "chipsalliance", 17 | "ref": "new-mill-flow", 18 | "repo": "chisel-nix", 19 | "type": "github" 20 | } 21 | }, 22 | "flake-parts": { 23 | "inputs": { 24 | "nixpkgs-lib": [ 25 | "nixpkgs" 26 | ] 27 | }, 28 | "locked": { 29 | "lastModified": 1743550720, 30 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", 31 | "owner": "hercules-ci", 32 | "repo": "flake-parts", 33 | "rev": "c621e8422220273271f52058f618c94e405bb0f5", 34 | "type": "github" 35 | }, 36 | "original": { 37 | "owner": "hercules-ci", 38 | "repo": "flake-parts", 39 | "type": "github" 40 | } 41 | }, 42 | "flake-parts_2": { 43 | "inputs": { 44 | "nixpkgs-lib": [ 45 | "mill-ivy-fetcher", 46 | "nixpkgs" 47 | ] 48 | }, 49 | "locked": { 50 | "lastModified": 1743550720, 51 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", 52 | "owner": "hercules-ci", 53 | "repo": "flake-parts", 54 | "rev": "c621e8422220273271f52058f618c94e405bb0f5", 55 | "type": "github" 56 | }, 57 | "original": { 58 | "owner": "hercules-ci", 59 | "repo": "flake-parts", 60 | "type": "github" 61 | } 62 | }, 63 | "flake-utils": { 64 | "inputs": { 65 | "systems": "systems" 66 | }, 67 | "locked": { 68 | "lastModified": 1731533236, 69 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 70 | "owner": "numtide", 71 | "repo": "flake-utils", 72 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 73 | "type": "github" 74 | }, 75 | "original": { 76 | "owner": "numtide", 77 | "repo": "flake-utils", 78 | "type": "github" 79 | } 80 | }, 81 | "flake-utils_2": { 82 | "inputs": { 83 | "systems": "systems_2" 84 | }, 85 | "locked": { 86 | "lastModified": 1731533236, 87 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 88 | "owner": "numtide", 89 | "repo": "flake-utils", 90 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 91 | "type": "github" 92 | }, 93 | "original": { 94 | "owner": "numtide", 95 | "repo": "flake-utils", 96 | "type": "github" 97 | } 98 | }, 99 | "mill-ivy-fetcher": { 100 | "inputs": { 101 | "flake-parts": "flake-parts_2", 102 | "nixpkgs": "nixpkgs", 103 | "treefmt-nix": "treefmt-nix" 104 | }, 105 | "locked": { 106 | "lastModified": 1744460023, 107 | "narHash": "sha256-ZxN/5XZqFNlrIKV91ZpegRn+qZ4g8LTC0Ed8lAyyBvY=", 108 | "owner": "Avimitin", 109 | "repo": "mill-ivy-fetcher", 110 | "rev": "c528c50d32ba2375f8a283390bcdb4c626140a1a", 111 | "type": "github" 112 | }, 113 | "original": { 114 | "owner": "Avimitin", 115 | "repo": "mill-ivy-fetcher", 116 | "type": "github" 117 | } 118 | }, 119 | "mill-ivy-fetcher_2": { 120 | "inputs": { 121 | "flake-utils": "flake-utils", 122 | "nixpkgs": "nixpkgs_3" 123 | }, 124 | "locked": { 125 | "lastModified": 1741628130, 126 | "narHash": "sha256-82/zYZC8jL5dTdCJPgHEbDZyQBV1AOuhkgB6dICEzm8=", 127 | "owner": "Avimitin", 128 | "repo": "mill-ivy-fetcher", 129 | "rev": "84d171be31d478527740c926c00dbdd84af32416", 130 | "type": "github" 131 | }, 132 | "original": { 133 | "owner": "Avimitin", 134 | "repo": "mill-ivy-fetcher", 135 | "type": "github" 136 | } 137 | }, 138 | "nixpkgs": { 139 | "locked": { 140 | "lastModified": 1744316434, 141 | "narHash": "sha256-lzFCg/1C39pyY2hMB2gcuHV79ozpOz/Vu15hdjiFOfI=", 142 | "owner": "nixos", 143 | "repo": "nixpkgs", 144 | "rev": "d19cf9dfc633816a437204555afeb9e722386b76", 145 | "type": "github" 146 | }, 147 | "original": { 148 | "owner": "nixos", 149 | "ref": "nixpkgs-unstable", 150 | "repo": "nixpkgs", 151 | "type": "github" 152 | } 153 | }, 154 | "nixpkgs4circt": { 155 | "locked": { 156 | "lastModified": 1742095305, 157 | "narHash": "sha256-L8qjRx4MbX/juwbo8+4qYbqQy0MFUzUJLV5o8oujvaA=", 158 | "owner": "NixOS", 159 | "repo": "nixpkgs", 160 | "rev": "f985965fff9d4e5df55df0489ef113d09a6ee08d", 161 | "type": "github" 162 | }, 163 | "original": { 164 | "owner": "NixOS", 165 | "ref": "nixos-unstable-small", 166 | "repo": "nixpkgs", 167 | "type": "github" 168 | } 169 | }, 170 | "nixpkgs_2": { 171 | "locked": { 172 | "lastModified": 1745234285, 173 | "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", 174 | "owner": "NixOS", 175 | "repo": "nixpkgs", 176 | "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", 177 | "type": "github" 178 | }, 179 | "original": { 180 | "owner": "NixOS", 181 | "ref": "nixos-unstable", 182 | "repo": "nixpkgs", 183 | "type": "github" 184 | } 185 | }, 186 | "nixpkgs_3": { 187 | "locked": { 188 | "lastModified": 1741379970, 189 | "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", 190 | "owner": "NixOS", 191 | "repo": "nixpkgs", 192 | "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", 193 | "type": "github" 194 | }, 195 | "original": { 196 | "owner": "NixOS", 197 | "ref": "nixos-unstable", 198 | "repo": "nixpkgs", 199 | "type": "github" 200 | } 201 | }, 202 | "nixpkgs_4": { 203 | "locked": { 204 | "lastModified": 1742095305, 205 | "narHash": "sha256-L8qjRx4MbX/juwbo8+4qYbqQy0MFUzUJLV5o8oujvaA=", 206 | "owner": "NixOS", 207 | "repo": "nixpkgs", 208 | "rev": "f985965fff9d4e5df55df0489ef113d09a6ee08d", 209 | "type": "github" 210 | }, 211 | "original": { 212 | "owner": "NixOS", 213 | "ref": "nixos-unstable-small", 214 | "repo": "nixpkgs", 215 | "type": "github" 216 | } 217 | }, 218 | "root": { 219 | "inputs": { 220 | "flake-parts": "flake-parts", 221 | "mill-ivy-fetcher": "mill-ivy-fetcher", 222 | "nixpkgs": "nixpkgs_2", 223 | "treefmt-nix": "treefmt-nix_2", 224 | "zaozi": "zaozi" 225 | } 226 | }, 227 | "systems": { 228 | "locked": { 229 | "lastModified": 1681028828, 230 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 231 | "owner": "nix-systems", 232 | "repo": "default", 233 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 234 | "type": "github" 235 | }, 236 | "original": { 237 | "owner": "nix-systems", 238 | "repo": "default", 239 | "type": "github" 240 | } 241 | }, 242 | "systems_2": { 243 | "locked": { 244 | "lastModified": 1681028828, 245 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 246 | "owner": "nix-systems", 247 | "repo": "default", 248 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 249 | "type": "github" 250 | }, 251 | "original": { 252 | "owner": "nix-systems", 253 | "repo": "default", 254 | "type": "github" 255 | } 256 | }, 257 | "treefmt-nix": { 258 | "inputs": { 259 | "nixpkgs": [ 260 | "mill-ivy-fetcher", 261 | "nixpkgs" 262 | ] 263 | }, 264 | "locked": { 265 | "lastModified": 1743748085, 266 | "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", 267 | "owner": "numtide", 268 | "repo": "treefmt-nix", 269 | "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", 270 | "type": "github" 271 | }, 272 | "original": { 273 | "owner": "numtide", 274 | "repo": "treefmt-nix", 275 | "type": "github" 276 | } 277 | }, 278 | "treefmt-nix_2": { 279 | "inputs": { 280 | "nixpkgs": [ 281 | "nixpkgs" 282 | ] 283 | }, 284 | "locked": { 285 | "lastModified": 1744961264, 286 | "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", 287 | "owner": "numtide", 288 | "repo": "treefmt-nix", 289 | "rev": "8d404a69efe76146368885110f29a2ca3700bee6", 290 | "type": "github" 291 | }, 292 | "original": { 293 | "owner": "numtide", 294 | "repo": "treefmt-nix", 295 | "type": "github" 296 | } 297 | }, 298 | "zaozi": { 299 | "inputs": { 300 | "chisel-nix": "chisel-nix", 301 | "flake-utils": "flake-utils_2", 302 | "nixpkgs": "nixpkgs_4", 303 | "nixpkgs4circt": "nixpkgs4circt" 304 | }, 305 | "locked": { 306 | "lastModified": 1744618990, 307 | "narHash": "sha256-U9wZ3sBJbsdjwfunz7rN3YPDKefvRrkdrKGuAXs6WjQ=", 308 | "owner": "sequencer", 309 | "repo": "zaozi", 310 | "rev": "5770967e3301547c547ed2b7bbc7c181f95524bf", 311 | "type": "github" 312 | }, 313 | "original": { 314 | "owner": "sequencer", 315 | "repo": "zaozi", 316 | "type": "github" 317 | } 318 | } 319 | }, 320 | "root": "root", 321 | "version": 7 322 | } 323 | -------------------------------------------------------------------------------- /templates/chisel/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Chisel Nix"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | flake-parts = { 7 | url = "github:hercules-ci/flake-parts"; 8 | inputs.nixpkgs-lib.follows = "nixpkgs"; 9 | }; 10 | treefmt-nix = { 11 | url = "github:numtide/treefmt-nix"; 12 | inputs.nixpkgs.follows = "nixpkgs"; 13 | }; 14 | zaozi.url = "github:sequencer/zaozi"; 15 | mill-ivy-fetcher.url = "github:Avimitin/mill-ivy-fetcher"; 16 | }; 17 | 18 | outputs = 19 | inputs@{ 20 | self, 21 | nixpkgs, 22 | flake-parts, 23 | ... 24 | }: 25 | let 26 | overlay = import ./nix/overlay.nix; 27 | in 28 | flake-parts.lib.mkFlake { inherit inputs; } { 29 | systems = [ 30 | "x86_64-linux" 31 | "aarch64-linux" 32 | "aarch64-darwin" 33 | ]; 34 | 35 | imports = [ 36 | inputs.treefmt-nix.flakeModule 37 | ]; 38 | 39 | flake.overlays.default = overlay; 40 | 41 | perSystem = 42 | { system, pkgs, ... }: 43 | { 44 | _module.args.pkgs = import nixpkgs { 45 | inherit system; 46 | # TODO: Do not depend on overlay of zaozi in favor of importing its outputs explicitly to avoid namespace pollution. 47 | overlays = with inputs; [ 48 | zaozi.overlays.default 49 | mill-ivy-fetcher.overlays.default 50 | overlay 51 | ]; 52 | }; 53 | 54 | legacyPackages = pkgs; 55 | 56 | treefmt = { 57 | projectRootFile = "flake.nix"; 58 | programs.scalafmt = { 59 | enable = true; 60 | includes = [ "*.mill" ]; 61 | }; 62 | programs.nixfmt = { 63 | enable = true; 64 | excludes = [ "*/generated.nix" ]; 65 | }; 66 | programs.rustfmt.enable = true; 67 | }; 68 | 69 | devShells.default = 70 | with pkgs; 71 | mkShell ( 72 | { 73 | inputsFrom = [ gcd.gcd-compiled ]; 74 | packages = [ 75 | cargo 76 | rust-analyzer 77 | nixd 78 | nvfetcher 79 | ]; 80 | RUST_SRC_PATH = "${rust.packages.stable.rustPlatform.rustLibSrc}"; 81 | } 82 | // gcd.tb-dpi-lib.env 83 | // gcd.gcd-compiled.env 84 | ); 85 | }; 86 | }; 87 | } 88 | -------------------------------------------------------------------------------- /templates/chisel/gcd/src/GCD.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | package org.chipsalliance.gcd 5 | 6 | import chisel3._ 7 | import chisel3.experimental.hierarchy.{instantiable, public, Instance, Instantiate} 8 | import chisel3.experimental.{SerializableModule, SerializableModuleParameter} 9 | import chisel3.probe.{define, Probe, ProbeValue} 10 | import chisel3.properties.{AnyClassType, Class, Property} 11 | import chisel3.util.{DecoupledIO, Valid} 12 | 13 | object GCDParameter { 14 | implicit def rwP: upickle.default.ReadWriter[GCDParameter] = 15 | upickle.default.macroRW 16 | } 17 | 18 | /** Parameter of [[GCD]] */ 19 | case class GCDParameter(width: Int, useAsyncReset: Boolean) extends SerializableModuleParameter 20 | 21 | /** Verification IO of [[GCD]] */ 22 | class GCDProbe(parameter: GCDParameter) extends Bundle { 23 | val busy = Bool() 24 | } 25 | 26 | /** Metadata of [[GCD]]. */ 27 | @instantiable 28 | class GCDOM(parameter: GCDParameter) extends Class { 29 | val width: Property[Int] = IO(Output(Property[Int]())) 30 | val useAsyncReset: Property[Boolean] = IO(Output(Property[Boolean]())) 31 | width := Property(parameter.width) 32 | useAsyncReset := Property(parameter.useAsyncReset) 33 | } 34 | 35 | /** Interface of [[GCD]]. */ 36 | class GCDInterface(parameter: GCDParameter) extends Bundle { 37 | val clock = Input(Clock()) 38 | val reset = Input(if (parameter.useAsyncReset) AsyncReset() else Bool()) 39 | val input = Flipped(DecoupledIO(new Bundle { 40 | val x = UInt(parameter.width.W) 41 | val y = UInt(parameter.width.W) 42 | })) 43 | val output = Valid(UInt(parameter.width.W)) 44 | val probe = Output(Probe(new GCDProbe(parameter), layers.Verification)) 45 | val om = Output(Property[AnyClassType]()) 46 | } 47 | 48 | /** Hardware Implementation of GCD */ 49 | @instantiable 50 | class GCD(val parameter: GCDParameter) 51 | extends FixedIORawModule(new GCDInterface(parameter)) 52 | with SerializableModule[GCDParameter] 53 | with ImplicitClock 54 | with ImplicitReset { 55 | override protected def implicitClock: Clock = io.clock 56 | override protected def implicitReset: Reset = io.reset 57 | 58 | val x: UInt = Reg(chiselTypeOf(io.input.bits.x)) 59 | // Block X-state propagation 60 | val y: UInt = RegInit(chiselTypeOf(io.input.bits.x), 0.U) 61 | val startupFlag = RegInit(false.B) 62 | val busy = y =/= 0.U 63 | 64 | when(x > y) { x := x - y }.otherwise { y := y - x } 65 | 66 | when(io.input.fire) { 67 | x := io.input.bits.x 68 | y := io.input.bits.y 69 | startupFlag := true.B 70 | } 71 | 72 | io.input.ready := !busy 73 | io.output.bits := x 74 | io.output.valid := startupFlag && !busy 75 | 76 | // Assign Probe 77 | val probeWire: GCDProbe = Wire(new GCDProbe(parameter)) 78 | define(io.probe, ProbeValue(probeWire)) 79 | probeWire.busy := busy 80 | 81 | // Assign Metadata 82 | val omInstance: Instance[GCDOM] = Instantiate(new GCDOM(parameter)) 83 | io.om := omInstance.getPropertyReference.asAnyClassType 84 | } 85 | -------------------------------------------------------------------------------- /templates/chisel/gcd/src/GCDFormal.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | package org.chipsalliance.gcd 5 | 6 | import chisel3._ 7 | import chisel3.experimental.hierarchy.{instantiable, public, Instance, Instantiate} 8 | import chisel3.experimental.{SerializableModule, SerializableModuleParameter} 9 | import chisel3.ltl.Property.{eventually, not} 10 | import chisel3.ltl.{AssertProperty, CoverProperty, Delay, Sequence} 11 | import chisel3.properties.{AnyClassType, Class, Property} 12 | import chisel3.util.circt.dpi.{RawClockedNonVoidFunctionCall, RawUnclockedNonVoidFunctionCall} 13 | import chisel3.util.{Counter, HasExtModuleInline, RegEnable, Valid} 14 | import chisel3.layers.Verification.Assume 15 | import chisel3.ltl.AssumeProperty 16 | 17 | object GCDFormalParameter { 18 | implicit def rwP: upickle.default.ReadWriter[GCDFormalParameter] = 19 | upickle.default.macroRW 20 | } 21 | 22 | /** Parameter of [[GCD]]. */ 23 | case class GCDFormalParameter(gcdParameter: GCDParameter) extends SerializableModuleParameter {} 24 | 25 | @instantiable 26 | class GCDFormalOM(parameter: GCDFormalParameter) extends Class { 27 | val gcd = IO(Output(Property[AnyClassType]())) 28 | @public 29 | val gcdIn = IO(Input(Property[AnyClassType]())) 30 | gcd := gcdIn 31 | } 32 | 33 | class GCDFormalInterface(parameter: GCDFormalParameter) extends Bundle { 34 | val clock = Input(Clock()) 35 | val reset = Input(if (parameter.gcdParameter.useAsyncReset) AsyncReset() else Bool()) 36 | val input = Flipped(Valid(new Bundle { 37 | val x = UInt(parameter.gcdParameter.width.W) 38 | val y = UInt(parameter.gcdParameter.width.W) 39 | })) 40 | val om = Output(Property[AnyClassType]()) 41 | } 42 | 43 | @instantiable 44 | class GCDFormal(val parameter: GCDFormalParameter) 45 | extends FixedIORawModule(new GCDFormalInterface(parameter)) 46 | with SerializableModule[GCDFormalParameter] 47 | with ImplicitClock 48 | with ImplicitReset { 49 | override protected def implicitClock: Clock = io.clock 50 | override protected def implicitReset: Reset = io.reset 51 | // Instantiate DUT. 52 | val dut: Instance[GCD] = Instantiate(new GCD(parameter.gcdParameter)) 53 | // Instantiate OM 54 | val omInstance = Instantiate(new GCDFormalOM(parameter)) 55 | io.om := omInstance.getPropertyReference.asAnyClassType 56 | omInstance.gcdIn := dut.io.om 57 | 58 | dut.io.clock := implicitClock 59 | dut.io.reset := implicitReset 60 | 61 | // LTL Checker 62 | import Sequence._ 63 | val inputFire: Sequence = dut.io.input.fire 64 | val inputNotFire: Sequence = !dut.io.input.fire 65 | val outputFire: Sequence = dut.io.output.valid 66 | val outputNotFire: Sequence = !dut.io.output.valid 67 | val inputNotValid: Sequence = dut.io.input.ready && !dut.io.input.valid 68 | 69 | dut.io.input.bits := io.input.bits 70 | dut.io.input.valid := io.input.valid 71 | 72 | AssumeProperty( 73 | inputNotValid |=> not(inputFire), 74 | label = Some("GCD_ASSUMPTION_INPUT_NOT_VALID") 75 | ) 76 | AssumeProperty( 77 | dut.io.input.bits.x === 4.U && dut.io.input.bits.y === 6.U, 78 | label = Some("GCD_ASSUMPTION_INPUT_4_6") 79 | ) 80 | 81 | AssertProperty( 82 | inputFire |=> inputNotFire.repeatAtLeast(1) ### outputFire, 83 | label = Some("GCD_ALWAYS_RESPONSE") 84 | ) 85 | AssertProperty( 86 | inputFire |-> not(inputNotFire.repeatAtLeast(1) ### (outputNotFire.and(inputFire))), 87 | label = Some("GCD_NO_DOUBLE_FIRE") 88 | ) 89 | AssertProperty( 90 | outputFire |-> dut.io.output.bits === 2.U, 91 | label = Some("GCD_RESULT_IS_CORRECT") 92 | ) 93 | 94 | CoverProperty( 95 | inputNotValid, 96 | label = Some("GCD_COVER_BACK_PRESSURE") 97 | ) 98 | } 99 | -------------------------------------------------------------------------------- /templates/chisel/gcd/src/GCDTestBench.scala: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | // SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | package org.chipsalliance.gcd 5 | 6 | import chisel3._ 7 | import chisel3.experimental.hierarchy.{instantiable, public, Instance, Instantiate} 8 | import chisel3.experimental.{SerializableModule, SerializableModuleParameter} 9 | import chisel3.ltl.Property.{eventually, not} 10 | import chisel3.ltl.{AssertProperty, CoverProperty, Delay, Sequence} 11 | import chisel3.properties.{AnyClassType, Class, Property} 12 | import chisel3.util.circt.dpi.{RawClockedNonVoidFunctionCall, RawUnclockedNonVoidFunctionCall} 13 | import chisel3.util.{Counter, HasExtModuleInline, RegEnable, Valid} 14 | 15 | object GCDTestBenchParameter { 16 | implicit def rwP: upickle.default.ReadWriter[GCDTestBenchParameter] = 17 | upickle.default.macroRW 18 | } 19 | 20 | /** Parameter of [[GCD]]. */ 21 | case class GCDTestBenchParameter( 22 | testVerbatimParameter: TestVerbatimParameter, 23 | gcdParameter: GCDParameter, 24 | timeout: Int, 25 | testSize: Int) 26 | extends SerializableModuleParameter { 27 | require( 28 | (testVerbatimParameter.useAsyncReset && gcdParameter.useAsyncReset) || 29 | (!testVerbatimParameter.useAsyncReset && !gcdParameter.useAsyncReset), 30 | "Reset Type check failed." 31 | ) 32 | } 33 | 34 | @instantiable 35 | class GCDTestBenchOM(parameter: GCDTestBenchParameter) extends Class { 36 | val gcd = IO(Output(Property[AnyClassType]())) 37 | @public 38 | val gcdIn = IO(Input(Property[AnyClassType]())) 39 | gcd := gcdIn 40 | } 41 | 42 | class GCDTestBenchInterface(parameter: GCDTestBenchParameter) extends Bundle { 43 | val om = Output(Property[AnyClassType]()) 44 | } 45 | 46 | @instantiable 47 | class GCDTestBench(val parameter: GCDTestBenchParameter) 48 | extends FixedIORawModule(new GCDTestBenchInterface(parameter)) 49 | with SerializableModule[GCDTestBenchParameter] 50 | with ImplicitClock 51 | with ImplicitReset { 52 | override protected def implicitClock: Clock = verbatim.io.clock 53 | override protected def implicitReset: Reset = verbatim.io.reset 54 | // Instantiate Drivers 55 | val verbatim: Instance[TestVerbatim] = Instantiate( 56 | new TestVerbatim(parameter.testVerbatimParameter) 57 | ) 58 | // Instantiate DUT. 59 | val dut: Instance[GCD] = Instantiate(new GCD(parameter.gcdParameter)) 60 | // Instantiate OM 61 | val omInstance = Instantiate(new GCDTestBenchOM(parameter)) 62 | io.om := omInstance.getPropertyReference.asAnyClassType 63 | omInstance.gcdIn := dut.io.om 64 | 65 | dut.io.clock := implicitClock 66 | dut.io.reset := implicitReset 67 | 68 | // Simulation Logic 69 | val simulationTime: UInt = RegInit(0.U(64.W)) 70 | simulationTime := simulationTime + 1.U 71 | // For each timeout ticks, check it 72 | val (_, callWatchdog) = Counter(true.B, parameter.timeout / 2) 73 | val watchdogCode = RawUnclockedNonVoidFunctionCall("gcd_watchdog", UInt(8.W))(callWatchdog) 74 | when(watchdogCode =/= 0.U) { 75 | stop(cf"""{"event":"SimulationStop","reason": ${watchdogCode},"cycle":${simulationTime}}\n""") 76 | } 77 | class TestPayload extends Bundle { 78 | val x = UInt(parameter.gcdParameter.width.W) 79 | val y = UInt(parameter.gcdParameter.width.W) 80 | val result = UInt(parameter.gcdParameter.width.W) 81 | } 82 | val request = 83 | RawClockedNonVoidFunctionCall("gcd_input", Valid(new TestPayload))( 84 | dut.io.clock, 85 | !dut.io.reset.asBool && dut.io.input.ready 86 | ) 87 | when(dut.io.input.ready) { 88 | dut.io.input.valid := request.valid 89 | dut.io.input.bits := request.bits 90 | }.otherwise { 91 | dut.io.input.valid := false.B; 92 | dut.io.input.bits := DontCare; 93 | } 94 | 95 | // LTL Checker 96 | import Sequence._ 97 | val inputFire: Sequence = dut.io.input.fire 98 | val inputNotFire: Sequence = !dut.io.input.fire 99 | val outputFire: Sequence = dut.io.output.valid 100 | val outputNotFire: Sequence = !dut.io.output.valid 101 | val lastRequestResult: UInt = RegEnable(request.bits.result, dut.io.input.fire) 102 | val checkRight: Sequence = lastRequestResult === dut.io.output.bits 103 | val inputNotValid: Sequence = dut.io.input.ready && !dut.io.input.valid 104 | 105 | AssertProperty( 106 | inputFire |=> inputNotFire.repeatAtLeast(1) ### outputFire, 107 | label = Some("GCD_ALWAYS_RESPONSE") 108 | ) 109 | AssertProperty( 110 | inputFire |=> not(inputNotFire.repeatAtLeast(1) ### (outputNotFire.and(inputFire))), 111 | label = Some("GCD_NO_DOUBLE_FIRE") 112 | ) 113 | AssertProperty( 114 | outputFire |-> checkRight, 115 | label = Some("GCD_ASSERT_RESULT_CHECK") 116 | ) 117 | // TODO: need generate $rose function in SVA 118 | // CoverProperty( 119 | // rose(outputFire).nonConsecutiveRepeat(parameter.testSize - 1), 120 | // label = Some("GCD_COVER_FIRE") 121 | // ) 122 | CoverProperty( 123 | inputNotValid, 124 | label = Some("GCD_COVER_BACK_PRESSURE") 125 | ) 126 | } 127 | object TestVerbatimParameter { 128 | implicit def rwP: upickle.default.ReadWriter[TestVerbatimParameter] = 129 | upickle.default.macroRW 130 | } 131 | 132 | case class TestVerbatimParameter( 133 | useAsyncReset: Boolean, 134 | initFunctionName: String, 135 | dumpFunctionName: String, 136 | clockFlipTick: Int, 137 | resetFlipTick: Int) 138 | extends SerializableModuleParameter 139 | 140 | @instantiable 141 | class TestVerbatimOM(parameter: TestVerbatimParameter) extends Class { 142 | val useAsyncReset: Property[Boolean] = IO(Output(Property[Boolean]())) 143 | val initFunctionName: Property[String] = IO(Output(Property[String]())) 144 | val dumpFunctionName: Property[String] = IO(Output(Property[String]())) 145 | val clockFlipTick: Property[Int] = IO(Output(Property[Int]())) 146 | val resetFlipTick: Property[Int] = IO(Output(Property[Int]())) 147 | val gcd = IO(Output(Property[AnyClassType]())) 148 | @public 149 | val gcdIn = IO(Input(Property[AnyClassType]())) 150 | gcd := gcdIn 151 | useAsyncReset := Property(parameter.useAsyncReset) 152 | initFunctionName := Property(parameter.initFunctionName) 153 | dumpFunctionName := Property(parameter.dumpFunctionName) 154 | clockFlipTick := Property(parameter.clockFlipTick) 155 | resetFlipTick := Property(parameter.resetFlipTick) 156 | } 157 | 158 | /** Test blackbox for clockgen, wave dump and extra testbench-only codes. */ 159 | class TestVerbatimInterface(parameter: TestVerbatimParameter) extends Bundle { 160 | val clock: Clock = Output(Clock()) 161 | val reset: Reset = Output( 162 | if (parameter.useAsyncReset) AsyncReset() else Bool() 163 | ) 164 | } 165 | 166 | @instantiable 167 | class TestVerbatim(parameter: TestVerbatimParameter) 168 | extends FixedIOExtModule(new TestVerbatimInterface(parameter)) 169 | with HasExtModuleInline { 170 | setInline( 171 | s"$desiredName.sv", 172 | s"""module $desiredName(output reg clock, output reg reset); 173 | | export "DPI-C" function ${parameter.dumpFunctionName}; 174 | | function ${parameter.dumpFunctionName}(input string file); 175 | |`ifdef VCS 176 | | $$fsdbDumpfile(file); 177 | | $$fsdbDumpvars("+all"); 178 | | $$fsdbDumpSVA; 179 | | $$fsdbDumpon; 180 | |`endif 181 | |`ifdef VERILATOR 182 | | $$dumpfile(file); 183 | | $$dumpvars(0); 184 | |`endif 185 | | endfunction; 186 | | 187 | | import "DPI-C" context function void ${parameter.initFunctionName}(); 188 | | initial begin 189 | | ${parameter.initFunctionName}(); 190 | | clock = 1'b0; 191 | | reset = 1'b1; 192 | | end 193 | | initial #(${parameter.resetFlipTick}) reset = 1'b0; 194 | | always #${parameter.clockFlipTick} clock = ~clock; 195 | |endmodule 196 | |""".stripMargin 197 | ) 198 | } 199 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.1.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "autocfg" 16 | version = "1.3.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 19 | 20 | [[package]] 21 | name = "byteorder" 22 | version = "1.5.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 25 | 26 | [[package]] 27 | name = "cfg-if" 28 | version = "1.0.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 31 | 32 | [[package]] 33 | name = "gcdemu" 34 | version = "0.1.0" 35 | dependencies = [ 36 | "num-bigint", 37 | "num-traits", 38 | "rand", 39 | "svdpi", 40 | "tracing", 41 | "tracing-subscriber", 42 | ] 43 | 44 | [[package]] 45 | name = "getrandom" 46 | version = "0.2.15" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 49 | dependencies = [ 50 | "cfg-if", 51 | "libc", 52 | "wasi", 53 | ] 54 | 55 | [[package]] 56 | name = "lazy_static" 57 | version = "1.5.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 60 | 61 | [[package]] 62 | name = "libc" 63 | version = "0.2.158" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" 66 | 67 | [[package]] 68 | name = "log" 69 | version = "0.4.22" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 72 | 73 | [[package]] 74 | name = "matchers" 75 | version = "0.1.0" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 78 | dependencies = [ 79 | "regex-automata 0.1.10", 80 | ] 81 | 82 | [[package]] 83 | name = "memchr" 84 | version = "2.7.4" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 87 | 88 | [[package]] 89 | name = "nu-ansi-term" 90 | version = "0.46.0" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 93 | dependencies = [ 94 | "overload", 95 | "winapi", 96 | ] 97 | 98 | [[package]] 99 | name = "num-bigint" 100 | version = "0.4.6" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 103 | dependencies = [ 104 | "num-integer", 105 | "num-traits", 106 | "rand", 107 | ] 108 | 109 | [[package]] 110 | name = "num-integer" 111 | version = "0.1.46" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 114 | dependencies = [ 115 | "num-traits", 116 | ] 117 | 118 | [[package]] 119 | name = "num-traits" 120 | version = "0.2.19" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 123 | dependencies = [ 124 | "autocfg", 125 | ] 126 | 127 | [[package]] 128 | name = "once_cell" 129 | version = "1.19.0" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 132 | 133 | [[package]] 134 | name = "overload" 135 | version = "0.1.1" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 138 | 139 | [[package]] 140 | name = "pin-project-lite" 141 | version = "0.2.14" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 144 | 145 | [[package]] 146 | name = "ppv-lite86" 147 | version = "0.2.20" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 150 | dependencies = [ 151 | "zerocopy", 152 | ] 153 | 154 | [[package]] 155 | name = "proc-macro2" 156 | version = "1.0.86" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 159 | dependencies = [ 160 | "unicode-ident", 161 | ] 162 | 163 | [[package]] 164 | name = "quote" 165 | version = "1.0.37" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 168 | dependencies = [ 169 | "proc-macro2", 170 | ] 171 | 172 | [[package]] 173 | name = "rand" 174 | version = "0.8.5" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 177 | dependencies = [ 178 | "libc", 179 | "rand_chacha", 180 | "rand_core", 181 | ] 182 | 183 | [[package]] 184 | name = "rand_chacha" 185 | version = "0.3.1" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 188 | dependencies = [ 189 | "ppv-lite86", 190 | "rand_core", 191 | ] 192 | 193 | [[package]] 194 | name = "rand_core" 195 | version = "0.6.4" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 198 | dependencies = [ 199 | "getrandom", 200 | ] 201 | 202 | [[package]] 203 | name = "regex" 204 | version = "1.10.6" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" 207 | dependencies = [ 208 | "aho-corasick", 209 | "memchr", 210 | "regex-automata 0.4.7", 211 | "regex-syntax 0.8.4", 212 | ] 213 | 214 | [[package]] 215 | name = "regex-automata" 216 | version = "0.1.10" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 219 | dependencies = [ 220 | "regex-syntax 0.6.29", 221 | ] 222 | 223 | [[package]] 224 | name = "regex-automata" 225 | version = "0.4.7" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 228 | dependencies = [ 229 | "aho-corasick", 230 | "memchr", 231 | "regex-syntax 0.8.4", 232 | ] 233 | 234 | [[package]] 235 | name = "regex-syntax" 236 | version = "0.6.29" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 239 | 240 | [[package]] 241 | name = "regex-syntax" 242 | version = "0.8.4" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" 245 | 246 | [[package]] 247 | name = "sharded-slab" 248 | version = "0.1.7" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 251 | dependencies = [ 252 | "lazy_static", 253 | ] 254 | 255 | [[package]] 256 | name = "smallvec" 257 | version = "1.13.2" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 260 | 261 | [[package]] 262 | name = "svdpi" 263 | version = "0.0.1" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "9248c35a9b58d508b60d40b6f5ab8173760b32445d055e90822f57f09b9d0f58" 266 | 267 | [[package]] 268 | name = "syn" 269 | version = "2.0.75" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" 272 | dependencies = [ 273 | "proc-macro2", 274 | "quote", 275 | "unicode-ident", 276 | ] 277 | 278 | [[package]] 279 | name = "thread_local" 280 | version = "1.1.8" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 283 | dependencies = [ 284 | "cfg-if", 285 | "once_cell", 286 | ] 287 | 288 | [[package]] 289 | name = "tracing" 290 | version = "0.1.40" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 293 | dependencies = [ 294 | "pin-project-lite", 295 | "tracing-attributes", 296 | "tracing-core", 297 | ] 298 | 299 | [[package]] 300 | name = "tracing-attributes" 301 | version = "0.1.27" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 304 | dependencies = [ 305 | "proc-macro2", 306 | "quote", 307 | "syn", 308 | ] 309 | 310 | [[package]] 311 | name = "tracing-core" 312 | version = "0.1.32" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 315 | dependencies = [ 316 | "once_cell", 317 | "valuable", 318 | ] 319 | 320 | [[package]] 321 | name = "tracing-log" 322 | version = "0.2.0" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 325 | dependencies = [ 326 | "log", 327 | "once_cell", 328 | "tracing-core", 329 | ] 330 | 331 | [[package]] 332 | name = "tracing-subscriber" 333 | version = "0.3.18" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 336 | dependencies = [ 337 | "matchers", 338 | "nu-ansi-term", 339 | "once_cell", 340 | "regex", 341 | "sharded-slab", 342 | "smallvec", 343 | "thread_local", 344 | "tracing", 345 | "tracing-core", 346 | "tracing-log", 347 | ] 348 | 349 | [[package]] 350 | name = "unicode-ident" 351 | version = "1.0.12" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 354 | 355 | [[package]] 356 | name = "valuable" 357 | version = "0.1.0" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 360 | 361 | [[package]] 362 | name = "wasi" 363 | version = "0.11.0+wasi-snapshot-preview1" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 366 | 367 | [[package]] 368 | name = "winapi" 369 | version = "0.3.9" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 372 | dependencies = [ 373 | "winapi-i686-pc-windows-gnu", 374 | "winapi-x86_64-pc-windows-gnu", 375 | ] 376 | 377 | [[package]] 378 | name = "winapi-i686-pc-windows-gnu" 379 | version = "0.4.0" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 382 | 383 | [[package]] 384 | name = "winapi-x86_64-pc-windows-gnu" 385 | version = "0.4.0" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 388 | 389 | [[package]] 390 | name = "zerocopy" 391 | version = "0.7.35" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 394 | dependencies = [ 395 | "byteorder", 396 | "zerocopy-derive", 397 | ] 398 | 399 | [[package]] 400 | name = "zerocopy-derive" 401 | version = "0.7.35" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 404 | dependencies = [ 405 | "proc-macro2", 406 | "quote", 407 | "syn", 408 | ] 409 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gcdemu" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | svdpi = { version = "0.0.1" } 8 | rand = "0.8" 9 | num-traits = "0.2.19" 10 | num-bigint = { version = "0.4.6", features = ["rand"] } 11 | tracing = "0.1.40" 12 | tracing-subscriber = { version = "0.3.18", features = ["env-filter", "ansi"] } 13 | 14 | [features] 15 | sv2023 = ["svdpi/sv2023"] 16 | trace = [] 17 | vpi = ["svdpi/vpi"] 18 | 19 | [lib] 20 | crate-type = ["staticlib"] 21 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/src/dpi.rs: -------------------------------------------------------------------------------- 1 | use std::cmp::max; 2 | use std::ffi::{c_char, CString}; 3 | use std::sync::Mutex; 4 | 5 | use crate::drive::Driver; 6 | use crate::plusarg::PlusArgMatcher; 7 | use crate::GcdArgs; 8 | use num_bigint::BigUint; 9 | use svdpi::sys::dpi::{svBitVecVal, svLogic}; 10 | use svdpi::SvScope; 11 | 12 | pub type SvBitVecVal = u32; 13 | 14 | // -------------------------- 15 | // preparing data structures 16 | // -------------------------- 17 | 18 | static DPI_TARGET: Mutex>> = Mutex::new(None); 19 | 20 | #[derive(Debug)] 21 | pub(crate) struct TestPayloadBits { 22 | pub(crate) x: BigUint, 23 | pub(crate) y: BigUint, 24 | pub(crate) result: BigUint, 25 | } 26 | #[derive(Debug)] 27 | pub(crate) struct TestPayload { 28 | pub(crate) valid: svLogic, 29 | pub(crate) bits: TestPayloadBits, 30 | } 31 | 32 | unsafe fn write_to_pointer(dst: *mut u8, data: &[u8]) { 33 | let dst = std::slice::from_raw_parts_mut(dst, data.len()); 34 | dst.copy_from_slice(data); 35 | } 36 | 37 | unsafe fn fill_test_payload(dst: *mut SvBitVecVal, data_width: u64, payload: &TestPayload) { 38 | let biguint_to_vec = |x: &BigUint| -> Vec { 39 | let mut x_bytes = x.to_bytes_le(); 40 | x_bytes.resize((data_width as f64 / 8f64).ceil() as usize, 0); 41 | x_bytes 42 | }; 43 | 44 | assert!( 45 | max( 46 | max(payload.bits.x.bits(), payload.bits.y.bits()), 47 | payload.bits.result.bits() 48 | ) <= data_width 49 | ); 50 | 51 | // The field in the struct is the most significant first 52 | let data = (biguint_to_vec(&payload.bits.result).iter()) 53 | .chain(biguint_to_vec(&payload.bits.y).iter()) 54 | .chain(biguint_to_vec(&payload.bits.x).iter()) 55 | .chain(vec![payload.valid].iter()) 56 | .cloned() 57 | .collect::>(); 58 | write_to_pointer(dst as *mut u8, &data); 59 | } 60 | 61 | //---------------------- 62 | // dpi functions 63 | //---------------------- 64 | 65 | #[no_mangle] 66 | unsafe extern "C" fn gcd_init() { 67 | let plusargs = PlusArgMatcher::from_args(); 68 | let args = GcdArgs::from_plusargs(&plusargs); 69 | args.setup_logger().unwrap(); 70 | let scope = SvScope::get_current().expect("failed to get scope in gcd_init"); 71 | let driver = Box::new(Driver::new(scope, &args)); 72 | 73 | let mut dpi_target = DPI_TARGET.lock().unwrap(); 74 | assert!(dpi_target.is_none(), "gcd_init should be called only once"); 75 | *dpi_target = Some(driver); 76 | 77 | if let Some(driver) = dpi_target.as_mut() { 78 | driver.init(); 79 | } 80 | } 81 | 82 | #[no_mangle] 83 | unsafe extern "C" fn gcd_watchdog(reason: *mut c_char) { 84 | let mut driver = DPI_TARGET.lock().unwrap(); 85 | if let Some(driver) = driver.as_mut() { 86 | *reason = driver.watchdog() as c_char; 87 | } 88 | } 89 | 90 | #[no_mangle] 91 | unsafe extern "C" fn gcd_input(payload: *mut svBitVecVal) { 92 | let mut driver = DPI_TARGET.lock().unwrap(); 93 | if let Some(driver) = driver.as_mut() { 94 | fill_test_payload(payload, driver.data_width, &driver.get_input()); 95 | } 96 | } 97 | 98 | //-------------------------------- 99 | // import functions and wrappers 100 | //-------------------------------- 101 | 102 | mod dpi_export { 103 | use std::ffi::c_char; 104 | extern "C" { 105 | #[cfg(feature = "trace")] 106 | /// `export "DPI-C" function dump_wave(input string file)` 107 | pub fn dump_wave(path: *const c_char); 108 | } 109 | } 110 | 111 | #[cfg(feature = "trace")] 112 | pub(crate) fn dump_wave(scope: SvScope, path: &str) { 113 | use svdpi::set_scope; 114 | 115 | let path_cstring = CString::new(path).unwrap(); 116 | 117 | set_scope(scope); 118 | unsafe { 119 | dpi_export::dump_wave(path_cstring.as_ptr()); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/src/drive.rs: -------------------------------------------------------------------------------- 1 | use num_bigint::{BigUint, RandBigInt}; 2 | use num_traits::Zero; 3 | use rand::Rng; 4 | use tracing::{error, info, trace}; 5 | 6 | use crate::{ 7 | dpi::{TestPayload, TestPayloadBits}, 8 | GcdArgs, 9 | }; 10 | use svdpi::{get_time, SvScope}; 11 | 12 | pub(crate) struct Driver { 13 | scope: SvScope, 14 | pub(crate) data_width: u64, 15 | pub(crate) timeout: u64, 16 | pub(crate) test_size: u64, 17 | pub(crate) clock_flip_time: u64, 18 | 19 | #[cfg(feature = "trace")] 20 | wave_path: String, 21 | #[cfg(feature = "trace")] 22 | dump_start: u64, 23 | #[cfg(feature = "trace")] 24 | dump_end: u64, 25 | #[cfg(feature = "trace")] 26 | dump_started: bool, 27 | 28 | test_num: u64, 29 | last_input_cycle: u64, 30 | } 31 | 32 | impl Driver { 33 | fn get_tick(&self) -> u64 { 34 | get_time() / self.clock_flip_time 35 | } 36 | 37 | pub(crate) fn new(scope: SvScope, args: &GcdArgs) -> Self { 38 | Self { 39 | scope, 40 | #[cfg(feature = "trace")] 41 | wave_path: args.wave_path.to_owned(), 42 | #[cfg(feature = "trace")] 43 | dump_start: args.dump_start, 44 | #[cfg(feature = "trace")] 45 | dump_end: args.dump_end, 46 | #[cfg(feature = "trace")] 47 | dump_started: false, 48 | data_width: env!("DESIGN_DATA_WIDTH").parse().unwrap(), 49 | timeout: env!("DESIGN_TIMEOUT").parse().unwrap(), 50 | test_size: env!("DESIGN_TEST_SIZE").parse().unwrap(), 51 | clock_flip_time: env!("CLOCK_FLIP_TIME").parse().unwrap(), 52 | test_num: 0, 53 | last_input_cycle: 0, 54 | } 55 | } 56 | 57 | pub(crate) fn init(&mut self) { 58 | #[cfg(feature = "trace")] 59 | if self.dump_start == 0 { 60 | self.start_dump_wave(); 61 | self.dump_started = true; 62 | } 63 | } 64 | 65 | pub(crate) fn get_input(&mut self) -> TestPayload { 66 | fn gcd(x: BigUint, y: BigUint) -> BigUint { 67 | if y.is_zero() { 68 | x.clone() 69 | } else { 70 | gcd(y.clone(), x % y) 71 | } 72 | } 73 | 74 | let mut rng = rand::thread_rng(); 75 | let x = rng.gen_biguint(self.data_width); 76 | let y = rng.gen_biguint(self.data_width); 77 | let result = gcd(x.clone(), y.clone()); 78 | 79 | self.last_input_cycle = self.get_tick(); 80 | self.test_num += 1; 81 | trace!( 82 | "[{}] the {}th input is x={} y={} result={}", 83 | self.get_tick(), 84 | self.test_num, 85 | &x, 86 | &y, 87 | &result 88 | ); 89 | TestPayload { 90 | valid: if rand::thread_rng().gen::() < 0.95 { 91 | 1 92 | } else { 93 | 0 94 | }, 95 | bits: TestPayloadBits { x, y, result }, 96 | } 97 | } 98 | 99 | pub(crate) fn watchdog(&mut self) -> u8 { 100 | const WATCHDOG_CONTINUE: u8 = 0; 101 | const WATCHDOG_TIMEOUT: u8 = 1; 102 | const WATCHDOG_FINISH: u8 = 2; 103 | 104 | let tick = self.get_tick(); 105 | if self.test_num >= self.test_size { 106 | info!("[{tick}] test finished, exiting"); 107 | WATCHDOG_FINISH 108 | } else if tick - self.last_input_cycle > self.timeout { 109 | error!( 110 | "[{}] watchdog timeout, last input tick = {}, {} tests completed", 111 | tick, self.last_input_cycle, self.test_num 112 | ); 113 | WATCHDOG_TIMEOUT 114 | } else { 115 | #[cfg(feature = "trace")] 116 | if self.dump_end != 0 && tick > self.dump_end { 117 | info!("[{tick}] run to dump end, exiting"); 118 | return WATCHDOG_FINISH; 119 | } 120 | 121 | #[cfg(feature = "trace")] 122 | if !self.dump_started && tick >= self.dump_start { 123 | self.start_dump_wave(); 124 | self.dump_started = true; 125 | } 126 | trace!("[{tick}] watchdog continue"); 127 | WATCHDOG_CONTINUE 128 | } 129 | } 130 | 131 | #[cfg(feature = "trace")] 132 | fn start_dump_wave(&mut self) { 133 | use crate::dpi::dump_wave; 134 | dump_wave(self.scope, &self.wave_path); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/src/lib.rs: -------------------------------------------------------------------------------- 1 | use plusarg::PlusArgMatcher; 2 | use tracing::Level; 3 | use tracing_subscriber::{EnvFilter, FmtSubscriber}; 4 | 5 | pub mod dpi; 6 | pub mod drive; 7 | pub mod plusarg; 8 | 9 | pub(crate) struct GcdArgs { 10 | #[cfg(feature = "trace")] 11 | dump_start: u64, 12 | 13 | #[cfg(feature = "trace")] 14 | dump_end: u64, 15 | 16 | #[cfg(feature = "trace")] 17 | pub wave_path: String, 18 | 19 | pub log_level: String, 20 | } 21 | 22 | impl GcdArgs { 23 | pub fn setup_logger(&self) -> Result<(), Box> { 24 | let log_level: Level = self.log_level.parse()?; 25 | let global_logger = FmtSubscriber::builder() 26 | .with_env_filter(EnvFilter::from_default_env()) 27 | .with_max_level(log_level) 28 | .without_time() 29 | .with_target(false) 30 | .with_ansi(true) 31 | .compact() 32 | .finish(); 33 | tracing::subscriber::set_global_default(global_logger) 34 | .expect("internal error: fail to setup log subscriber"); 35 | Ok(()) 36 | } 37 | 38 | pub fn from_plusargs(matcher: &PlusArgMatcher) -> Self { 39 | Self { 40 | #[cfg(feature = "trace")] 41 | dump_start: matcher.match_("dump-start").parse().unwrap(), 42 | #[cfg(feature = "trace")] 43 | dump_end: matcher.match_("dump-end").parse().unwrap(), 44 | #[cfg(feature = "trace")] 45 | wave_path: matcher.match_("wave-path").into(), 46 | log_level: matcher.try_match("log-level").unwrap_or("info").into(), 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /templates/chisel/gcdemu/src/plusarg.rs: -------------------------------------------------------------------------------- 1 | pub struct PlusArgMatcher { 2 | plusargs: Vec, 3 | } 4 | 5 | impl PlusArgMatcher { 6 | pub fn from_args() -> Self { 7 | let plusargs = std::env::args() 8 | .filter(|arg| arg.starts_with('+')) 9 | .collect(); 10 | 11 | Self { plusargs } 12 | } 13 | 14 | pub fn try_match(&self, arg_name: &str) -> Option<&str> { 15 | let prefix = &format!("+{arg_name}="); 16 | 17 | for plusarg in &self.plusargs { 18 | if plusarg.starts_with(prefix) { 19 | return Some(&plusarg[prefix.len()..]); 20 | } 21 | } 22 | None 23 | } 24 | 25 | pub fn match_(&self, arg_name: &str) -> &str { 26 | self.try_match(arg_name).unwrap_or_else(|| { 27 | tracing::error!("required plusarg '+{arg_name}=' not found"); 28 | panic!("failed to match '+{arg_name}='"); 29 | }) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /templates/chisel/nix/dependencies/_sources/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "chisel": { 3 | "cargoLocks": null, 4 | "date": "2025-04-22", 5 | "extract": null, 6 | "name": "chisel", 7 | "passthru": null, 8 | "pinned": false, 9 | "src": { 10 | "deepClone": false, 11 | "fetchSubmodules": false, 12 | "leaveDotGit": false, 13 | "name": null, 14 | "owner": "chipsalliance", 15 | "repo": "chisel", 16 | "rev": "41db7047e78705f834c38a41609399927f46f565", 17 | "sha256": "sha256-sXrQAYU6oBq+yvoXbxwkso6xdnYAkkbae+qMmS98nes=", 18 | "sparseCheckout": [], 19 | "type": "github" 20 | }, 21 | "version": "41db7047e78705f834c38a41609399927f46f565" 22 | }, 23 | "zaozi": { 24 | "cargoLocks": null, 25 | "date": "2025-04-14", 26 | "extract": null, 27 | "name": "zaozi", 28 | "passthru": null, 29 | "pinned": false, 30 | "src": { 31 | "deepClone": false, 32 | "fetchSubmodules": false, 33 | "leaveDotGit": false, 34 | "name": null, 35 | "owner": "sequencer", 36 | "repo": "zaozi", 37 | "rev": "5770967e3301547c547ed2b7bbc7c181f95524bf", 38 | "sha256": "sha256-U9wZ3sBJbsdjwfunz7rN3YPDKefvRrkdrKGuAXs6WjQ=", 39 | "sparseCheckout": [], 40 | "type": "github" 41 | }, 42 | "version": "5770967e3301547c547ed2b7bbc7c181f95524bf" 43 | } 44 | } -------------------------------------------------------------------------------- /templates/chisel/nix/dependencies/_sources/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub, dockerTools }: 3 | { 4 | chisel = { 5 | pname = "chisel"; 6 | version = "41db7047e78705f834c38a41609399927f46f565"; 7 | src = fetchFromGitHub { 8 | owner = "chipsalliance"; 9 | repo = "chisel"; 10 | rev = "41db7047e78705f834c38a41609399927f46f565"; 11 | fetchSubmodules = false; 12 | sha256 = "sha256-sXrQAYU6oBq+yvoXbxwkso6xdnYAkkbae+qMmS98nes="; 13 | }; 14 | date = "2025-04-22"; 15 | }; 16 | zaozi = { 17 | pname = "zaozi"; 18 | version = "5770967e3301547c547ed2b7bbc7c181f95524bf"; 19 | src = fetchFromGitHub { 20 | owner = "sequencer"; 21 | repo = "zaozi"; 22 | rev = "5770967e3301547c547ed2b7bbc7c181f95524bf"; 23 | fetchSubmodules = false; 24 | sha256 = "sha256-U9wZ3sBJbsdjwfunz7rN3YPDKefvRrkdrKGuAXs6WjQ="; 25 | }; 26 | date = "2025-04-14"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /templates/chisel/nix/dependencies/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | callPackage, 4 | newScope, 5 | writeShellApplication, 6 | runCommand, 7 | publishMillJar, 8 | git, 9 | mill, 10 | mill-ivy-fetcher, 11 | mlir-install, 12 | circt-install, 13 | jextract-21, 14 | ... 15 | }: 16 | let 17 | dependencies = callPackage ./_sources/generated.nix { }; 18 | in 19 | lib.makeScope newScope (scope: { 20 | ivy-chisel = publishMillJar { 21 | name = "chisel-snapshot"; 22 | src = dependencies.chisel.src; 23 | 24 | lockFile = ./locks/chisel-lock.nix; 25 | 26 | publishTargets = [ 27 | "unipublish" 28 | ]; 29 | 30 | nativeBuildInputs = [ 31 | # chisel requires git to generate version 32 | git 33 | ]; 34 | 35 | passthru.bump = writeShellApplication { 36 | name = "bump-chisel-mill-lock"; 37 | 38 | runtimeInputs = [ 39 | mill 40 | mill-ivy-fetcher 41 | ]; 42 | 43 | text = '' 44 | mif run -p "${dependencies.chisel.src}" -o ./nix/dependencies/locks/chisel-lock.nix "$@" 45 | ''; 46 | }; 47 | }; 48 | 49 | ivy-omlib = publishMillJar { 50 | name = "omlib-snapshot"; 51 | src = dependencies.zaozi.src; 52 | 53 | publishTargets = [ 54 | "mlirlib" 55 | "circtlib" 56 | "omlib" 57 | ]; 58 | 59 | env = { 60 | CIRCT_INSTALL_PATH = circt-install; 61 | MLIR_INSTALL_PATH = mlir-install; 62 | JEXTRACT_INSTALL_PATH = jextract-21; 63 | }; 64 | 65 | lockFile = ./locks/zaozi-lock.nix; 66 | 67 | passthru.bump = writeShellApplication { 68 | name = "bump-zaozi-mill-lock"; 69 | 70 | runtimeInputs = [ 71 | mill 72 | mill-ivy-fetcher 73 | ]; 74 | 75 | text = '' 76 | mif run -p "${dependencies.zaozi.src}" -o ./nix/dependencies/locks/zaozi-lock.nix "$@" 77 | ''; 78 | }; 79 | 80 | nativeBuildInputs = [ git ]; 81 | }; 82 | 83 | ivyLocalRepo = 84 | runCommand "build-coursier-env" 85 | { 86 | buildInputs = with scope; [ 87 | ivy-chisel.setupHook 88 | ivy-omlib.setupHook 89 | ]; 90 | } 91 | '' 92 | runHook preUnpack 93 | runHook postUnpack 94 | cp -r "$NIX_COURSIER_DIR" "$out" 95 | ''; 96 | }) 97 | -------------------------------------------------------------------------------- /templates/chisel/nix/dependencies/locks/gcd-lock.nix: -------------------------------------------------------------------------------- 1 | { fetchurl }: 2 | let 3 | fetchMaven = 4 | { 5 | name, 6 | urls, 7 | hash, 8 | installPath, 9 | }: 10 | with builtins; 11 | let 12 | firstUrl = head urls; 13 | otherUrls = filter (elem: elem != firstUrl) urls; 14 | in 15 | fetchurl { 16 | inherit name hash; 17 | passthru = { inherit installPath; }; 18 | url = firstUrl; 19 | recursiveHash = true; 20 | downloadToTemp = true; 21 | postFetch = 22 | '' 23 | mkdir -p "$out" 24 | cp -v "$downloadedFile" "$out/${baseNameOf firstUrl}" 25 | '' 26 | + concatStringsSep "\n" ( 27 | map ( 28 | elem: 29 | let 30 | filename = baseNameOf elem; 31 | in 32 | '' 33 | downloadedFile=$TMPDIR/${filename} 34 | tryDownload ${elem} 35 | cp -v "$TMPDIR/${filename}" "$out/" 36 | '' 37 | ) otherUrls 38 | ); 39 | }; 40 | in 41 | { 42 | 43 | "com.eed3si9n_shaded-jawn-parser_2.13-1.3.2" = fetchMaven { 44 | name = "com.eed3si9n_shaded-jawn-parser_2.13-1.3.2"; 45 | urls = [ 46 | "https://repo1.maven.org/maven2/com/eed3si9n/shaded-jawn-parser_2.13/1.3.2/shaded-jawn-parser_2.13-1.3.2.jar" 47 | "https://repo1.maven.org/maven2/com/eed3si9n/shaded-jawn-parser_2.13/1.3.2/shaded-jawn-parser_2.13-1.3.2.pom" 48 | ]; 49 | hash = "sha256-k0UsS5J5CXho/H4FngEcxAkNJ2ZjpecqDmKBvxIMuBs="; 50 | installPath = "https/repo1.maven.org/maven2/com/eed3si9n/shaded-jawn-parser_2.13/1.3.2"; 51 | }; 52 | 53 | "com.eed3si9n_shaded-scalajson_2.13-1.0.0-M4" = fetchMaven { 54 | name = "com.eed3si9n_shaded-scalajson_2.13-1.0.0-M4"; 55 | urls = [ 56 | "https://repo1.maven.org/maven2/com/eed3si9n/shaded-scalajson_2.13/1.0.0-M4/shaded-scalajson_2.13-1.0.0-M4.jar" 57 | "https://repo1.maven.org/maven2/com/eed3si9n/shaded-scalajson_2.13/1.0.0-M4/shaded-scalajson_2.13-1.0.0-M4.pom" 58 | ]; 59 | hash = "sha256-JyvPek41KleFIS5g4bqLm+qUw5FlX51/rnvv/BT2pk0="; 60 | installPath = "https/repo1.maven.org/maven2/com/eed3si9n/shaded-scalajson_2.13/1.0.0-M4"; 61 | }; 62 | 63 | "com.eed3si9n_sjson-new-core_2.13-0.10.1" = fetchMaven { 64 | name = "com.eed3si9n_sjson-new-core_2.13-0.10.1"; 65 | urls = [ 66 | "https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.13/0.10.1/sjson-new-core_2.13-0.10.1.jar" 67 | "https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.13/0.10.1/sjson-new-core_2.13-0.10.1.pom" 68 | ]; 69 | hash = "sha256-sFHoDAQBTHju2EgUOPuO9tM/SLAdb8X/oNSnar0iYoQ="; 70 | installPath = "https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.13/0.10.1"; 71 | }; 72 | 73 | "com.eed3si9n_sjson-new-core_2.13-0.9.0" = fetchMaven { 74 | name = "com.eed3si9n_sjson-new-core_2.13-0.9.0"; 75 | urls = [ 76 | "https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.13/0.9.0/sjson-new-core_2.13-0.9.0.pom" 77 | ]; 78 | hash = "sha256-WlJsXRKj77jzoFN6d1V/+jAEl37mxggg85F3o8oD+bY="; 79 | installPath = "https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.13/0.9.0"; 80 | }; 81 | 82 | "com.eed3si9n_sjson-new-scalajson_2.13-0.10.1" = fetchMaven { 83 | name = "com.eed3si9n_sjson-new-scalajson_2.13-0.10.1"; 84 | urls = [ 85 | "https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.13/0.10.1/sjson-new-scalajson_2.13-0.10.1.jar" 86 | "https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.13/0.10.1/sjson-new-scalajson_2.13-0.10.1.pom" 87 | ]; 88 | hash = "sha256-DBGJ34c7lyt3m4o5ULwsRk1xPqtHHHKcNgU4nlO/dJY="; 89 | installPath = "https/repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.13/0.10.1"; 90 | }; 91 | 92 | "com.fasterxml_oss-parent-58" = fetchMaven { 93 | name = "com.fasterxml_oss-parent-58"; 94 | urls = [ "https://repo1.maven.org/maven2/com/fasterxml/oss-parent/58/oss-parent-58.pom" ]; 95 | hash = "sha256-wVCyn9u4Q5PMWSigrfRD2c90jacWbffIBxjXZq/VOSw="; 96 | installPath = "https/repo1.maven.org/maven2/com/fasterxml/oss-parent/58"; 97 | }; 98 | 99 | "com.lihaoyi_fansi_2.13-0.5.0" = fetchMaven { 100 | name = "com.lihaoyi_fansi_2.13-0.5.0"; 101 | urls = [ 102 | "https://repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0/fansi_2.13-0.5.0.jar" 103 | "https://repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0/fansi_2.13-0.5.0.pom" 104 | ]; 105 | hash = "sha256-iRaKoBsS7VOiQA0yj/wRNKo2NCHWteW0gM99kKObdns="; 106 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0"; 107 | }; 108 | 109 | "com.lihaoyi_geny_2.13-1.1.0" = fetchMaven { 110 | name = "com.lihaoyi_geny_2.13-1.1.0"; 111 | urls = [ 112 | "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.0/geny_2.13-1.1.0.jar" 113 | "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.0/geny_2.13-1.1.0.pom" 114 | ]; 115 | hash = "sha256-z9oB4D+MOO9BqE/1pf/E4NGbxHTHsoS9N9TPW/7ofA4="; 116 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.0"; 117 | }; 118 | 119 | "com.lihaoyi_geny_2.13-1.1.1" = fetchMaven { 120 | name = "com.lihaoyi_geny_2.13-1.1.1"; 121 | urls = [ 122 | "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.1/geny_2.13-1.1.1.jar" 123 | "https://repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.1/geny_2.13-1.1.1.pom" 124 | ]; 125 | hash = "sha256-+gQ8X4oSRU30RdF5kE2Gn8nxmo3RJEShiEyyzUJd088="; 126 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.1.1"; 127 | }; 128 | 129 | "com.lihaoyi_mainargs_2.13-0.5.0" = fetchMaven { 130 | name = "com.lihaoyi_mainargs_2.13-0.5.0"; 131 | urls = [ 132 | "https://repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.5.0/mainargs_2.13-0.5.0.jar" 133 | "https://repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.5.0/mainargs_2.13-0.5.0.pom" 134 | ]; 135 | hash = "sha256-rDT0ViOnVDZHbqzjcW0vevSpdKzNjrBOAc9XPj5C3+s="; 136 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.5.0"; 137 | }; 138 | 139 | "com.lihaoyi_mainargs_2.13-0.7.6" = fetchMaven { 140 | name = "com.lihaoyi_mainargs_2.13-0.7.6"; 141 | urls = [ 142 | "https://repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.7.6/mainargs_2.13-0.7.6.jar" 143 | "https://repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.7.6/mainargs_2.13-0.7.6.pom" 144 | ]; 145 | hash = "sha256-3VNPfYCWjDt/Sln9JRJ3/aqxZT72ZqwdVdE7ONtpGXM="; 146 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.7.6"; 147 | }; 148 | 149 | "com.lihaoyi_mill-main-api_2.13-0.12.8-1-46e216" = fetchMaven { 150 | name = "com.lihaoyi_mill-main-api_2.13-0.12.8-1-46e216"; 151 | urls = [ 152 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-main-api_2.13/0.12.8-1-46e216/mill-main-api_2.13-0.12.8-1-46e216.jar" 153 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-main-api_2.13/0.12.8-1-46e216/mill-main-api_2.13-0.12.8-1-46e216.pom" 154 | ]; 155 | hash = "sha256-4uPDK4pTRGogIMWaYpRhWg+D8C2gDvaX88/x47X06Ls="; 156 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-main-api_2.13/0.12.8-1-46e216"; 157 | }; 158 | 159 | "com.lihaoyi_mill-main-client-0.12.8-1-46e216" = fetchMaven { 160 | name = "com.lihaoyi_mill-main-client-0.12.8-1-46e216"; 161 | urls = [ 162 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-main-client/0.12.8-1-46e216/mill-main-client-0.12.8-1-46e216.jar" 163 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-main-client/0.12.8-1-46e216/mill-main-client-0.12.8-1-46e216.pom" 164 | ]; 165 | hash = "sha256-YMhZ7tABUyMCFXru2tjJK9IA73Z11n5w/RH5r4ia3q8="; 166 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-main-client/0.12.8-1-46e216"; 167 | }; 168 | 169 | "com.lihaoyi_mill-moduledefs_2.13-0.11.2" = fetchMaven { 170 | name = "com.lihaoyi_mill-moduledefs_2.13-0.11.2"; 171 | urls = [ 172 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-moduledefs_2.13/0.11.2/mill-moduledefs_2.13-0.11.2.jar" 173 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-moduledefs_2.13/0.11.2/mill-moduledefs_2.13-0.11.2.pom" 174 | ]; 175 | hash = "sha256-aTQtCHGjdmdIWSZgyv6EllswGet1c2gKJ0nuGxu+TpA="; 176 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-moduledefs_2.13/0.11.2"; 177 | }; 178 | 179 | "com.lihaoyi_mill-runner-linenumbers_2.13-0.12.8-1-46e216" = fetchMaven { 180 | name = "com.lihaoyi_mill-runner-linenumbers_2.13-0.12.8-1-46e216"; 181 | urls = [ 182 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-runner-linenumbers_2.13/0.12.8-1-46e216/mill-runner-linenumbers_2.13-0.12.8-1-46e216.jar" 183 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-runner-linenumbers_2.13/0.12.8-1-46e216/mill-runner-linenumbers_2.13-0.12.8-1-46e216.pom" 184 | ]; 185 | hash = "sha256-87nmecp5r+JPxSGxJIQz0wLptyW3yTilDK4CQaQlcsY="; 186 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-runner-linenumbers_2.13/0.12.8-1-46e216"; 187 | }; 188 | 189 | "com.lihaoyi_mill-scala-compiler-bridge_2.13.15-0.0.1" = fetchMaven { 190 | name = "com.lihaoyi_mill-scala-compiler-bridge_2.13.15-0.0.1"; 191 | urls = [ 192 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scala-compiler-bridge_2.13.15/0.0.1/mill-scala-compiler-bridge_2.13.15-0.0.1.jar" 193 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scala-compiler-bridge_2.13.15/0.0.1/mill-scala-compiler-bridge_2.13.15-0.0.1.pom" 194 | ]; 195 | hash = "sha256-uTyXjgTJGlaKl8jCUp9A6uDdma97ixL65GNVD9l9oOw="; 196 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-scala-compiler-bridge_2.13.15/0.0.1"; 197 | }; 198 | 199 | "com.lihaoyi_mill-scalalib-api_2.13-0.12.8-1-46e216" = fetchMaven { 200 | name = "com.lihaoyi_mill-scalalib-api_2.13-0.12.8-1-46e216"; 201 | urls = [ 202 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-api_2.13/0.12.8-1-46e216/mill-scalalib-api_2.13-0.12.8-1-46e216.jar" 203 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-api_2.13/0.12.8-1-46e216/mill-scalalib-api_2.13-0.12.8-1-46e216.pom" 204 | ]; 205 | hash = "sha256-8xD1JkQ+PyCOCEYO/mlpmkQ1PpqIRjHnlwjI46Q/TNY="; 206 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-api_2.13/0.12.8-1-46e216"; 207 | }; 208 | 209 | "com.lihaoyi_mill-scalalib-worker_2.13-0.12.8-1-46e216" = fetchMaven { 210 | name = "com.lihaoyi_mill-scalalib-worker_2.13-0.12.8-1-46e216"; 211 | urls = [ 212 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-worker_2.13/0.12.8-1-46e216/mill-scalalib-worker_2.13-0.12.8-1-46e216.jar" 213 | "https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-worker_2.13/0.12.8-1-46e216/mill-scalalib-worker_2.13-0.12.8-1-46e216.pom" 214 | ]; 215 | hash = "sha256-SJG7mGWhe+4a2xkmFWQqn/QUBb+RYMpSdB7b1jv7JQw="; 216 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-worker_2.13/0.12.8-1-46e216"; 217 | }; 218 | 219 | "com.lihaoyi_os-lib_2.13-0.10.0" = fetchMaven { 220 | name = "com.lihaoyi_os-lib_2.13-0.10.0"; 221 | urls = [ 222 | "https://repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.10.0/os-lib_2.13-0.10.0.jar" 223 | "https://repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.10.0/os-lib_2.13-0.10.0.pom" 224 | ]; 225 | hash = "sha256-QMLhQLNthyscyl83Zy+UB/mGwa+7JpM0upwj3oxg7Fw="; 226 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.10.0"; 227 | }; 228 | 229 | "com.lihaoyi_os-lib_2.13-0.11.4-M6" = fetchMaven { 230 | name = "com.lihaoyi_os-lib_2.13-0.11.4-M6"; 231 | urls = [ 232 | "https://repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.11.4-M6/os-lib_2.13-0.11.4-M6.jar" 233 | "https://repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.11.4-M6/os-lib_2.13-0.11.4-M6.pom" 234 | ]; 235 | hash = "sha256-Xfo/y+4tKe7wAUFY1nyyh9is8M0l4sYU4OnheEljEL8="; 236 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.11.4-M6"; 237 | }; 238 | 239 | "com.lihaoyi_pprint_2.13-0.9.0" = fetchMaven { 240 | name = "com.lihaoyi_pprint_2.13-0.9.0"; 241 | urls = [ 242 | "https://repo1.maven.org/maven2/com/lihaoyi/pprint_2.13/0.9.0/pprint_2.13-0.9.0.jar" 243 | "https://repo1.maven.org/maven2/com/lihaoyi/pprint_2.13/0.9.0/pprint_2.13-0.9.0.pom" 244 | ]; 245 | hash = "sha256-RUmk2jO7irTaoMYgRK6Ui/SeyLEFCAspCehIccoQoeE="; 246 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/pprint_2.13/0.9.0"; 247 | }; 248 | 249 | "com.lihaoyi_scalac-mill-moduledefs-plugin_2.13.15-0.11.2" = fetchMaven { 250 | name = "com.lihaoyi_scalac-mill-moduledefs-plugin_2.13.15-0.11.2"; 251 | urls = [ 252 | "https://repo1.maven.org/maven2/com/lihaoyi/scalac-mill-moduledefs-plugin_2.13.15/0.11.2/scalac-mill-moduledefs-plugin_2.13.15-0.11.2.jar" 253 | "https://repo1.maven.org/maven2/com/lihaoyi/scalac-mill-moduledefs-plugin_2.13.15/0.11.2/scalac-mill-moduledefs-plugin_2.13.15-0.11.2.pom" 254 | ]; 255 | hash = "sha256-l+0NBdEWKEMILT44bK6ohiaon09cQvORWtDrCjUkn0A="; 256 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/scalac-mill-moduledefs-plugin_2.13.15/0.11.2"; 257 | }; 258 | 259 | "com.lihaoyi_sourcecode_2.13-0.3.0" = fetchMaven { 260 | name = "com.lihaoyi_sourcecode_2.13-0.3.0"; 261 | urls = [ 262 | "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0/sourcecode_2.13-0.3.0.jar" 263 | "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0/sourcecode_2.13-0.3.0.pom" 264 | ]; 265 | hash = "sha256-Y+QhWVO6t2oYpWS/s2aG1fHO+QZ726LyJYaGh3SL4ko="; 266 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0"; 267 | }; 268 | 269 | "com.lihaoyi_sourcecode_2.13-0.4.0" = fetchMaven { 270 | name = "com.lihaoyi_sourcecode_2.13-0.4.0"; 271 | urls = [ 272 | "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.0/sourcecode_2.13-0.4.0.jar" 273 | "https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.0/sourcecode_2.13-0.4.0.pom" 274 | ]; 275 | hash = "sha256-pi/E3F43hJcUYTx3hqUfOa/SGWmIcCl7z+3vCWDDrXc="; 276 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.0"; 277 | }; 278 | 279 | "com.lihaoyi_ujson_2.13-3.3.1" = fetchMaven { 280 | name = "com.lihaoyi_ujson_2.13-3.3.1"; 281 | urls = [ 282 | "https://repo1.maven.org/maven2/com/lihaoyi/ujson_2.13/3.3.1/ujson_2.13-3.3.1.jar" 283 | "https://repo1.maven.org/maven2/com/lihaoyi/ujson_2.13/3.3.1/ujson_2.13-3.3.1.pom" 284 | ]; 285 | hash = "sha256-tS5BVFeMdRfzGHUlrAywtQb4mG6oel56ooMEtlsWGjI="; 286 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/ujson_2.13/3.3.1"; 287 | }; 288 | 289 | "com.lihaoyi_upack_2.13-3.3.1" = fetchMaven { 290 | name = "com.lihaoyi_upack_2.13-3.3.1"; 291 | urls = [ 292 | "https://repo1.maven.org/maven2/com/lihaoyi/upack_2.13/3.3.1/upack_2.13-3.3.1.jar" 293 | "https://repo1.maven.org/maven2/com/lihaoyi/upack_2.13/3.3.1/upack_2.13-3.3.1.pom" 294 | ]; 295 | hash = "sha256-rbWiMl6+OXfWP2HjpMbvkToBzWhuW2hsJD/4dd+XmOs="; 296 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/upack_2.13/3.3.1"; 297 | }; 298 | 299 | "com.lihaoyi_upickle-core_2.13-3.3.1" = fetchMaven { 300 | name = "com.lihaoyi_upickle-core_2.13-3.3.1"; 301 | urls = [ 302 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle-core_2.13/3.3.1/upickle-core_2.13-3.3.1.jar" 303 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle-core_2.13/3.3.1/upickle-core_2.13-3.3.1.pom" 304 | ]; 305 | hash = "sha256-+vXjTD3FY+FMlDpvsOkhwycDbvhnIY0SOcHKOYc+StM="; 306 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/upickle-core_2.13/3.3.1"; 307 | }; 308 | 309 | "com.lihaoyi_upickle-implicits_2.13-3.3.1" = fetchMaven { 310 | name = "com.lihaoyi_upickle-implicits_2.13-3.3.1"; 311 | urls = [ 312 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle-implicits_2.13/3.3.1/upickle-implicits_2.13-3.3.1.jar" 313 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle-implicits_2.13/3.3.1/upickle-implicits_2.13-3.3.1.pom" 314 | ]; 315 | hash = "sha256-LKWPAok7DL+YyfLv6yTwuyAG8z/74mzMrsqgUvUw9bM="; 316 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/upickle-implicits_2.13/3.3.1"; 317 | }; 318 | 319 | "com.lihaoyi_upickle_2.13-3.3.1" = fetchMaven { 320 | name = "com.lihaoyi_upickle_2.13-3.3.1"; 321 | urls = [ 322 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle_2.13/3.3.1/upickle_2.13-3.3.1.jar" 323 | "https://repo1.maven.org/maven2/com/lihaoyi/upickle_2.13/3.3.1/upickle_2.13-3.3.1.pom" 324 | ]; 325 | hash = "sha256-1vHU3mGQey3zvyUHK9uCx+9pUnpnWe3zEMlyb8QqUFc="; 326 | installPath = "https/repo1.maven.org/maven2/com/lihaoyi/upickle_2.13/3.3.1"; 327 | }; 328 | 329 | "com.lmax_disruptor-3.4.2" = fetchMaven { 330 | name = "com.lmax_disruptor-3.4.2"; 331 | urls = [ 332 | "https://repo1.maven.org/maven2/com/lmax/disruptor/3.4.2/disruptor-3.4.2.jar" 333 | "https://repo1.maven.org/maven2/com/lmax/disruptor/3.4.2/disruptor-3.4.2.pom" 334 | ]; 335 | hash = "sha256-nbZsn6zL8HaJOrkMiWwvCuHQumcNQYA8e6QrAjXKKKg="; 336 | installPath = "https/repo1.maven.org/maven2/com/lmax/disruptor/3.4.2"; 337 | }; 338 | 339 | "com.swoval_file-tree-views-2.1.12" = fetchMaven { 340 | name = "com.swoval_file-tree-views-2.1.12"; 341 | urls = [ 342 | "https://repo1.maven.org/maven2/com/swoval/file-tree-views/2.1.12/file-tree-views-2.1.12.jar" 343 | "https://repo1.maven.org/maven2/com/swoval/file-tree-views/2.1.12/file-tree-views-2.1.12.pom" 344 | ]; 345 | hash = "sha256-QhJJFQt5LS2THa8AyPLrj0suht4eCiAEl2sf7QsZU3I="; 346 | installPath = "https/repo1.maven.org/maven2/com/swoval/file-tree-views/2.1.12"; 347 | }; 348 | 349 | "jakarta.platform_jakarta.jakartaee-bom-9.1.0" = fetchMaven { 350 | name = "jakarta.platform_jakarta.jakartaee-bom-9.1.0"; 351 | urls = [ 352 | "https://repo1.maven.org/maven2/jakarta/platform/jakarta.jakartaee-bom/9.1.0/jakarta.jakartaee-bom-9.1.0.pom" 353 | ]; 354 | hash = "sha256-kstGe15Yw9oF6LQ3Vovx1PcCUfQtNaEM7T8E5Upp1gg="; 355 | installPath = "https/repo1.maven.org/maven2/jakarta/platform/jakarta.jakartaee-bom/9.1.0"; 356 | }; 357 | 358 | "jakarta.platform_jakartaee-api-parent-9.1.0" = fetchMaven { 359 | name = "jakarta.platform_jakartaee-api-parent-9.1.0"; 360 | urls = [ 361 | "https://repo1.maven.org/maven2/jakarta/platform/jakartaee-api-parent/9.1.0/jakartaee-api-parent-9.1.0.pom" 362 | ]; 363 | hash = "sha256-FrD7N30UkkRSQtD3+FPOC1fH2qrNnJw6UZQ/hNFXWrA="; 364 | installPath = "https/repo1.maven.org/maven2/jakarta/platform/jakartaee-api-parent/9.1.0"; 365 | }; 366 | 367 | "net.openhft_java-parent-pom-1.1.28" = fetchMaven { 368 | name = "net.openhft_java-parent-pom-1.1.28"; 369 | urls = [ 370 | "https://repo1.maven.org/maven2/net/openhft/java-parent-pom/1.1.28/java-parent-pom-1.1.28.pom" 371 | ]; 372 | hash = "sha256-d7bOKP/hHJElmDQtIbblYDHRc8LCpqkt5Zl8aHp7l88="; 373 | installPath = "https/repo1.maven.org/maven2/net/openhft/java-parent-pom/1.1.28"; 374 | }; 375 | 376 | "net.openhft_root-parent-pom-1.2.12" = fetchMaven { 377 | name = "net.openhft_root-parent-pom-1.2.12"; 378 | urls = [ 379 | "https://repo1.maven.org/maven2/net/openhft/root-parent-pom/1.2.12/root-parent-pom-1.2.12.pom" 380 | ]; 381 | hash = "sha256-D/M1qN+njmMZWqS5h27fl83Q+zWgIFjaYQkCpD2Oy/M="; 382 | installPath = "https/repo1.maven.org/maven2/net/openhft/root-parent-pom/1.2.12"; 383 | }; 384 | 385 | "net.openhft_zero-allocation-hashing-0.16" = fetchMaven { 386 | name = "net.openhft_zero-allocation-hashing-0.16"; 387 | urls = [ 388 | "https://repo1.maven.org/maven2/net/openhft/zero-allocation-hashing/0.16/zero-allocation-hashing-0.16.jar" 389 | "https://repo1.maven.org/maven2/net/openhft/zero-allocation-hashing/0.16/zero-allocation-hashing-0.16.pom" 390 | ]; 391 | hash = "sha256-QkNOGkyP/OFWM+pv40hqR+ii4GBAcv0bbIrpG66YDMo="; 392 | installPath = "https/repo1.maven.org/maven2/net/openhft/zero-allocation-hashing/0.16"; 393 | }; 394 | 395 | "org.apache_apache-33" = fetchMaven { 396 | name = "org.apache_apache-33"; 397 | urls = [ "https://repo1.maven.org/maven2/org/apache/apache/33/apache-33.pom" ]; 398 | hash = "sha256-Hwj0S/ETiRxq9ObIzy9OGjGShFgbWuJOEoV6skSMQzI="; 399 | installPath = "https/repo1.maven.org/maven2/org/apache/apache/33"; 400 | }; 401 | 402 | "org.chipsalliance_firtool-resolver_2.13-2.0.1" = fetchMaven { 403 | name = "org.chipsalliance_firtool-resolver_2.13-2.0.1"; 404 | urls = [ 405 | "https://repo1.maven.org/maven2/org/chipsalliance/firtool-resolver_2.13/2.0.1/firtool-resolver_2.13-2.0.1.jar" 406 | "https://repo1.maven.org/maven2/org/chipsalliance/firtool-resolver_2.13/2.0.1/firtool-resolver_2.13-2.0.1.pom" 407 | ]; 408 | hash = "sha256-CGJ1TtugVYKbdzR1NWZunPLyxQRgKZPGQPWhTOGOeHI="; 409 | installPath = "https/repo1.maven.org/maven2/org/chipsalliance/firtool-resolver_2.13/2.0.1"; 410 | }; 411 | 412 | "org.fusesource_fusesource-pom-1.12" = fetchMaven { 413 | name = "org.fusesource_fusesource-pom-1.12"; 414 | urls = [ 415 | "https://repo1.maven.org/maven2/org/fusesource/fusesource-pom/1.12/fusesource-pom-1.12.pom" 416 | ]; 417 | hash = "sha256-NUD5PZ1FYYOq8yumvT5i29Vxd2ZCI6PXImXfLe4mE30="; 418 | installPath = "https/repo1.maven.org/maven2/org/fusesource/fusesource-pom/1.12"; 419 | }; 420 | 421 | "org.jline_jline-3.26.3" = fetchMaven { 422 | name = "org.jline_jline-3.26.3"; 423 | urls = [ 424 | "https://repo1.maven.org/maven2/org/jline/jline/3.26.3/jline-3.26.3.jar" 425 | "https://repo1.maven.org/maven2/org/jline/jline/3.26.3/jline-3.26.3.pom" 426 | ]; 427 | hash = "sha256-CVg5HR6GRYVCZ+0Y3yMsCUlgFCzd7MhgMqaZIQZEus0="; 428 | installPath = "https/repo1.maven.org/maven2/org/jline/jline/3.26.3"; 429 | }; 430 | 431 | "org.jline_jline-3.27.1" = fetchMaven { 432 | name = "org.jline_jline-3.27.1"; 433 | urls = [ 434 | "https://repo1.maven.org/maven2/org/jline/jline/3.27.1/jline-3.27.1-jdk8.jar" 435 | "https://repo1.maven.org/maven2/org/jline/jline/3.27.1/jline-3.27.1.pom" 436 | ]; 437 | hash = "sha256-GnI5uLuXJN7AvsltUpzwzGNuFYkfSQ4mxy4XLOODsmU="; 438 | installPath = "https/repo1.maven.org/maven2/org/jline/jline/3.27.1"; 439 | }; 440 | 441 | "org.jline_jline-native-3.27.1" = fetchMaven { 442 | name = "org.jline_jline-native-3.27.1"; 443 | urls = [ 444 | "https://repo1.maven.org/maven2/org/jline/jline-native/3.27.1/jline-native-3.27.1.jar" 445 | "https://repo1.maven.org/maven2/org/jline/jline-native/3.27.1/jline-native-3.27.1.pom" 446 | ]; 447 | hash = "sha256-XyhCZMcwu/OXdQ8BTM+qGgjGzMano5DJoghn1+/yr+Q="; 448 | installPath = "https/repo1.maven.org/maven2/org/jline/jline-native/3.27.1"; 449 | }; 450 | 451 | "org.jline_jline-parent-3.27.1" = fetchMaven { 452 | name = "org.jline_jline-parent-3.27.1"; 453 | urls = [ "https://repo1.maven.org/maven2/org/jline/jline-parent/3.27.1/jline-parent-3.27.1.pom" ]; 454 | hash = "sha256-Oa5DgBvf5JwZH68PDIyNkEQtm7IL04ujoeniH6GZas8="; 455 | installPath = "https/repo1.maven.org/maven2/org/jline/jline-parent/3.27.1"; 456 | }; 457 | 458 | "org.jline_jline-terminal-3.27.1" = fetchMaven { 459 | name = "org.jline_jline-terminal-3.27.1"; 460 | urls = [ 461 | "https://repo1.maven.org/maven2/org/jline/jline-terminal/3.27.1/jline-terminal-3.27.1.jar" 462 | "https://repo1.maven.org/maven2/org/jline/jline-terminal/3.27.1/jline-terminal-3.27.1.pom" 463 | ]; 464 | hash = "sha256-WV77BAEncauTljUBrlYi9v3GxDDeskqQpHHD9Fdbqjw="; 465 | installPath = "https/repo1.maven.org/maven2/org/jline/jline-terminal/3.27.1"; 466 | }; 467 | 468 | "org.jline_jline-terminal-jni-3.27.1" = fetchMaven { 469 | name = "org.jline_jline-terminal-jni-3.27.1"; 470 | urls = [ 471 | "https://repo1.maven.org/maven2/org/jline/jline-terminal-jni/3.27.1/jline-terminal-jni-3.27.1.jar" 472 | "https://repo1.maven.org/maven2/org/jline/jline-terminal-jni/3.27.1/jline-terminal-jni-3.27.1.pom" 473 | ]; 474 | hash = "sha256-AWKC7imb/rnF39PAo3bVIW430zPkyj9WozKGkPlTTBE="; 475 | installPath = "https/repo1.maven.org/maven2/org/jline/jline-terminal-jni/3.27.1"; 476 | }; 477 | 478 | "org.json4s_json4s-ast_2.13-4.0.7" = fetchMaven { 479 | name = "org.json4s_json4s-ast_2.13-4.0.7"; 480 | urls = [ 481 | "https://repo1.maven.org/maven2/org/json4s/json4s-ast_2.13/4.0.7/json4s-ast_2.13-4.0.7.jar" 482 | "https://repo1.maven.org/maven2/org/json4s/json4s-ast_2.13/4.0.7/json4s-ast_2.13-4.0.7.pom" 483 | ]; 484 | hash = "sha256-krtrf0SfBd8Jn0JaAL0ocE/QOc3yt4HomZOCzaA3Zn8="; 485 | installPath = "https/repo1.maven.org/maven2/org/json4s/json4s-ast_2.13/4.0.7"; 486 | }; 487 | 488 | "org.json4s_json4s-core_2.13-4.0.7" = fetchMaven { 489 | name = "org.json4s_json4s-core_2.13-4.0.7"; 490 | urls = [ 491 | "https://repo1.maven.org/maven2/org/json4s/json4s-core_2.13/4.0.7/json4s-core_2.13-4.0.7.jar" 492 | "https://repo1.maven.org/maven2/org/json4s/json4s-core_2.13/4.0.7/json4s-core_2.13-4.0.7.pom" 493 | ]; 494 | hash = "sha256-Uk2Ars+BB+5lr+8ec0RtwtRsqfsVf1TyW2Z6YhK56Kw="; 495 | installPath = "https/repo1.maven.org/maven2/org/json4s/json4s-core_2.13/4.0.7"; 496 | }; 497 | 498 | "org.json4s_json4s-native-core_2.13-4.0.7" = fetchMaven { 499 | name = "org.json4s_json4s-native-core_2.13-4.0.7"; 500 | urls = [ 501 | "https://repo1.maven.org/maven2/org/json4s/json4s-native-core_2.13/4.0.7/json4s-native-core_2.13-4.0.7.jar" 502 | "https://repo1.maven.org/maven2/org/json4s/json4s-native-core_2.13/4.0.7/json4s-native-core_2.13-4.0.7.pom" 503 | ]; 504 | hash = "sha256-pHs9ANRm8I8p24Lq+aAufLHoCOF823qACydlsAPkpYk="; 505 | installPath = "https/repo1.maven.org/maven2/org/json4s/json4s-native-core_2.13/4.0.7"; 506 | }; 507 | 508 | "org.json4s_json4s-native_2.13-4.0.7" = fetchMaven { 509 | name = "org.json4s_json4s-native_2.13-4.0.7"; 510 | urls = [ 511 | "https://repo1.maven.org/maven2/org/json4s/json4s-native_2.13/4.0.7/json4s-native_2.13-4.0.7.jar" 512 | "https://repo1.maven.org/maven2/org/json4s/json4s-native_2.13/4.0.7/json4s-native_2.13-4.0.7.pom" 513 | ]; 514 | hash = "sha256-2CB0UN+Az/tda5vKKr8BvTZC+fehONFmB1V3liEcjpg="; 515 | installPath = "https/repo1.maven.org/maven2/org/json4s/json4s-native_2.13/4.0.7"; 516 | }; 517 | 518 | "org.json4s_json4s-scalap_2.13-4.0.7" = fetchMaven { 519 | name = "org.json4s_json4s-scalap_2.13-4.0.7"; 520 | urls = [ 521 | "https://repo1.maven.org/maven2/org/json4s/json4s-scalap_2.13/4.0.7/json4s-scalap_2.13-4.0.7.jar" 522 | "https://repo1.maven.org/maven2/org/json4s/json4s-scalap_2.13/4.0.7/json4s-scalap_2.13-4.0.7.pom" 523 | ]; 524 | hash = "sha256-lw8n76iJsJlcZ7yhphvKbccinZAg+XeEN/fPjh5G6ak="; 525 | installPath = "https/repo1.maven.org/maven2/org/json4s/json4s-scalap_2.13/4.0.7"; 526 | }; 527 | 528 | "org.junit_junit-bom-5.10.3" = fetchMaven { 529 | name = "org.junit_junit-bom-5.10.3"; 530 | urls = [ "https://repo1.maven.org/maven2/org/junit/junit-bom/5.10.3/junit-bom-5.10.3.pom" ]; 531 | hash = "sha256-V+Pp8ndKoaD1fkc4oK9oU0+rrJ5hFRyuVcUnD0LI2Fw="; 532 | installPath = "https/repo1.maven.org/maven2/org/junit/junit-bom/5.10.3"; 533 | }; 534 | 535 | "org.junit_junit-bom-5.11.0" = fetchMaven { 536 | name = "org.junit_junit-bom-5.11.0"; 537 | urls = [ "https://repo1.maven.org/maven2/org/junit/junit-bom/5.11.0/junit-bom-5.11.0.pom" ]; 538 | hash = "sha256-8Gnv8IxzEhI2ssVV5CpjvPEv7CDcoexu3wmHBi9ktkA="; 539 | installPath = "https/repo1.maven.org/maven2/org/junit/junit-bom/5.11.0"; 540 | }; 541 | 542 | "org.junit_junit-bom-5.11.2" = fetchMaven { 543 | name = "org.junit_junit-bom-5.11.2"; 544 | urls = [ "https://repo1.maven.org/maven2/org/junit/junit-bom/5.11.2/junit-bom-5.11.2.pom" ]; 545 | hash = "sha256-cGHayaCE9Q75/hyJE3iFhnmKFYtzLY/MLSHDid0QSHY="; 546 | installPath = "https/repo1.maven.org/maven2/org/junit/junit-bom/5.11.2"; 547 | }; 548 | 549 | "org.mockito_mockito-bom-4.11.0" = fetchMaven { 550 | name = "org.mockito_mockito-bom-4.11.0"; 551 | urls = [ "https://repo1.maven.org/maven2/org/mockito/mockito-bom/4.11.0/mockito-bom-4.11.0.pom" ]; 552 | hash = "sha256-jtuaGRrHXNkevtfBAzk3OA+n5RNtrDQ0MQSqSRxUIfc="; 553 | installPath = "https/repo1.maven.org/maven2/org/mockito/mockito-bom/4.11.0"; 554 | }; 555 | 556 | "org.scala-lang_scala-compiler-2.13.15" = fetchMaven { 557 | name = "org.scala-lang_scala-compiler-2.13.15"; 558 | urls = [ 559 | "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15.jar" 560 | "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15.pom" 561 | ]; 562 | hash = "sha256-kvqWoFLNy3LGIbD6l67f66OyJq/K2L4rTStLiDzIzm8="; 563 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15"; 564 | }; 565 | 566 | "org.scala-lang_scala-compiler-2.13.16" = fetchMaven { 567 | name = "org.scala-lang_scala-compiler-2.13.16"; 568 | urls = [ 569 | "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.16/scala-compiler-2.13.16.jar" 570 | "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.16/scala-compiler-2.13.16.pom" 571 | ]; 572 | hash = "sha256-uPxnpCaIbviBXMJjY9+MSQCPa6iqEx/zgtO926dxv+U="; 573 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.16"; 574 | }; 575 | 576 | "org.scala-lang_scala-library-2.13.15" = fetchMaven { 577 | name = "org.scala-lang_scala-library-2.13.15"; 578 | urls = [ 579 | "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.15/scala-library-2.13.15.jar" 580 | "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.15/scala-library-2.13.15.pom" 581 | ]; 582 | hash = "sha256-JnbDGZQKZZswRZuxauQywH/4rXzwzn++kMB4lw3OfPI="; 583 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.15"; 584 | }; 585 | 586 | "org.scala-lang_scala-library-2.13.16" = fetchMaven { 587 | name = "org.scala-lang_scala-library-2.13.16"; 588 | urls = [ 589 | "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.16/scala-library-2.13.16.jar" 590 | "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.16/scala-library-2.13.16.pom" 591 | ]; 592 | hash = "sha256-7/NvAxKKPtghJ/+pTNxvmIAiAdtQXRTUvDwGGXwpnpU="; 593 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.16"; 594 | }; 595 | 596 | "org.scala-lang_scala-reflect-2.13.15" = fetchMaven { 597 | name = "org.scala-lang_scala-reflect-2.13.15"; 598 | urls = [ 599 | "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.15/scala-reflect-2.13.15.jar" 600 | "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.15/scala-reflect-2.13.15.pom" 601 | ]; 602 | hash = "sha256-zmUU4hTEf5HC311UaNIHmzjSwWSbjXn6DyPP7ZzFy/8="; 603 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.15"; 604 | }; 605 | 606 | "org.scala-lang_scala-reflect-2.13.16" = fetchMaven { 607 | name = "org.scala-lang_scala-reflect-2.13.16"; 608 | urls = [ 609 | "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.16/scala-reflect-2.13.16.jar" 610 | "https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.16/scala-reflect-2.13.16.pom" 611 | ]; 612 | hash = "sha256-Y/cXrptUKnH51rsTo8reYZbqbrWuO+fohzQW3z9Nx90="; 613 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.16"; 614 | }; 615 | 616 | "org.scala-lang_scalap-2.13.15" = fetchMaven { 617 | name = "org.scala-lang_scalap-2.13.15"; 618 | urls = [ 619 | "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.13.15/scalap-2.13.15.jar" 620 | "https://repo1.maven.org/maven2/org/scala-lang/scalap/2.13.15/scalap-2.13.15.pom" 621 | ]; 622 | hash = "sha256-JMnmdCcFUakGj+seqTp15VYMzcq90jGjQPmKbCzY28A="; 623 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/scalap/2.13.15"; 624 | }; 625 | 626 | "org.scala-sbt_collections_2.13-1.10.7" = fetchMaven { 627 | name = "org.scala-sbt_collections_2.13-1.10.7"; 628 | urls = [ 629 | "https://repo1.maven.org/maven2/org/scala-sbt/collections_2.13/1.10.7/collections_2.13-1.10.7.jar" 630 | "https://repo1.maven.org/maven2/org/scala-sbt/collections_2.13/1.10.7/collections_2.13-1.10.7.pom" 631 | ]; 632 | hash = "sha256-y4FuwehuxB+70YBIKj5jH9L8tQpHrWFpPc9VrBUzM6Y="; 633 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/collections_2.13/1.10.7"; 634 | }; 635 | 636 | "org.scala-sbt_compiler-bridge_2.13-1.10.7" = fetchMaven { 637 | name = "org.scala-sbt_compiler-bridge_2.13-1.10.7"; 638 | urls = [ 639 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.7/compiler-bridge_2.13-1.10.7-sources.jar" 640 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.7/compiler-bridge_2.13-1.10.7.jar" 641 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.7/compiler-bridge_2.13-1.10.7.pom" 642 | ]; 643 | hash = "sha256-jDtX3vTy7c5Ju7Yk792idscpXxfzqyRm0tubEazpQSY="; 644 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.7"; 645 | }; 646 | 647 | "org.scala-sbt_compiler-interface-1.10.3" = fetchMaven { 648 | name = "org.scala-sbt_compiler-interface-1.10.3"; 649 | urls = [ 650 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.3/compiler-interface-1.10.3.jar" 651 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.3/compiler-interface-1.10.3.pom" 652 | ]; 653 | hash = "sha256-eUpVhTZhe/6qSWs+XkD7bDhrqCv893HCNme7G4yPyeg="; 654 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.3"; 655 | }; 656 | 657 | "org.scala-sbt_compiler-interface-1.10.7" = fetchMaven { 658 | name = "org.scala-sbt_compiler-interface-1.10.7"; 659 | urls = [ 660 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.7/compiler-interface-1.10.7-sources.jar" 661 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.7/compiler-interface-1.10.7.jar" 662 | "https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.7/compiler-interface-1.10.7.pom" 663 | ]; 664 | hash = "sha256-kTQDHARJUF88Se2cOxq+vFt6hIPCn2rSQyGr96AMZWQ="; 665 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.7"; 666 | }; 667 | 668 | "org.scala-sbt_core-macros_2.13-1.10.7" = fetchMaven { 669 | name = "org.scala-sbt_core-macros_2.13-1.10.7"; 670 | urls = [ 671 | "https://repo1.maven.org/maven2/org/scala-sbt/core-macros_2.13/1.10.7/core-macros_2.13-1.10.7.jar" 672 | "https://repo1.maven.org/maven2/org/scala-sbt/core-macros_2.13/1.10.7/core-macros_2.13-1.10.7.pom" 673 | ]; 674 | hash = "sha256-rsDP4K+yiTgLhmdDP7G5iL3i43v+Dwki9pKXPeWUp4c="; 675 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/core-macros_2.13/1.10.7"; 676 | }; 677 | 678 | "org.scala-sbt_io_2.13-1.10.3" = fetchMaven { 679 | name = "org.scala-sbt_io_2.13-1.10.3"; 680 | urls = [ 681 | "https://repo1.maven.org/maven2/org/scala-sbt/io_2.13/1.10.3/io_2.13-1.10.3.jar" 682 | "https://repo1.maven.org/maven2/org/scala-sbt/io_2.13/1.10.3/io_2.13-1.10.3.pom" 683 | ]; 684 | hash = "sha256-+v1VvZGVtuyxaFCTxa66IGrvdqCDSJXPBAtHwDmdNQI="; 685 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/io_2.13/1.10.3"; 686 | }; 687 | 688 | "org.scala-sbt_launcher-interface-1.4.4" = fetchMaven { 689 | name = "org.scala-sbt_launcher-interface-1.4.4"; 690 | urls = [ 691 | "https://repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.4.4/launcher-interface-1.4.4.jar" 692 | "https://repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.4.4/launcher-interface-1.4.4.pom" 693 | ]; 694 | hash = "sha256-HWiEWRS8Grm7uQME6o7FYZFhWvJgvrvyxKXMATB0Z7E="; 695 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.4.4"; 696 | }; 697 | 698 | "org.scala-sbt_sbinary_2.13-0.5.1" = fetchMaven { 699 | name = "org.scala-sbt_sbinary_2.13-0.5.1"; 700 | urls = [ 701 | "https://repo1.maven.org/maven2/org/scala-sbt/sbinary_2.13/0.5.1/sbinary_2.13-0.5.1.jar" 702 | "https://repo1.maven.org/maven2/org/scala-sbt/sbinary_2.13/0.5.1/sbinary_2.13-0.5.1.pom" 703 | ]; 704 | hash = "sha256-+TrjPjSy8WVXq3IYHkHHIzttvHQbgwMLkwwWBys/ryw="; 705 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/sbinary_2.13/0.5.1"; 706 | }; 707 | 708 | "org.scala-sbt_test-interface-1.0" = fetchMaven { 709 | name = "org.scala-sbt_test-interface-1.0"; 710 | urls = [ 711 | "https://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar" 712 | "https://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.pom" 713 | ]; 714 | hash = "sha256-Cc5Q+4mULLHRdw+7Wjx6spCLbKrckXHeNYjIibw4LWw="; 715 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0"; 716 | }; 717 | 718 | "org.scala-sbt_util-control_2.13-1.10.7" = fetchMaven { 719 | name = "org.scala-sbt_util-control_2.13-1.10.7"; 720 | urls = [ 721 | "https://repo1.maven.org/maven2/org/scala-sbt/util-control_2.13/1.10.7/util-control_2.13-1.10.7.jar" 722 | "https://repo1.maven.org/maven2/org/scala-sbt/util-control_2.13/1.10.7/util-control_2.13-1.10.7.pom" 723 | ]; 724 | hash = "sha256-CCG/nXpVyd7YrtCYr47tPYIQs/G6vzb/3fCyZ21drhM="; 725 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-control_2.13/1.10.7"; 726 | }; 727 | 728 | "org.scala-sbt_util-interface-1.10.3" = fetchMaven { 729 | name = "org.scala-sbt_util-interface-1.10.3"; 730 | urls = [ 731 | "https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.3/util-interface-1.10.3.jar" 732 | "https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.3/util-interface-1.10.3.pom" 733 | ]; 734 | hash = "sha256-uu+2jvXfm2FaHkvJb44uRGdelrtS9pLfolU977MMQj0="; 735 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.3"; 736 | }; 737 | 738 | "org.scala-sbt_util-interface-1.10.7" = fetchMaven { 739 | name = "org.scala-sbt_util-interface-1.10.7"; 740 | urls = [ 741 | "https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.7/util-interface-1.10.7-sources.jar" 742 | "https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.7/util-interface-1.10.7.jar" 743 | "https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.7/util-interface-1.10.7.pom" 744 | ]; 745 | hash = "sha256-k9TTANJrA3RAapizDe0pMLT/CkPCLweVuT8fuc40Re0="; 746 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.7"; 747 | }; 748 | 749 | "org.scala-sbt_util-logging_2.13-1.10.7" = fetchMaven { 750 | name = "org.scala-sbt_util-logging_2.13-1.10.7"; 751 | urls = [ 752 | "https://repo1.maven.org/maven2/org/scala-sbt/util-logging_2.13/1.10.7/util-logging_2.13-1.10.7.jar" 753 | "https://repo1.maven.org/maven2/org/scala-sbt/util-logging_2.13/1.10.7/util-logging_2.13-1.10.7.pom" 754 | ]; 755 | hash = "sha256-WfmccbZodef+h77nl7kEe6VxAsyzYlaHudZX0iyTRAs="; 756 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-logging_2.13/1.10.7"; 757 | }; 758 | 759 | "org.scala-sbt_util-position_2.13-1.10.7" = fetchMaven { 760 | name = "org.scala-sbt_util-position_2.13-1.10.7"; 761 | urls = [ 762 | "https://repo1.maven.org/maven2/org/scala-sbt/util-position_2.13/1.10.7/util-position_2.13-1.10.7.jar" 763 | "https://repo1.maven.org/maven2/org/scala-sbt/util-position_2.13/1.10.7/util-position_2.13-1.10.7.pom" 764 | ]; 765 | hash = "sha256-hhRemdHTn5rI6IpViSG7KUxU/F2idL0AQf9CdNrF6xA="; 766 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-position_2.13/1.10.7"; 767 | }; 768 | 769 | "org.scala-sbt_util-relation_2.13-1.10.7" = fetchMaven { 770 | name = "org.scala-sbt_util-relation_2.13-1.10.7"; 771 | urls = [ 772 | "https://repo1.maven.org/maven2/org/scala-sbt/util-relation_2.13/1.10.7/util-relation_2.13-1.10.7.jar" 773 | "https://repo1.maven.org/maven2/org/scala-sbt/util-relation_2.13/1.10.7/util-relation_2.13-1.10.7.pom" 774 | ]; 775 | hash = "sha256-r2kRBeuvusfdZwqZsRRuwp1Sr1PjWDuchmXbVPcSUOM="; 776 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/util-relation_2.13/1.10.7"; 777 | }; 778 | 779 | "org.scala-sbt_zinc-apiinfo_2.13-1.10.7" = fetchMaven { 780 | name = "org.scala-sbt_zinc-apiinfo_2.13-1.10.7"; 781 | urls = [ 782 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-apiinfo_2.13/1.10.7/zinc-apiinfo_2.13-1.10.7.jar" 783 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-apiinfo_2.13/1.10.7/zinc-apiinfo_2.13-1.10.7.pom" 784 | ]; 785 | hash = "sha256-nRr38N6FO18MM0+mlb9lK2EOhfl7GZ1y7ez6Eg3Ip8w="; 786 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-apiinfo_2.13/1.10.7"; 787 | }; 788 | 789 | "org.scala-sbt_zinc-classfile_2.13-1.10.7" = fetchMaven { 790 | name = "org.scala-sbt_zinc-classfile_2.13-1.10.7"; 791 | urls = [ 792 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-classfile_2.13/1.10.7/zinc-classfile_2.13-1.10.7.jar" 793 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-classfile_2.13/1.10.7/zinc-classfile_2.13-1.10.7.pom" 794 | ]; 795 | hash = "sha256-0UOFRvovrzzXFILxniSzo5MHr/XmSDGP4o3wh05uCxE="; 796 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-classfile_2.13/1.10.7"; 797 | }; 798 | 799 | "org.scala-sbt_zinc-classpath_2.13-1.10.7" = fetchMaven { 800 | name = "org.scala-sbt_zinc-classpath_2.13-1.10.7"; 801 | urls = [ 802 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-classpath_2.13/1.10.7/zinc-classpath_2.13-1.10.7.jar" 803 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-classpath_2.13/1.10.7/zinc-classpath_2.13-1.10.7.pom" 804 | ]; 805 | hash = "sha256-ozsxGbCrycacvLvk8tf0SHjdR9DU+5+494IJdkotRjg="; 806 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-classpath_2.13/1.10.7"; 807 | }; 808 | 809 | "org.scala-sbt_zinc-compile-core_2.13-1.10.7" = fetchMaven { 810 | name = "org.scala-sbt_zinc-compile-core_2.13-1.10.7"; 811 | urls = [ 812 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-compile-core_2.13/1.10.7/zinc-compile-core_2.13-1.10.7.jar" 813 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-compile-core_2.13/1.10.7/zinc-compile-core_2.13-1.10.7.pom" 814 | ]; 815 | hash = "sha256-E7vR41TZnHQWM6FyVr48WDhplRHFfFta4E4JEl8/CtQ="; 816 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-compile-core_2.13/1.10.7"; 817 | }; 818 | 819 | "org.scala-sbt_zinc-core_2.13-1.10.7" = fetchMaven { 820 | name = "org.scala-sbt_zinc-core_2.13-1.10.7"; 821 | urls = [ 822 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-core_2.13/1.10.7/zinc-core_2.13-1.10.7.jar" 823 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-core_2.13/1.10.7/zinc-core_2.13-1.10.7.pom" 824 | ]; 825 | hash = "sha256-eQFUHHuNND26t29kyYz7vbAscVCJej/Lc8eQRktDTGA="; 826 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-core_2.13/1.10.7"; 827 | }; 828 | 829 | "org.scala-sbt_zinc-persist-core-assembly-1.10.7" = fetchMaven { 830 | name = "org.scala-sbt_zinc-persist-core-assembly-1.10.7"; 831 | urls = [ 832 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-persist-core-assembly/1.10.7/zinc-persist-core-assembly-1.10.7.jar" 833 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-persist-core-assembly/1.10.7/zinc-persist-core-assembly-1.10.7.pom" 834 | ]; 835 | hash = "sha256-KNr16Jjhbu3hrKUn/rTpEiEqWV/mC/iFhbO0YmToUCA="; 836 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-persist-core-assembly/1.10.7"; 837 | }; 838 | 839 | "org.scala-sbt_zinc-persist_2.13-1.10.7" = fetchMaven { 840 | name = "org.scala-sbt_zinc-persist_2.13-1.10.7"; 841 | urls = [ 842 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-persist_2.13/1.10.7/zinc-persist_2.13-1.10.7.jar" 843 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc-persist_2.13/1.10.7/zinc-persist_2.13-1.10.7.pom" 844 | ]; 845 | hash = "sha256-aO6mPsEjKHbl0ZqB/a/hZ/FArCqXpR63D8y86bxkwpU="; 846 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc-persist_2.13/1.10.7"; 847 | }; 848 | 849 | "org.scala-sbt_zinc_2.13-1.10.7" = fetchMaven { 850 | name = "org.scala-sbt_zinc_2.13-1.10.7"; 851 | urls = [ 852 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc_2.13/1.10.7/zinc_2.13-1.10.7.jar" 853 | "https://repo1.maven.org/maven2/org/scala-sbt/zinc_2.13/1.10.7/zinc_2.13-1.10.7.pom" 854 | ]; 855 | hash = "sha256-G87j0JvuTu7cEu4gUZ268vxJ79vs7qR0p8J1wT+wwD4="; 856 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/zinc_2.13/1.10.7"; 857 | }; 858 | 859 | "org.springframework_spring-framework-bom-5.3.39" = fetchMaven { 860 | name = "org.springframework_spring-framework-bom-5.3.39"; 861 | urls = [ 862 | "https://repo1.maven.org/maven2/org/springframework/spring-framework-bom/5.3.39/spring-framework-bom-5.3.39.pom" 863 | ]; 864 | hash = "sha256-V+sR9AvokPz2NrvEFCxdLHl3jrW2o9dP3gisCDAUUDA="; 865 | installPath = "https/repo1.maven.org/maven2/org/springframework/spring-framework-bom/5.3.39"; 866 | }; 867 | 868 | "com.fasterxml.jackson_jackson-bom-2.17.2" = fetchMaven { 869 | name = "com.fasterxml.jackson_jackson-bom-2.17.2"; 870 | urls = [ 871 | "https://repo1.maven.org/maven2/com/fasterxml/jackson/jackson-bom/2.17.2/jackson-bom-2.17.2.pom" 872 | ]; 873 | hash = "sha256-uAhCPZKxSJE8I5PhUlyXZOF9QVS/Xh+BQiYGmUYA86E="; 874 | installPath = "https/repo1.maven.org/maven2/com/fasterxml/jackson/jackson-bom/2.17.2"; 875 | }; 876 | 877 | "com.fasterxml.jackson_jackson-parent-2.17" = fetchMaven { 878 | name = "com.fasterxml.jackson_jackson-parent-2.17"; 879 | urls = [ 880 | "https://repo1.maven.org/maven2/com/fasterxml/jackson/jackson-parent/2.17/jackson-parent-2.17.pom" 881 | ]; 882 | hash = "sha256-bwpdlIPUrYpG6AmpG+vbSgz7gRpEaUy7i1k2ZxRlYGc="; 883 | installPath = "https/repo1.maven.org/maven2/com/fasterxml/jackson/jackson-parent/2.17"; 884 | }; 885 | 886 | "com.github.scopt_scopt_2.13-4.1.0" = fetchMaven { 887 | name = "com.github.scopt_scopt_2.13-4.1.0"; 888 | urls = [ 889 | "https://repo1.maven.org/maven2/com/github/scopt/scopt_2.13/4.1.0/scopt_2.13-4.1.0.jar" 890 | "https://repo1.maven.org/maven2/com/github/scopt/scopt_2.13/4.1.0/scopt_2.13-4.1.0.pom" 891 | ]; 892 | hash = "sha256-8vlB7LBM6HNfmGOrsljlfCJ0SbMMpqR2Kmo9QWAKzJ8="; 893 | installPath = "https/repo1.maven.org/maven2/com/github/scopt/scopt_2.13/4.1.0"; 894 | }; 895 | 896 | "com.thoughtworks.paranamer_paranamer-2.8" = fetchMaven { 897 | name = "com.thoughtworks.paranamer_paranamer-2.8"; 898 | urls = [ 899 | "https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.8/paranamer-2.8.jar" 900 | "https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.8/paranamer-2.8.pom" 901 | ]; 902 | hash = "sha256-ehB753YLCaI3R/EkbYk+Ev08o90TnNoC+uiJDOcm3Q8="; 903 | installPath = "https/repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.8"; 904 | }; 905 | 906 | "com.thoughtworks.paranamer_paranamer-parent-2.8" = fetchMaven { 907 | name = "com.thoughtworks.paranamer_paranamer-parent-2.8"; 908 | urls = [ 909 | "https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer-parent/2.8/paranamer-parent-2.8.pom" 910 | ]; 911 | hash = "sha256-+LBfeaWVmAiGP63PaqEd/M5Ks3RLQQyFanUgMAy8mkU="; 912 | installPath = "https/repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer-parent/2.8"; 913 | }; 914 | 915 | "io.github.alexarchambault_data-class_2.13-0.2.7" = fetchMaven { 916 | name = "io.github.alexarchambault_data-class_2.13-0.2.7"; 917 | urls = [ 918 | "https://repo1.maven.org/maven2/io/github/alexarchambault/data-class_2.13/0.2.7/data-class_2.13-0.2.7.jar" 919 | "https://repo1.maven.org/maven2/io/github/alexarchambault/data-class_2.13/0.2.7/data-class_2.13-0.2.7.pom" 920 | ]; 921 | hash = "sha256-PZ9by0bd2Rv4MWgWqJnmsVhQVLMaEOf7nmlfKB34JJs="; 922 | installPath = "https/repo1.maven.org/maven2/io/github/alexarchambault/data-class_2.13/0.2.7"; 923 | }; 924 | 925 | "io.github.java-diff-utils_java-diff-utils-4.12" = fetchMaven { 926 | name = "io.github.java-diff-utils_java-diff-utils-4.12"; 927 | urls = [ 928 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar" 929 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.pom" 930 | ]; 931 | hash = "sha256-SMNRfv+BvfxjgwFH0fHU16fd1bDn/QMrPQN8Eyb6deA="; 932 | installPath = "https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12"; 933 | }; 934 | 935 | "io.github.java-diff-utils_java-diff-utils-4.15" = fetchMaven { 936 | name = "io.github.java-diff-utils_java-diff-utils-4.15"; 937 | urls = [ 938 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.15/java-diff-utils-4.15.jar" 939 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.15/java-diff-utils-4.15.pom" 940 | ]; 941 | hash = "sha256-SfOhFqK/GsStfRZLQm3yGJat/CQWb3YbJnoXd84l/R0="; 942 | installPath = "https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.15"; 943 | }; 944 | 945 | "io.github.java-diff-utils_java-diff-utils-parent-4.12" = fetchMaven { 946 | name = "io.github.java-diff-utils_java-diff-utils-parent-4.12"; 947 | urls = [ 948 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils-parent/4.12/java-diff-utils-parent-4.12.pom" 949 | ]; 950 | hash = "sha256-l9MekOAkDQrHpgMMLkbZQJtiaSmyE7h0XneiHciAFOI="; 951 | installPath = "https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils-parent/4.12"; 952 | }; 953 | 954 | "io.github.java-diff-utils_java-diff-utils-parent-4.15" = fetchMaven { 955 | name = "io.github.java-diff-utils_java-diff-utils-parent-4.15"; 956 | urls = [ 957 | "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils-parent/4.15/java-diff-utils-parent-4.15.pom" 958 | ]; 959 | hash = "sha256-7U+fEo0qYFash7diRi0E8Ejv0MY8T70NzU+HswbmO34="; 960 | installPath = "https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils-parent/4.15"; 961 | }; 962 | 963 | "org.apache.commons_commons-lang3-3.17.0" = fetchMaven { 964 | name = "org.apache.commons_commons-lang3-3.17.0"; 965 | urls = [ 966 | "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.jar" 967 | "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.pom" 968 | ]; 969 | hash = "sha256-4R7rcq58WVs8WJr0JGIZkM43P3DmztsodHV7jK9v208="; 970 | installPath = "https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.17.0"; 971 | }; 972 | 973 | "org.apache.commons_commons-parent-73" = fetchMaven { 974 | name = "org.apache.commons_commons-parent-73"; 975 | urls = [ 976 | "https://repo1.maven.org/maven2/org/apache/commons/commons-parent/73/commons-parent-73.pom" 977 | ]; 978 | hash = "sha256-obPRPljEVPSQkbOlYYnlGJZ6+GcuuofouNFpVPt/R4g="; 979 | installPath = "https/repo1.maven.org/maven2/org/apache/commons/commons-parent/73"; 980 | }; 981 | 982 | "org.apache.commons_commons-parent-78" = fetchMaven { 983 | name = "org.apache.commons_commons-parent-78"; 984 | urls = [ 985 | "https://repo1.maven.org/maven2/org/apache/commons/commons-parent/78/commons-parent-78.pom" 986 | ]; 987 | hash = "sha256-0aJAoMZMen5VZmg8WT/tz9MMHFaXx6DgdiAVpYrCsac="; 988 | installPath = "https/repo1.maven.org/maven2/org/apache/commons/commons-parent/78"; 989 | }; 990 | 991 | "org.apache.commons_commons-text-1.13.0" = fetchMaven { 992 | name = "org.apache.commons_commons-text-1.13.0"; 993 | urls = [ 994 | "https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.13.0/commons-text-1.13.0.jar" 995 | "https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.13.0/commons-text-1.13.0.pom" 996 | ]; 997 | hash = "sha256-bmb1fpgZoCG1UTUFOyUm+wonq12KTLYmp/P9GqPatOM="; 998 | installPath = "https/repo1.maven.org/maven2/org/apache/commons/commons-text/1.13.0"; 999 | }; 1000 | 1001 | "org.apache.groovy_groovy-bom-4.0.22" = fetchMaven { 1002 | name = "org.apache.groovy_groovy-bom-4.0.22"; 1003 | urls = [ 1004 | "https://repo1.maven.org/maven2/org/apache/groovy/groovy-bom/4.0.22/groovy-bom-4.0.22.pom" 1005 | ]; 1006 | hash = "sha256-9hsejVx5kj/oQtf+JvuKqOuzRfJIJbPoys04ArDEu9o="; 1007 | installPath = "https/repo1.maven.org/maven2/org/apache/groovy/groovy-bom/4.0.22"; 1008 | }; 1009 | 1010 | "org.apache.logging_logging-parent-11.3.0" = fetchMaven { 1011 | name = "org.apache.logging_logging-parent-11.3.0"; 1012 | urls = [ 1013 | "https://repo1.maven.org/maven2/org/apache/logging/logging-parent/11.3.0/logging-parent-11.3.0.pom" 1014 | ]; 1015 | hash = "sha256-06rPgZ5cRXf8cg84KMl7HVR3vcgvV0ThY76UsgAFf+w="; 1016 | installPath = "https/repo1.maven.org/maven2/org/apache/logging/logging-parent/11.3.0"; 1017 | }; 1018 | 1019 | "org.eclipse.ee4j_project-1.0.7" = fetchMaven { 1020 | name = "org.eclipse.ee4j_project-1.0.7"; 1021 | urls = [ "https://repo1.maven.org/maven2/org/eclipse/ee4j/project/1.0.7/project-1.0.7.pom" ]; 1022 | hash = "sha256-1HxZiJ0aeo1n8AWjwGKEoPwVFP9kndMBye7xwgYEal8="; 1023 | installPath = "https/repo1.maven.org/maven2/org/eclipse/ee4j/project/1.0.7"; 1024 | }; 1025 | 1026 | "org.fusesource.jansi_jansi-2.4.1" = fetchMaven { 1027 | name = "org.fusesource.jansi_jansi-2.4.1"; 1028 | urls = [ 1029 | "https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/2.4.1/jansi-2.4.1.jar" 1030 | "https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/2.4.1/jansi-2.4.1.pom" 1031 | ]; 1032 | hash = "sha256-M9G+H9TA5eB6NwlBmDP0ghxZzjbvLimPXNRZHyxJXac="; 1033 | installPath = "https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/2.4.1"; 1034 | }; 1035 | 1036 | "org.scala-lang.modules_scala-collection-compat_2.13-2.11.0" = fetchMaven { 1037 | name = "org.scala-lang.modules_scala-collection-compat_2.13-2.11.0"; 1038 | urls = [ 1039 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.11.0/scala-collection-compat_2.13-2.11.0.jar" 1040 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.11.0/scala-collection-compat_2.13-2.11.0.pom" 1041 | ]; 1042 | hash = "sha256-++tF6j10SwWogS7WQJHMqj7uSzo7UVjub4dDQPdogPw="; 1043 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.11.0"; 1044 | }; 1045 | 1046 | "org.scala-lang.modules_scala-collection-compat_2.13-2.12.0" = fetchMaven { 1047 | name = "org.scala-lang.modules_scala-collection-compat_2.13-2.12.0"; 1048 | urls = [ 1049 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0/scala-collection-compat_2.13-2.12.0.jar" 1050 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0/scala-collection-compat_2.13-2.12.0.pom" 1051 | ]; 1052 | hash = "sha256-gdUFn7dadEj342MYKz1lj4dLYz+AkOzRiIC0spS8CXk="; 1053 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0"; 1054 | }; 1055 | 1056 | "org.scala-lang.modules_scala-collection-compat_2.13-2.8.1" = fetchMaven { 1057 | name = "org.scala-lang.modules_scala-collection-compat_2.13-2.8.1"; 1058 | urls = [ 1059 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.8.1/scala-collection-compat_2.13-2.8.1.pom" 1060 | ]; 1061 | hash = "sha256-dGa38lKrLlVNIoMC+hvyhNSihX7RTzNdwBHpatYRitQ="; 1062 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.8.1"; 1063 | }; 1064 | 1065 | "org.scala-lang.modules_scala-parallel-collections_2.13-0.2.0" = fetchMaven { 1066 | name = "org.scala-lang.modules_scala-parallel-collections_2.13-0.2.0"; 1067 | urls = [ 1068 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parallel-collections_2.13/0.2.0/scala-parallel-collections_2.13-0.2.0.jar" 1069 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parallel-collections_2.13/0.2.0/scala-parallel-collections_2.13-0.2.0.pom" 1070 | ]; 1071 | hash = "sha256-chqRhtzyMJjeR4ohA5YhNjGV8kLHTy5yZjNCyYIO/wo="; 1072 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parallel-collections_2.13/0.2.0"; 1073 | }; 1074 | 1075 | "org.scala-lang.modules_scala-parser-combinators_2.13-1.1.2" = fetchMaven { 1076 | name = "org.scala-lang.modules_scala-parser-combinators_2.13-1.1.2"; 1077 | urls = [ 1078 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.1.2/scala-parser-combinators_2.13-1.1.2.jar" 1079 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.1.2/scala-parser-combinators_2.13-1.1.2.pom" 1080 | ]; 1081 | hash = "sha256-sM5GWZ8/K1Jchj4V3FTvaWhfSJiHq0PKtQpd5W94Hps="; 1082 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.1.2"; 1083 | }; 1084 | 1085 | "org.scala-lang.modules_scala-xml_2.13-2.2.0" = fetchMaven { 1086 | name = "org.scala-lang.modules_scala-xml_2.13-2.2.0"; 1087 | urls = [ 1088 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.2.0/scala-xml_2.13-2.2.0.jar" 1089 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.2.0/scala-xml_2.13-2.2.0.pom" 1090 | ]; 1091 | hash = "sha256-Vy0piitgB2wPXiORd+dcBEZVcMZSjcbKJz4lNKZgeec="; 1092 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.2.0"; 1093 | }; 1094 | 1095 | "org.scala-lang.modules_scala-xml_2.13-2.3.0" = fetchMaven { 1096 | name = "org.scala-lang.modules_scala-xml_2.13-2.3.0"; 1097 | urls = [ 1098 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.3.0/scala-xml_2.13-2.3.0.jar" 1099 | "https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.3.0/scala-xml_2.13-2.3.0.pom" 1100 | ]; 1101 | hash = "sha256-TZaDZ9UjQB20IMvxqxub63LbqSNDMAhFDRtYfvbzI58="; 1102 | installPath = "https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.3.0"; 1103 | }; 1104 | 1105 | "org.scala-sbt.jline_jline-2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18" = fetchMaven { 1106 | name = "org.scala-sbt.jline_jline-2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18"; 1107 | urls = [ 1108 | "https://repo1.maven.org/maven2/org/scala-sbt/jline/jline/2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18/jline-2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18.jar" 1109 | "https://repo1.maven.org/maven2/org/scala-sbt/jline/jline/2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18/jline-2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18.pom" 1110 | ]; 1111 | hash = "sha256-1Nq7/UMXSlaZ7iwR1WMryltAmS8/fRCK6u93cm+1uh4="; 1112 | installPath = "https/repo1.maven.org/maven2/org/scala-sbt/jline/jline/2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18"; 1113 | }; 1114 | 1115 | "org.sonatype.oss_oss-parent-9" = fetchMaven { 1116 | name = "org.sonatype.oss_oss-parent-9"; 1117 | urls = [ "https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom" ]; 1118 | hash = "sha256-kJ3QfnDTAvamYaHQowpAKW1gPDFDXbiP2lNPzNllIWY="; 1119 | installPath = "https/repo1.maven.org/maven2/org/sonatype/oss/oss-parent/9"; 1120 | }; 1121 | 1122 | "net.java.dev.jna_jna-5.14.0" = fetchMaven { 1123 | name = "net.java.dev.jna_jna-5.14.0"; 1124 | urls = [ 1125 | "https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar" 1126 | "https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.pom" 1127 | ]; 1128 | hash = "sha256-mvzJykzd4Cz473vRi15E0NReFk7YN7hPOtS5ZHUhCIg="; 1129 | installPath = "https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0"; 1130 | }; 1131 | 1132 | "org.apache.logging.log4j_log4j-2.24.3" = fetchMaven { 1133 | name = "org.apache.logging.log4j_log4j-2.24.3"; 1134 | urls = [ "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j/2.24.3/log4j-2.24.3.pom" ]; 1135 | hash = "sha256-bWuk6kxsiWW675JezWblZ8RdkKFg9C/3CgzdMGJr1Z8="; 1136 | installPath = "https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j/2.24.3"; 1137 | }; 1138 | 1139 | "org.apache.logging.log4j_log4j-api-2.24.3" = fetchMaven { 1140 | name = "org.apache.logging.log4j_log4j-api-2.24.3"; 1141 | urls = [ 1142 | "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.24.3/log4j-api-2.24.3.jar" 1143 | "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.24.3/log4j-api-2.24.3.pom" 1144 | ]; 1145 | hash = "sha256-y6wgpqMFwL3B3CrUbTI4HQTBjc4YSWxn0WF8QQSjpFw="; 1146 | installPath = "https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.24.3"; 1147 | }; 1148 | 1149 | "org.apache.logging.log4j_log4j-bom-2.24.3" = fetchMaven { 1150 | name = "org.apache.logging.log4j_log4j-bom-2.24.3"; 1151 | urls = [ 1152 | "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-bom/2.24.3/log4j-bom-2.24.3.pom" 1153 | ]; 1154 | hash = "sha256-UNEo/UyoskA/8X62/rwMQObDQxfHDiJKj2pBP9SNoek="; 1155 | installPath = "https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-bom/2.24.3"; 1156 | }; 1157 | 1158 | "org.apache.logging.log4j_log4j-core-2.24.3" = fetchMaven { 1159 | name = "org.apache.logging.log4j_log4j-core-2.24.3"; 1160 | urls = [ 1161 | "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.24.3/log4j-core-2.24.3.jar" 1162 | "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.24.3/log4j-core-2.24.3.pom" 1163 | ]; 1164 | hash = "sha256-kRXpkDJtXT0VoEyxj5hIc8Z8foh8rKnFqCpjohdh5LQ="; 1165 | installPath = "https/repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.24.3"; 1166 | }; 1167 | 1168 | } 1169 | # Project Source Hash:sha256-rzudHXyNnQ//1SkKGbyKAujC6TjQm0Ih/fImD08AzhU= 1170 | -------------------------------------------------------------------------------- /templates/chisel/nix/dependencies/nvfetcher.toml: -------------------------------------------------------------------------------- 1 | [chisel] 2 | src.git = "https://github.com/chipsalliance/chisel" 3 | src.branch = "main" 4 | fetch.github = "chipsalliance/chisel" 5 | 6 | [zaozi] 7 | src.git = "https://github.com/sequencer/zaozi" 8 | src.branch = "master" 9 | fetch.github = "sequencer/zaozi" 10 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/default.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { lib, newScope }: 5 | lib.makeScope newScope ( 6 | scope: 7 | let 8 | designTarget = "GCD"; 9 | tbTarget = "GCDTestBench"; 10 | formalTarget = "GCDFormal"; 11 | dpiLibName = "gcdemu"; 12 | in 13 | { 14 | dependencies = scope.callPackage ../dependencies { }; 15 | 16 | # RTL 17 | gcd-compiled = scope.callPackage ./gcd.nix { target = designTarget; }; 18 | elaborate = scope.callPackage ./elaborate.nix { 19 | elaborator = scope.gcd-compiled.elaborator; 20 | }; 21 | mlirbc = scope.callPackage ./mlirbc.nix { }; 22 | rtl = scope.callPackage ./rtl.nix { }; 23 | 24 | # Testbench 25 | tb-compiled = scope.callPackage ./gcd.nix { target = tbTarget; }; 26 | tb-elaborate = scope.callPackage ./elaborate.nix { 27 | elaborator = scope.tb-compiled.elaborator; 28 | }; 29 | tb-mlirbc = scope.callPackage ./mlirbc.nix { elaborate = scope.tb-elaborate; }; 30 | tb-rtl = scope.callPackage ./rtl.nix { mlirbc = scope.tb-mlirbc; }; 31 | tb-dpi-lib = scope.callPackage ./dpi-lib.nix { inherit dpiLibName; }; 32 | 33 | verilated = scope.callPackage ./verilated.nix { 34 | rtl = scope.tb-rtl.override { enable-layers = [ "Verification" ]; }; 35 | dpi-lib = scope.tb-dpi-lib; 36 | }; 37 | verilated-trace = scope.verilated.override { 38 | dpi-lib = scope.verilated.dpi-lib.override { enable-trace = true; }; 39 | }; 40 | vcs = scope.callPackage ./vcs.nix { 41 | dpi-lib = scope.tb-dpi-lib.override { 42 | sv2023 = false; 43 | vpi = true; 44 | timescale = 1000; 45 | }; 46 | rtl = scope.tb-rtl.override { 47 | enable-layers = [ 48 | "Verification" 49 | "Verification.Assert" 50 | "Verification.Cover" 51 | ]; 52 | }; 53 | }; 54 | vcs-trace = scope.vcs.override { 55 | dpi-lib = scope.vcs.dpi-lib.override { enable-trace = true; }; 56 | }; 57 | 58 | # Formal 59 | formal-compiled = scope.callPackage ./gcd.nix { target = formalTarget; }; 60 | formal-elaborate = scope.callPackage ./elaborate.nix { 61 | elaborator = scope.formal-compiled.elaborator; 62 | }; 63 | formal-mlirbc = scope.callPackage ./mlirbc.nix { elaborate = scope.formal-elaborate; }; 64 | formal-rtl = scope.callPackage ./rtl.nix { 65 | mlirbc = scope.formal-mlirbc; 66 | enable-layers = [ 67 | "Verification" 68 | "Verification.Assume" 69 | "Verification.Assert" 70 | "Verification.Cover" 71 | ]; 72 | }; 73 | jg-fpv = scope.callPackage ./jg-fpv.nix { 74 | rtl = scope.formal-rtl; 75 | }; 76 | 77 | # TODO: designConfig should be read from OM 78 | tbConfig = with builtins; fromJSON (readFile ./../../configs/${tbTarget}.json); 79 | 80 | } 81 | ) 82 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/dpi-lib.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | lib, 6 | rustPlatform, 7 | tbConfig, 8 | dpiLibName, 9 | sv2023 ? true, 10 | vpi ? false, 11 | enable-trace ? false, 12 | timescale ? 1, 13 | }: 14 | 15 | rustPlatform.buildRustPackage rec { 16 | name = "dpi-lib"; 17 | src = ./../../${dpiLibName}; 18 | cargoLock = { 19 | lockFile = "${src}/Cargo.lock"; 20 | }; 21 | buildFeatures = 22 | lib.optionals sv2023 [ "sv2023" ] 23 | ++ lib.optionals vpi [ "vpi" ] 24 | ++ lib.optionals enable-trace [ "trace" ]; 25 | 26 | env = { 27 | DESIGN_DATA_WIDTH = tbConfig.gcdParameter.width; 28 | DESIGN_TIMEOUT = tbConfig.timeout; 29 | DESIGN_TEST_SIZE = tbConfig.testSize; 30 | CLOCK_FLIP_TIME = tbConfig.testVerbatimParameter.clockFlipTick * timescale; 31 | }; 32 | 33 | passthru = { 34 | inherit enable-trace; 35 | inherit env; 36 | libOutName = "lib${dpiLibName}.a"; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/elaborate.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | # TODO: in the future, we may need to add circtbindng pass and set it by default. 5 | { 6 | lib, 7 | stdenvNoCC, 8 | espresso, 9 | circt, 10 | elaborator, 11 | }: 12 | stdenvNoCC.mkDerivation { 13 | name = "${elaborator.name}-elaborate"; 14 | 15 | nativeBuildInputs = [ 16 | espresso 17 | circt 18 | ]; 19 | 20 | src = ./../../configs; 21 | passthru = { 22 | inherit elaborator; 23 | inherit (elaborator) target; 24 | }; 25 | 26 | buildCommand = '' 27 | mkdir -p elaborate $out 28 | 29 | ${elaborator}/bin/elaborator design --parameter $src/${elaborator.target}.json --target-dir elaborate 30 | 31 | firtool elaborate/*.fir \ 32 | --annotation-file elaborate/*.anno.json \ 33 | --emit-bytecode \ 34 | --parse-only \ 35 | -o $out/$name.mlirbc 36 | ''; 37 | } 38 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/gcd.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | lib, 6 | stdenv, 7 | makeWrapper, 8 | writeShellApplication, 9 | jdk21, 10 | git, 11 | 12 | # chisel deps 13 | mill, 14 | espresso, 15 | mlir-install, 16 | circt-install, 17 | jextract-21, 18 | add-determinism, 19 | 20 | dependencies, 21 | mill-ivy-fetcher, 22 | mill-ivy-env-shell-hook, 23 | ivy-gather, 24 | 25 | target, 26 | }: 27 | 28 | let 29 | gcdMillDeps = ivy-gather ../dependencies/locks/gcd-lock.nix; 30 | 31 | self = stdenv.mkDerivation rec { 32 | name = "gcd"; 33 | 34 | mainClass = "org.chipsalliance.gcd.elaborator.${target}Main"; 35 | 36 | src = 37 | with lib.fileset; 38 | toSource { 39 | root = ./../..; 40 | fileset = unions [ 41 | ./../../build.mill 42 | ./../../common.mill 43 | ./../../gcd 44 | ./../../elaborator 45 | ]; 46 | }; 47 | 48 | buildInputs = with dependencies; [ 49 | ivy-chisel.setupHook 50 | gcdMillDeps 51 | ]; 52 | 53 | nativeBuildInputs = with dependencies; [ 54 | makeWrapper 55 | 56 | mill 57 | circt-install 58 | jextract-21 59 | add-determinism 60 | espresso 61 | git 62 | ]; 63 | 64 | passthru = { 65 | bump = writeShellApplication { 66 | name = "bump-gcd-mill-lock"; 67 | runtimeInputs = [ 68 | mill 69 | mill-ivy-fetcher 70 | ]; 71 | text = '' 72 | ivyLocal="${dependencies.ivyLocalRepo}" 73 | export JAVA_TOOL_OPTIONS="''${JAVA_TOOL_OPTIONS:-} -Dcoursier.ivy.home=$ivyLocal -Divy.home=$ivyLocal" 74 | 75 | mif run -p "${src}" -o ./nix/dependencies/locks/gcd-lock.nix "$@" 76 | ''; 77 | }; 78 | inherit target; 79 | inherit env; 80 | }; 81 | 82 | shellHook = '' 83 | ${mill-ivy-env-shell-hook} 84 | 85 | mill -i mill.bsp.BSP/install 86 | ''; 87 | 88 | env = { 89 | CIRCT_INSTALL_PATH = circt-install; 90 | MLIR_INSTALL_PATH = mlir-install; 91 | JEXTRACT_INSTALL_PATH = jextract-21; 92 | }; 93 | 94 | outputs = [ 95 | "out" 96 | "elaborator" 97 | ]; 98 | 99 | meta.mainProgram = "elaborator"; 100 | 101 | buildPhase = '' 102 | mill -i '__.assembly' 103 | ''; 104 | 105 | installPhase = '' 106 | mkdir -p $out/share/java 107 | 108 | add-determinism -j $NIX_BUILD_CORES out/elaborator/assembly.dest/out.jar 109 | 110 | mv out/elaborator/assembly.dest/out.jar $out/share/java/elaborator.jar 111 | 112 | mkdir -p $elaborator/bin 113 | makeWrapper ${jdk21}/bin/java $elaborator/bin/elaborator \ 114 | --add-flags "--enable-preview -Djava.library.path=${mlir-install}/lib:${circt-install}/lib -cp $out/share/java/elaborator.jar ${mainClass}" 115 | ''; 116 | }; 117 | in 118 | self 119 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/jg-fpv.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | stdenvNoCC, 6 | rtl, 7 | cds-fhs-env, 8 | }: 9 | 10 | stdenvNoCC.mkDerivation { 11 | name = "jg-fpv"; 12 | 13 | # Add "sandbox = relaxed" into /etc/nix/nix.conf, and run `systemctl restart nix-daemon` 14 | # 15 | # run nix build with "--impure" flag to build this package without chroot 16 | # require license 17 | __noChroot = true; 18 | dontPatchELF = true; 19 | 20 | src = rtl; 21 | 22 | passthru = { 23 | inherit rtl; 24 | }; 25 | 26 | shellHook = '' 27 | echo "[nix] entering fhs env" 28 | ${cds-fhs-env}/bin/cds-fhs-env 29 | ''; 30 | 31 | buildPhase = '' 32 | runHook preBuild 33 | 34 | echo "[nix] running Jasper" 35 | fhsBash=${cds-fhs-env}/bin/cds-fhs-env 36 | "$fhsBash" -c "jg -batch ${./scripts/FPV.tcl}" 37 | 38 | runHook postBuild 39 | ''; 40 | 41 | installPhase = '' 42 | runHook preInstall 43 | 44 | mkdir -p $out 45 | 46 | cp report.txt $out 47 | cp failed_num $out 48 | cp -r jgproject $out 49 | 50 | runHook postInstall 51 | ''; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/mlirbc.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | stdenvNoCC, 6 | circt, 7 | elaborate, 8 | }: 9 | 10 | stdenvNoCC.mkDerivation { 11 | name = "${elaborate.name}-mlirbc"; 12 | 13 | nativeBuildInputs = [ circt ]; 14 | 15 | passthru = { 16 | inherit elaborate; 17 | inherit (elaborate) target; 18 | }; 19 | 20 | buildCommand = '' 21 | mkdir $out 22 | 23 | firtool ${elaborate}/${elaborate.name}.mlirbc \ 24 | --emit-bytecode \ 25 | -O=debug \ 26 | --preserve-values=named \ 27 | --lowering-options=verifLabels \ 28 | --output-final-mlir=$out/$name-lowered.mlirbc 29 | ''; 30 | } 31 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/rtl.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | lib, 6 | stdenvNoCC, 7 | circt, 8 | mlirbc, 9 | mfcArgs ? [ 10 | "-O=release" 11 | "--split-verilog" 12 | "--preserve-values=all" 13 | "--lowering-options=verifLabels,omitVersionComment" 14 | "--strip-debug-info" 15 | ], 16 | enable-layers ? [ ], 17 | }: 18 | let 19 | processLayer = lib.map (str: "./" + lib.replaceStrings [ "." ] [ "/" ] (lib.toLower str)); 20 | enableLayersDirs = processLayer enable-layers; 21 | in 22 | stdenvNoCC.mkDerivation { 23 | name = "${mlirbc.name}-rtl"; 24 | nativeBuildInputs = [ circt ]; 25 | 26 | passthru = { 27 | inherit mlirbc; 28 | inherit (mlirbc) target; 29 | }; 30 | 31 | buildCommand = '' 32 | mkdir -p $out 33 | 34 | firtool ${mlirbc}/${mlirbc.name}-lowered.mlirbc -o $out ${lib.escapeShellArgs mfcArgs} 35 | 36 | pushd $out 37 | find . ${lib.concatStringsSep " " enableLayersDirs} -maxdepth 1 -name "*.sv" -type f -print > ./filelist.f 38 | popd 39 | ''; 40 | } 41 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/scripts/FPV.tcl: -------------------------------------------------------------------------------- 1 | clear -all 2 | 3 | # Analyze source files and property files 4 | set fd [open ./filelist.f r] 5 | if {$fd < 0} { 6 | error "File open failed!" 7 | } 8 | set filelist [split [read $fd] "\n"] 9 | close $fd 10 | 11 | foreach file $filelist { 12 | if {[string length $file]} { 13 | analyze -sv12 \ $file 14 | } 15 | } 16 | 17 | # Elaborate design and properties 18 | elaborate 19 | 20 | # Set up Clocks and Resets 21 | clock clock 22 | reset reset 23 | 24 | # Get design information to check general complexity 25 | get_design_info 26 | 27 | # Prove properties 28 | # 1st pass: Quick validation of properties with default engines 29 | set_max_trace_length 100 30 | prove -all 31 | 32 | report -file report.txt 33 | 34 | set failed_properties [get_property_list -include {status {cex unreachable}}] 35 | set length [llength $failed_properties] 36 | if { $length > 0 } { 37 | puts "There are $length failed properties!" 38 | } else { 39 | puts "All properties passed!" 40 | } 41 | set failed_num [open failed_num w] 42 | puts $failed_num "$length" 43 | close $failed_num 44 | exit 0 45 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/scripts/vcs-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!@shell@ 2 | 3 | _EXTRA_ARGS="$@" 4 | 5 | if ((${VERBOSE:-0})); then 6 | set -x 7 | fi 8 | 9 | _LIB=@lib@ 10 | _DATE_BIN=@dateBin@ 11 | _VCS_SIM_BIN=@vcsSimBin@ 12 | _VCS_SIM_DAIDIR=@vcsSimDaidir@ 13 | _VCS_FHS_ENV=@vcsFhsEnv@ 14 | _VCS_COV_DIR=@vcsCovDir@ 15 | 16 | _NOW=$("$_DATE_BIN" "+%Y-%m-%d-%H-%M-%S") 17 | _GCD_SIM_RESULT_DIR=${GCD_SIM_RESULT_DIR:-"gcd-sim-result"} 18 | _CURRENT="$_GCD_SIM_RESULT_DIR"/all/"$_NOW" 19 | mkdir -p "$_CURRENT" 20 | ln -sfn "all/$_NOW" "$_GCD_SIM_RESULT_DIR/result" 21 | 22 | cp "$_VCS_SIM_BIN" "$_CURRENT/" 23 | cp -r "$_VCS_SIM_DAIDIR" "$_CURRENT/" 24 | 25 | if [ -n "$_VCS_COV_DIR" ]; then 26 | cp -vr "$_LIB/$_VCS_COV_DIR" "$_CURRENT/" 27 | _CM_ARG="-cm assert -cm_dir ./$_VCS_COV_DIR" # vcs runs in $_CURRENT 28 | fi 29 | 30 | chmod -R +w "$_CURRENT" 31 | pushd "$_CURRENT" >/dev/null 32 | 33 | _emu_name=$(basename "$_VCS_SIM_BIN") 34 | _daidir=$(basename "$_VCS_SIM_DAIDIR") 35 | 36 | export LD_LIBRARY_PATH="$PWD/$_daidir:$LD_LIBRARY_PATH" 37 | 38 | "$_VCS_FHS_ENV" -c "./$_emu_name $_CM_ARG $_EXTRA_ARGS" &> >(tee ./vcs-emu-journal.log) 39 | 40 | if [ -n "$_VCS_COV_DIR" ]; then 41 | "$_VCS_FHS_ENV" -c "urg -dir "./$_VCS_COV_DIR" -format text" 42 | fi 43 | 44 | if ((${DATA_ONLY:-0})); then 45 | rm -f "./$_emu_name" 46 | fi 47 | 48 | set -e _emu_name _daidir 49 | 50 | echo "VCS emulator finished, result saved in $_GCD_SIM_RESULT_DIR/result" 51 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/vcs.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | lib, 6 | bash, 7 | stdenv, 8 | rtl, 9 | dpi-lib, 10 | vcs-fhs-env, 11 | runCommand, 12 | enableCover ? true, 13 | }: 14 | 15 | let 16 | binName = "gcd-vcs-simulator"; 17 | coverageName = "coverage.vdb"; 18 | in 19 | stdenv.mkDerivation (finalAttr: { 20 | name = "vcs"; 21 | 22 | # Add "sandbox = relaxed" into /etc/nix/nix.conf, and run `systemctl restart nix-daemon` 23 | # 24 | # run nix build with "--impure" flag to build this package without chroot 25 | # require license 26 | __noChroot = true; 27 | dontPatchELF = true; 28 | 29 | src = rtl; 30 | 31 | meta.mainProgram = binName; 32 | 33 | buildPhase = '' 34 | runHook preBuild 35 | 36 | echo "[nix] running VCS" 37 | fhsBash=${vcs-fhs-env}/bin/vcs-fhs-env 38 | VERDI_HOME=$("$fhsBash" -c "printenv VERDI_HOME") 39 | "$fhsBash" vcs \ 40 | -sverilog \ 41 | -full64 \ 42 | -timescale=1ns/1ps \ 43 | -P $VERDI_HOME/share/PLI/VCS/LINUX64/novas.tab $VERDI_HOME/share/PLI/VCS/LINUX64/pli.a \ 44 | ${lib.optionalString dpi-lib.enable-trace '' 45 | -debug_access+pp+dmptf+thread \ 46 | -kdb=common_elab,hgldd_all \ 47 | -assert enable_diag ''} \ 48 | ${lib.optionalString enableCover '' 49 | -cm line+cond+fsm+tgl+branch+assert \ 50 | -cm_dir ${coverageName} ''} \ 51 | -file filelist.f \ 52 | ${dpi-lib}/lib/${dpi-lib.libOutName} \ 53 | -o ${binName} 54 | 55 | runHook postBuild 56 | ''; 57 | 58 | passthru = { 59 | inherit (dpi-lib) enable-trace; 60 | inherit vcs-fhs-env; 61 | inherit dpi-lib; 62 | inherit rtl; 63 | 64 | tests.simple-sim = runCommand "${binName}-test" { __noChroot = true; } '' 65 | export GCD_SIM_RESULT_DIR="$(mktemp -d)" 66 | export DATA_ONLY=1 67 | ${finalAttr.finalPackage}/bin/${binName} 68 | 69 | mkdir -p "$out" 70 | cp -vr "$GCD_SIM_RESULT_DIR"/result/* "$out/" 71 | ''; 72 | }; 73 | 74 | shellHook = '' 75 | echo "[nix] entering fhs env" 76 | ${vcs-fhs-env}/bin/vcs-fhs-env 77 | ''; 78 | 79 | installPhase = '' 80 | runHook preInstall 81 | 82 | mkdir -p $out/bin $out/lib 83 | cp ${binName} $out/lib 84 | cp -r ${binName}.daidir $out/lib 85 | 86 | ${lib.optionalString enableCover ''cp -r ${coverageName} $out/lib''} \ 87 | 88 | substitute ${./scripts/vcs-wrapper.sh} $out/bin/${binName} \ 89 | --subst-var-by lib "$out/lib" \ 90 | --subst-var-by shell "${bash}/bin/bash" \ 91 | --subst-var-by dateBin "$(command -v date)" \ 92 | --subst-var-by vcsSimBin "$out/lib/${binName}" \ 93 | --subst-var-by vcsSimDaidir "$out/lib/${binName}.daidir" \ 94 | --subst-var-by vcsCovDir "${lib.optionalString enableCover "${coverageName}"}" \ 95 | --subst-var-by vcsFhsEnv "${vcs-fhs-env}/bin/vcs-fhs-env" 96 | chmod +x $out/bin/${binName} 97 | 98 | runHook postInstall 99 | ''; 100 | }) 101 | -------------------------------------------------------------------------------- /templates/chisel/nix/gcd/verilated.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | lib, 6 | stdenv, 7 | rtl, 8 | verilator, 9 | zlib, 10 | python3, 11 | dpi-lib, 12 | thread-num ? 8, 13 | }: 14 | let 15 | vName = "V${rtl.target}"; 16 | in 17 | stdenv.mkDerivation { 18 | name = "verilated"; 19 | 20 | src = rtl; 21 | 22 | nativeBuildInputs = [ 23 | verilator 24 | python3 25 | ]; 26 | 27 | # zlib is required for Rust to link against? 28 | # IIRC: zlib is required for 29 | propagatedBuildInputs = lib.optionals dpi-lib.enable-trace [ zlib ]; 30 | 31 | passthru = { 32 | inherit dpi-lib; 33 | inherit (rtl) target; 34 | }; 35 | 36 | meta.mainProgram = vName; 37 | 38 | buildPhase = '' 39 | runHook preBuild 40 | 41 | echo "[nix] running verilator" 42 | verilator \ 43 | ${lib.optionalString dpi-lib.enable-trace "--trace-fst"} \ 44 | --timing \ 45 | --threads ${toString thread-num} \ 46 | -O1 \ 47 | --main \ 48 | --exe \ 49 | --cc -f filelist.f --top ${rtl.target} ${dpi-lib}/lib/${dpi-lib.libOutName} 50 | 51 | echo "[nix] building verilated C lib" 52 | 53 | # backup srcs 54 | mkdir -p $out/share 55 | cp -r obj_dir $out/share/verilated_src 56 | 57 | # We can't use -C here because the Makefile is generated with relative path 58 | cd obj_dir 59 | make -j "$NIX_BUILD_CORES" -f ${vName}.mk ${vName} 60 | 61 | runHook postBuild 62 | ''; 63 | 64 | installPhase = '' 65 | runHook preInstall 66 | 67 | mkdir -p $out/{include,lib,bin} 68 | cp *.h $out/include 69 | cp *.a $out/lib 70 | cp ${vName} $out/bin 71 | 72 | runHook postInstall 73 | ''; 74 | 75 | # nix fortify hardening add `-O2` gcc flag, 76 | # we'd like verilator to controll optimization flags, so disable it. 77 | # `-O2` will make gcc build time in verilating extremely long 78 | hardeningDisable = [ "fortify" ]; 79 | } 80 | -------------------------------------------------------------------------------- /templates/chisel/nix/overlay.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | let 5 | getEnv' = 6 | key: 7 | let 8 | val = builtins.getEnv key; 9 | in 10 | if val == "" then builtins.throw "${key} not set or '--impure' not applied" else val; 11 | in 12 | final: prev: { 13 | espresso = final.callPackage ./pkgs/espresso.nix { }; 14 | 15 | mill = 16 | let 17 | jre = final.jdk21; 18 | in 19 | (prev.mill.override { inherit jre; }).overrideAttrs rec { 20 | # Fixed the buggy sorting issue in target resolve 21 | version = "0.12.8-1-46e216"; 22 | src = final.fetchurl { 23 | url = "https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/${version}/mill-dist-${version}-assembly.jar"; 24 | hash = "sha256-XNtl9NBQPlkYu/odrR/Z7hk3F01B6Rk4+r/8tMWzMm8="; 25 | }; 26 | passthru = { inherit jre; }; 27 | }; 28 | 29 | vcs-fhs-env = final.callPackage ./pkgs/vcs-fhs-env.nix { inherit getEnv'; }; 30 | 31 | cds-fhs-env = final.callPackage ./pkgs/cds-fhs-env.nix { inherit getEnv'; }; 32 | 33 | gcd = final.callPackage ./gcd { }; 34 | } 35 | -------------------------------------------------------------------------------- /templates/chisel/nix/pkgs/cds-fhs-env.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | { 4 | getEnv', 5 | fetchFromGitHub, 6 | }: 7 | let 8 | nixpkgsSrcs = fetchFromGitHub { 9 | owner = "NixOS"; 10 | repo = "nixpkgs"; 11 | rev = "c374d94f1536013ca8e92341b540eba4c22f9c62"; 12 | hash = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0="; 13 | }; 14 | 15 | # The cds we have only support x86-64_linux 16 | lockedPkgs = import nixpkgsSrcs { system = "x86_64-linux"; }; 17 | 18 | jasperHome = getEnv' "JASPER_HOME"; 19 | cdsLicenseFile = getEnv' "CDS_LIC_FILE"; 20 | in 21 | lockedPkgs.buildFHSEnv { 22 | name = "cds-fhs-env"; 23 | 24 | profile = '' 25 | [ ! -e "${jasperHome}" ] && echo "env JASPER_HOME='${jasperHome}' points to unknown location" && exit 1 26 | [ ! -d "${jasperHome}" ] && echo "env JASPER_HOME='${jasperHome}' not accessible" && exit 1 27 | 28 | export JASPER_HOME=${jasperHome} 29 | export CDS_LIC_FILE=${cdsLicenseFile} 30 | export PATH=$JASPER_HOME/bin:$PATH 31 | export _oldCdsEnvPath="$PATH" 32 | preHook() { 33 | PATH="$PATH:$_oldCdsEnvPath" 34 | } 35 | export -f preHook 36 | ''; 37 | targetPkgs = ( 38 | ps: with ps; [ 39 | dejavu_fonts 40 | libGL 41 | util-linux 42 | libxcrypt-legacy 43 | coreutils-full 44 | ncurses5 45 | gmp5 46 | bzip2 47 | glib 48 | bc 49 | time 50 | elfutils 51 | ncurses5 52 | e2fsprogs 53 | cyrus_sasl 54 | expat 55 | sqlite 56 | nssmdns 57 | (libkrb5.overrideAttrs rec { 58 | version = "1.18.2"; 59 | src = fetchurl { 60 | url = "https://kerberos.org/dist/krb5/${lib.versions.majorMinor version}/krb5-${version}.tar.gz"; 61 | hash = "sha256-xuTJ7BqYFBw/XWbd8aE1VJBQyfq06aRiDumyIIWHOuA="; 62 | }; 63 | sourceRoot = "krb5-${version}/src"; 64 | }) 65 | (gnugrep.overrideAttrs rec { 66 | version = "3.1"; 67 | doCheck = false; 68 | src = fetchurl { 69 | url = "mirror://gnu/grep/grep-${version}.tar.xz"; 70 | hash = "sha256-22JcerO7PudXs5JqXPqNnhw5ka0kcHqD3eil7yv3oH4="; 71 | }; 72 | }) 73 | keyutils 74 | graphite2 75 | libpulseaudio 76 | libxml2 77 | gcc 78 | gnumake 79 | xorg.libX11 80 | xorg.libXft 81 | xorg.libXScrnSaver 82 | xorg.libXext 83 | xorg.libxcb 84 | xorg.libXau 85 | xorg.libXrender 86 | xorg.libXcomposite 87 | xorg.libXi 88 | xorg.libSM 89 | xorg.libICE 90 | fontconfig 91 | freetype 92 | zlib 93 | ] 94 | ); 95 | } 96 | -------------------------------------------------------------------------------- /templates/chisel/nix/pkgs/espresso.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | { 5 | stdenv, 6 | fetchFromGitHub, 7 | cmake, 8 | ninja, 9 | version ? "2.4", 10 | srcHash ? "sha256-z5By57VbmIt4sgRgvECnLbZklnDDWUA6fyvWVyXUzsI=", 11 | }: 12 | stdenv.mkDerivation { 13 | pname = "espresso"; 14 | inherit version; 15 | nativeBuildInputs = [ 16 | cmake 17 | ninja 18 | ]; 19 | src = fetchFromGitHub { 20 | owner = "chipsalliance"; 21 | repo = "espresso"; 22 | rev = "v${version}"; 23 | hash = srcHash; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /templates/chisel/nix/pkgs/vcs-fhs-env.nix: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # SPDX-FileCopyrightText: 2024 Jiuyang Liu 3 | 4 | # This is a bit dirty. 5 | # Since VCS are close source toolchains, we have no way to fix it for environment changes. 6 | # So here we have to lock the whole nixpkgs to a working version. 7 | # 8 | # For convenience, we still use the nixpkgs defined in flake to "callPackage" this derivation. 9 | # But the buildFHSEnv, targetPkgs is still from the locked nixpkgs. 10 | { getEnv', fetchFromGitHub }: 11 | let 12 | nixpkgsSrcs = fetchFromGitHub { 13 | owner = "NixOS"; 14 | repo = "nixpkgs"; 15 | rev = "c374d94f1536013ca8e92341b540eba4c22f9c62"; 16 | hash = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0="; 17 | }; 18 | 19 | # The vcs we have only support x86-64_linux 20 | lockedPkgs = import nixpkgsSrcs { system = "x86_64-linux"; }; 21 | 22 | vcStaticHome = getEnv' "VC_STATIC_HOME"; 23 | snpslmdLicenseFile = getEnv' "SNPSLMD_LICENSE_FILE"; 24 | in 25 | lockedPkgs.buildFHSEnv { 26 | name = "vcs-fhs-env"; 27 | 28 | profile = '' 29 | [ ! -e "${vcStaticHome}" ] && echo "env VC_STATIC_HOME='${vcStaticHome}' points to unknown location" && exit 1 30 | [ ! -d "${vcStaticHome}" ] && echo "VC_STATIC_HOME='${vcStaticHome}' not accessible" && exit 1 31 | 32 | export VC_STATIC_HOME=${vcStaticHome} 33 | 34 | export TCL_TZ=UTC 35 | export VC_STATIC_HOME=$VC_STATIC_HOME 36 | export VCS_HOME=$VC_STATIC_HOME/vcs-mx 37 | export VCS_TARGET_ARCH=amd64 38 | export VCS_ARCH_OVERRIDE=linux 39 | export VERDI_HOME=$VC_STATIC_HOME/verdi 40 | export NOVAS_HOME=$VC_STATIC_HOME/verdi 41 | export SPYGLASS_HOME=$VC_STATIC_HOME/SG_COMPAT/SPYGLASS_HOME 42 | export SNPS_VERDI_CBUG_LCA=1 43 | export SNPSLMD_LICENSE_FILE=${snpslmdLicenseFile} 44 | 45 | export PATH=$VC_STATIC_HOME/bin:$PATH 46 | export PATH=$VC_STATIC_HOME/verdi/bin:$PATH 47 | export PATH=$VC_STATIC_HOME/vcs-mx/bin:$PATH 48 | export PATH=$VC_STATIC_HOME/SG_COMPAT/SPYGLASS_HOME/bin:$PATH 49 | 50 | export LD_LIBRARY_PATH=/usr/lib64/ 51 | export LD_LIBRARY_PATH=$VC_STATIC_HOME/verdi/share/PLI/lib/LINUX64:$LD_LIBRARY_PATH 52 | export LD_LIBRARY_PATH=$VC_STATIC_HOME/verdi/share/NPI/lib/LINUX64:$LD_LIBRARY_PATH 53 | 54 | export _oldVcsEnvPath="$PATH" 55 | preHook() { 56 | PATH="$PATH:$_oldVcsEnvPath" 57 | } 58 | export -f preHook 59 | ''; 60 | targetPkgs = ( 61 | ps: with ps; [ 62 | libGL 63 | util-linux 64 | libxcrypt-legacy 65 | coreutils-full 66 | ncurses5 67 | gmp5 68 | bzip2 69 | glib 70 | bc 71 | time 72 | elfutils 73 | ncurses5 74 | e2fsprogs 75 | cyrus_sasl 76 | expat 77 | sqlite 78 | nssmdns 79 | (libkrb5.overrideAttrs rec { 80 | version = "1.18.2"; 81 | src = fetchurl { 82 | url = "https://kerberos.org/dist/krb5/${lib.versions.majorMinor version}/krb5-${version}.tar.gz"; 83 | hash = "sha256-xuTJ7BqYFBw/XWbd8aE1VJBQyfq06aRiDumyIIWHOuA="; 84 | }; 85 | sourceRoot = "krb5-${version}/src"; 86 | }) 87 | (gnugrep.overrideAttrs rec { 88 | version = "3.1"; 89 | doCheck = false; 90 | src = fetchurl { 91 | url = "mirror://gnu/grep/grep-${version}.tar.xz"; 92 | hash = "sha256-22JcerO7PudXs5JqXPqNnhw5ka0kcHqD3eil7yv3oH4="; 93 | }; 94 | }) 95 | keyutils 96 | graphite2 97 | libpulseaudio 98 | libxml2 99 | gcc 100 | gnumake 101 | xorg.libX11 102 | xorg.libXft 103 | xorg.libXScrnSaver 104 | xorg.libXext 105 | xorg.libxcb 106 | xorg.libXau 107 | xorg.libXrender 108 | xorg.libXcomposite 109 | xorg.libXi 110 | zlib 111 | ] 112 | ); 113 | } 114 | -------------------------------------------------------------------------------- /templates/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | "chisel" = { 3 | path = ./chisel; 4 | description = "Basic chisel project setup"; 5 | }; 6 | } 7 | --------------------------------------------------------------------------------