|
3 | 3 |
|
4 | 4 | { lib, newScope, }:
|
5 | 5 | lib.makeScope newScope (scope:
|
6 |
| - let |
7 |
| - designTarget = "GCD"; |
8 |
| - tbTarget = "GCDTestBench"; |
9 |
| - dpiLibName = "gcdemu"; |
10 |
| - in { |
11 |
| - # RTL |
12 |
| - gcd-compiled = scope.callPackage ./gcd.nix { target = designTarget; }; |
13 |
| - elaborate = scope.callPackage ./elaborate.nix { |
14 |
| - elaborator = scope.gcd-compiled.elaborator; |
15 |
| - }; |
16 |
| - mlirbc = scope.callPackage ./mlirbc.nix { }; |
17 |
| - rtl = scope.callPackage ./rtl.nix { }; |
| 6 | +let |
| 7 | + designTarget = "GCD"; |
| 8 | + tbTarget = "GCDTestBench"; |
| 9 | + dpiLibName = "gcdemu"; |
| 10 | +in |
| 11 | +{ |
| 12 | + # RTL |
| 13 | + gcd-compiled = scope.callPackage ./gcd.nix { target = designTarget; }; |
| 14 | + elaborate = scope.callPackage ./elaborate.nix { |
| 15 | + elaborator = scope.gcd-compiled.elaborator; |
| 16 | + }; |
| 17 | + mlirbc = scope.callPackage ./mlirbc.nix { }; |
| 18 | + rtl = scope.callPackage ./rtl.nix { }; |
18 | 19 |
|
19 |
| - # Testbench |
20 |
| - tb-compiled = scope.callPackage ./gcd.nix { target = tbTarget; }; |
21 |
| - tb-elaborate = scope.callPackage ./elaborate.nix { |
22 |
| - elaborator = scope.tb-compiled.elaborator; |
23 |
| - }; |
24 |
| - tb-mlirbc = |
25 |
| - scope.callPackage ./mlirbc.nix { elaborate = scope.tb-elaborate; }; |
26 |
| - tb-rtl = scope.callPackage ./rtl.nix { mlirbc = scope.tb-mlirbc; }; |
27 |
| - tb-dpi-lib = scope.callPackage ./dpi-lib.nix { inherit dpiLibName; }; |
| 20 | + # Testbench |
| 21 | + tb-compiled = scope.callPackage ./gcd.nix { target = tbTarget; }; |
| 22 | + tb-elaborate = scope.callPackage ./elaborate.nix { |
| 23 | + elaborator = scope.tb-compiled.elaborator; |
| 24 | + }; |
| 25 | + tb-mlirbc = |
| 26 | + scope.callPackage ./mlirbc.nix { elaborate = scope.tb-elaborate; }; |
| 27 | + tb-rtl = scope.callPackage ./rtl.nix { mlirbc = scope.tb-mlirbc; }; |
| 28 | + tb-dpi-lib = scope.callPackage ./dpi-lib.nix { inherit dpiLibName; }; |
28 | 29 |
|
29 |
| - verilated = scope.callPackage ./verilated.nix { |
30 |
| - rtl = scope.tb-rtl.override { enable-layers = [ "Verification" ]; }; |
31 |
| - dpi-lib = scope.tb-dpi-lib; |
32 |
| - }; |
33 |
| - verilated-trace = scope.verilated.override { |
34 |
| - dpi-lib = scope.verilated.dpi-lib.override { enable-trace = true; }; |
35 |
| - }; |
36 |
| - vcs = scope.callPackage ./vcs.nix { |
37 |
| - dpi-lib = scope.tb-dpi-lib.override { |
38 |
| - sv2023 = false; |
39 |
| - vpi = true; |
40 |
| - }; |
41 |
| - rtl = scope.tb-rtl.override { |
42 |
| - enable-layers = |
43 |
| - [ "Verification" "Verification.Assert" "Verification.Cover" ]; |
44 |
| - }; |
| 30 | + verilated = scope.callPackage ./verilated.nix { |
| 31 | + rtl = scope.tb-rtl.override { enable-layers = [ "Verification" ]; }; |
| 32 | + dpi-lib = scope.tb-dpi-lib; |
| 33 | + }; |
| 34 | + verilated-trace = scope.verilated.override { |
| 35 | + dpi-lib = scope.verilated.dpi-lib.override { enable-trace = true; }; |
| 36 | + }; |
| 37 | + vcs = scope.callPackage ./vcs.nix { |
| 38 | + dpi-lib = scope.tb-dpi-lib.override { |
| 39 | + sv2023 = false; |
| 40 | + vpi = true; |
| 41 | + timescale = 1000; |
45 | 42 | };
|
46 |
| - vcs-trace = scope.vcs.override { |
47 |
| - dpi-lib = scope.vcs.dpi-lib.override { |
48 |
| - enable-trace = true; |
49 |
| - timescale = 1000; |
50 |
| - }; |
| 43 | + rtl = scope.tb-rtl.override { |
| 44 | + enable-layers = |
| 45 | + [ "Verification" "Verification.Assert" "Verification.Cover" ]; |
51 | 46 | };
|
| 47 | + }; |
| 48 | + vcs-trace = scope.vcs.override { |
| 49 | + dpi-lib = scope.vcs.dpi-lib.override { enable-trace = true; }; |
| 50 | + }; |
52 | 51 |
|
53 |
| - # TODO: designConfig should be read from OM |
54 |
| - tbConfig = with builtins; |
55 |
| - fromJSON (readFile ./../../configs/${tbTarget}Main.json); |
| 52 | + # TODO: designConfig should be read from OM |
| 53 | + tbConfig = with builtins; |
| 54 | + fromJSON (readFile ./../../configs/${tbTarget}Main.json); |
56 | 55 |
|
57 |
| - }) |
| 56 | +}) |
58 | 57 |
|
0 commit comments