Skip to content

Commit

Permalink
[nix] expose T1 testcases to outside
Browse files Browse the repository at this point in the history
This change allow user to build testcases with their configured xLen vLen from other project,
instead of building the whole configgen and t1 source to their project.

Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Feb 12, 2024
1 parent 3ba6276 commit 59ccd2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nix/t1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ lib.makeScope newScope
mkAsmCase = self.callPackage ./testcases/make-asm-case.nix { stdenv = rv32-stdenv; };
mkCodegenCase = self.callPackage ./testcases/make-codegen-case.nix { stdenv = rv32-stdenv; };
};
makeTestCase = { xLen, vLen }: self.callPackage ../../tests { inherit xLen vLen; };

} //
lib.genAttrs allConfigs (configName:
# by using makeScope, callPackage can send the following attributes to package parameters
Expand All @@ -57,7 +59,7 @@ lib.makeScope newScope

_elaborateConfig = with builtins; fromJSON (readFile "${elaborate-config}/config.json");

cases = self.callPackage ../../tests { inherit (_elaborateConfig.parameter) xLen vLen; };
cases = self.makeTestCase { inherit (_elaborateConfig.parameter) xLen vLen; };

cases-x86 =
if system == "x86-64-linux"
Expand Down

0 comments on commit 59ccd2e

Please sign in to comment.