Skip to content

Commit

Permalink
[ci] change test case layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Avimitin authored and sequencer committed Oct 14, 2024
1 parent fda80cf commit 2461522
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 80 deletions.
9 changes: 0 additions & 9 deletions .github/cases/blastoise/perf.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/cases/machamp/perf.json

This file was deleted.

9 changes: 0 additions & 9 deletions .github/cases/psyduck/perf.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/cases/sandslash/perf.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 0 additions & 9 deletions .github/t1rocket-cases/t1rocket/perf.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/t1rocket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion nix/t1/run/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, vcs-emu-trace
, cases
, configName
, topName
}:
let
runVerilatorEmu = callPackage ./run-verilator-emu.nix { };
Expand Down Expand Up @@ -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 [
Expand Down
80 changes: 41 additions & 39 deletions nix/t1/t1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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"
Expand All @@ -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";
Expand All @@ -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
Expand Down

0 comments on commit 2461522

Please sign in to comment.