diff --git a/.github/cases/blastoise/perf.json b/.github/cases/blastoise/perf.json deleted file mode 100644 index b75990ed7..000000000 --- a/.github/cases/blastoise/perf.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "mlir.conv": 0, - "mlir.matmul": 0, - "mlir.stripmining": 26732, - "intrinsic.conv2d_less_m2": 2087, - "intrinsic.linear_normalization": 2878, - "intrinsic.matmul": 0, - "intrinsic.softmax": 7437 -} \ No newline at end of file diff --git a/.github/cases/machamp/perf.json b/.github/cases/machamp/perf.json deleted file mode 100644 index 9f0fc6695..000000000 --- a/.github/cases/machamp/perf.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "mlir.conv": 0, - "mlir.matmul": 0, - "mlir.stripmining": 14447 -} \ No newline at end of file diff --git a/.github/cases/psyduck/perf.json b/.github/cases/psyduck/perf.json deleted file mode 100644 index 3527224f9..000000000 --- a/.github/cases/psyduck/perf.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "mlir.conv": 0, - "mlir.matmul": 0, - "mlir.stripmining": 0, - "intrinsic.conv2d_less_m2": 0, - "intrinsic.linear_normalization": 0, - "intrinsic.matmul": 0, - "intrinsic.softmax": 0 -} diff --git a/.github/cases/sandslash/perf.json b/.github/cases/sandslash/perf.json deleted file mode 100644 index a63d11557..000000000 --- a/.github/cases/sandslash/perf.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "mlir.conv": 0, - "mlir.matmul": 0, - "mlir.stripmining": 15253 -} \ No newline at end of file diff --git a/.github/cases/blastoise/default.json b/.github/designs/blastoise/t1emu.json similarity index 99% rename from .github/cases/blastoise/default.json rename to .github/designs/blastoise/t1emu.json index eb0890659..02ba91dd6 100644 --- a/.github/cases/blastoise/default.json +++ b/.github/designs/blastoise/t1emu.json @@ -2,7 +2,6 @@ "pytorch.demo": 76, "pytorch.lenet": 394687, "pytorch.matmul": 14497, - "pytorch.mobilenet": 15139469, "mlir.rvv_vp_intrinsic_add": 435, "mlir.rvv_vp_intrinsic_add_scalable": 583, "mlir.hello": 145, diff --git a/.github/cases/machamp/default.json b/.github/designs/machamp/t1emu.json similarity index 100% rename from .github/cases/machamp/default.json rename to .github/designs/machamp/t1emu.json diff --git a/.github/cases/psyduck/default.json b/.github/designs/psyduck/t1emu.json similarity index 100% rename from .github/cases/psyduck/default.json rename to .github/designs/psyduck/t1emu.json diff --git a/.github/cases/sandslash/default.json b/.github/designs/sandslash/t1emu.json similarity index 100% rename from .github/cases/sandslash/default.json rename to .github/designs/sandslash/t1emu.json diff --git a/.github/t1rocket-cases/t1rocket/default.json b/.github/designs/t1rocket/t1rocketemu.json similarity index 99% rename from .github/t1rocket-cases/t1rocket/default.json rename to .github/designs/t1rocket/t1rocketemu.json index c2e69d073..740def442 100644 --- a/.github/t1rocket-cases/t1rocket/default.json +++ b/.github/designs/t1rocket/t1rocketemu.json @@ -1,5 +1,7 @@ { "pytorch.demo": 31505, + "pytorch.lenet": 38661294, + "pytorch.matmul": 69716, "mlir.rvv_vp_intrinsic_add": 468, "mlir.rvv_vp_intrinsic_add_scalable": 696, "mlir.hello": 140, diff --git a/.github/t1rocket-cases/t1rocket/perf.json b/.github/t1rocket-cases/t1rocket/perf.json deleted file mode 100644 index b75990ed7..000000000 --- a/.github/t1rocket-cases/t1rocket/perf.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "mlir.conv": 0, - "mlir.matmul": 0, - "mlir.stripmining": 26732, - "intrinsic.conv2d_less_m2": 2087, - "intrinsic.linear_normalization": 2878, - "intrinsic.matmul": 0, - "intrinsic.softmax": 7437 -} \ No newline at end of file diff --git a/.github/workflows/t1rocket.yml b/.github/workflows/t1rocket.yml index bb510c03f..c1fd497b0 100644 --- a/.github/workflows/t1rocket.yml +++ b/.github/workflows/t1rocket.yml @@ -120,7 +120,7 @@ jobs: if [ -n "$changed_cases" ]; then echo "changed cases: $changed_cases" - git add '.github/**/default.json' + git add '.github/designs/**/*.json' git commit -m "[ci] update t1 test case cycle data" git push origin ${{ github.head_ref }} else diff --git a/.github/workflows/vcs.yml b/.github/workflows/vcs.yml index 5a8da0c62..810638c08 100644 --- a/.github/workflows/vcs.yml +++ b/.github/workflows/vcs.yml @@ -120,7 +120,7 @@ jobs: if [ -n "$changed_cases" ]; then echo "changed cases: $changed_cases" - git add '.github/**/default.json' + git add '.github/designs/**/*.json' git commit -m "[ci] update t1 test case cycle data" git push origin ${{ github.head_ref }} else diff --git a/nix/t1/run/default.nix b/nix/t1/run/default.nix index 687942ced..8ef0d509c 100644 --- a/nix/t1/run/default.nix +++ b/nix/t1/run/default.nix @@ -7,6 +7,7 @@ , vcs-emu-trace , cases , configName +, topName }: let runVerilatorEmu = callPackage ./run-verilator-emu.nix { }; @@ -41,7 +42,7 @@ let _getAllResult = emuType: let testPlan = builtins.fromJSON - (lib.readFile ../../../.github/${configName}/default.json); + (lib.readFile ../../../.github/designs/${configName}/${topName}.json); # flattern the attr set to a list of test case derivations # AttrSet (AttrSet Derivation) -> List Derivation allCasesResult = lib.pipe emuAttrs [ diff --git a/nix/t1/t1.nix b/nix/t1/t1.nix index b4166fd2a..b32849ab6 100644 --- a/nix/t1/t1.nix +++ b/nix/t1/t1.nix @@ -11,18 +11,20 @@ lib.mapAttrs strippedGeneratorData = lib.mapAttrs' (fullClassName: origData: lib.nameValuePair - (lib.head (lib.splitString "." (lib.removePrefix "org.chipsalliance.t1.elaborator." fullClassName))) + (lib.head + (lib.splitString "." + (lib.removePrefix "org.chipsalliance.t1.elaborator." fullClassName))) (origData // { inherit fullClassName; })) allGenerators; in lib.mapAttrs - (shortName: generator: + (topName: generator: lib.makeScope t1Scope.newScope - (mostInnerScope: + (innerMostScope: lib.recurseIntoAttrs { - inherit configName; + inherit configName topName; - cases = mostInnerScope.callPackage ../../tests { }; + cases = innerMostScope.callPackage ../../tests { }; mlirbc = t1Scope.chisel-to-mlirbc { outputName = "${generator.fullClassName}.mlirbc"; @@ -31,13 +33,13 @@ lib.mapAttrs }; lowered-mlirbc = t1Scope.finalize-mlirbc { - outputName = "lowered-" + mostInnerScope.mlirbc.name; - mlirbc = mostInnerScope.mlirbc; + outputName = "lowered-" + innerMostScope.mlirbc.name; + mlirbc = innerMostScope.mlirbc; }; rtl = t1Scope.mlirbc-to-sv { outputName = "${generator.fullClassName}-rtl"; - mlirbc = mostInnerScope.lowered-mlirbc; + mlirbc = innerMostScope.lowered-mlirbc; mfcArgs = [ "-O=release" "--disable-all-randomization" @@ -53,10 +55,10 @@ lib.mapAttrs omGet = args: lib.toLower (lib.fileContents (runCommand "get-${args}" { } '' ${t1Scope.omreader-unwrapped}/bin/omreader \ ${args} \ - --mlirbc-file ${mostInnerScope.lowered-mlirbc}/${mostInnerScope.lowered-mlirbc.name} \ + --mlirbc-file ${innerMostScope.lowered-mlirbc}/${innerMostScope.lowered-mlirbc.name} \ > $out '')); - rtlDesignMetadata = with mostInnerScope; rec { + rtlDesignMetadata = with innerMostScope; rec { march = omGet "march"; extensions = builtins.fromJSON (omGet "extensionsJson"); vlen = omGet "vlen"; @@ -67,65 +69,65 @@ lib.mapAttrs # --------------------------------------------------------------------------------- # VERILATOR # --------------------------------------------------------------------------------- - makeDifftest = mostInnerScope.callPackage ../../difftest { }; + makeDifftest = innerMostScope.callPackage ../../difftest { }; - verilator-dpi-lib = mostInnerScope.makeDifftest { - outputName = "${shortName}-verilator-dpi-lib"; + verilator-dpi-lib = innerMostScope.makeDifftest { + outputName = "${topName}-verilator-dpi-lib"; emuType = "verilator"; - moduleType = "dpi_${shortName}"; + moduleType = "dpi_${topName}"; }; - verilator-dpi-lib-trace = mostInnerScope.makeDifftest { - outputName = "${shortName}-verilator-trace-dpi-lib"; + verilator-dpi-lib-trace = innerMostScope.makeDifftest { + outputName = "${topName}-verilator-trace-dpi-lib"; emuType = "verilator"; - moduleType = "dpi_${shortName}"; + moduleType = "dpi_${topName}"; enableTrace = true; }; verilator-emu = t1Scope.sv-to-verilator-emulator { - mainProgram = "${shortName}-verilated-simulator"; - rtl = mostInnerScope.rtl; - extraVerilatorArgs = [ "${mostInnerScope.verilator-dpi-lib}/lib/libdpi_${shortName}.a" ]; + mainProgram = "${topName}-verilated-simulator"; + rtl = innerMostScope.rtl; + extraVerilatorArgs = [ "${innerMostScope.verilator-dpi-lib}/lib/libdpi_${topName}.a" ]; }; verilator-emu-trace = t1Scope.sv-to-verilator-emulator { - mainProgram = "${shortName}-verilated-trace-simulator"; - rtl = mostInnerScope.rtl; + mainProgram = "${topName}-verilated-trace-simulator"; + rtl = innerMostScope.rtl; enableTrace = true; - extraVerilatorArgs = [ "${mostInnerScope.verilator-dpi-lib-trace}/lib/libdpi_${shortName}.a" ]; + extraVerilatorArgs = [ "${innerMostScope.verilator-dpi-lib-trace}/lib/libdpi_${topName}.a" ]; }; # --------------------------------------------------------------------------------- # VCS # --------------------------------------------------------------------------------- - vcs-dpi-lib = mostInnerScope.makeDifftest { - outputName = "${shortName}-vcs-dpi-lib"; + vcs-dpi-lib = innerMostScope.makeDifftest { + outputName = "${topName}-vcs-dpi-lib"; emuType = "vcs"; - moduleType = "dpi_${shortName}"; + moduleType = "dpi_${topName}"; }; - vcs-dpi-lib-trace = mostInnerScope.makeDifftest { - outputName = "${shortName}-vcs-dpi-trace-lib"; + vcs-dpi-lib-trace = innerMostScope.makeDifftest { + outputName = "${topName}-vcs-dpi-trace-lib"; emuType = "vcs"; enableTrace = true; - moduleType = "dpi_${shortName}"; + moduleType = "dpi_${topName}"; }; - offline-checker = mostInnerScope.makeDifftest { - outputName = "${shortName}-offline-checker"; - moduleType = "offline_${shortName}"; + offline-checker = innerMostScope.makeDifftest { + outputName = "${topName}-offline-checker"; + moduleType = "offline_${topName}"; }; vcs-emu = t1Scope.sv-to-vcs-simulator { - mainProgram = "${shortName}-vcs-simulator"; - rtl = mostInnerScope.rtl; - vcsLinkLibs = [ "${mostInnerScope.vcs-dpi-lib}/lib/libdpi_${shortName}.a" ]; + mainProgram = "${topName}-vcs-simulator"; + rtl = innerMostScope.rtl; + vcsLinkLibs = [ "${innerMostScope.vcs-dpi-lib}/lib/libdpi_${topName}.a" ]; }; vcs-emu-trace = t1Scope.sv-to-vcs-simulator { - mainProgram = "${shortName}-vcs-trace-simulator"; - rtl = mostInnerScope.rtl; + mainProgram = "${topName}-vcs-trace-simulator"; + rtl = innerMostScope.rtl; enableTrace = true; - vcsLinkLibs = [ "${mostInnerScope.vcs-dpi-lib-trace}/lib/libdpi_${shortName}.a" ]; + vcsLinkLibs = [ "${innerMostScope.vcs-dpi-lib-trace}/lib/libdpi_${topName}.a" ]; }; - run = mostInnerScope.callPackage ./run { }; + run = innerMostScope.callPackage ./run { }; }) ) strippedGeneratorData