Skip to content

Commit

Permalink
[nix] fix nix search
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin authored and sequencer committed Jun 10, 2024
1 parent f048b88 commit a287d1f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
75 changes: 39 additions & 36 deletions nix/t1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ lib.makeScope newScope
in
{
inherit allConfigs;
recurseForDerivations = true;

elaborator = _millOutput.elaborator // { meta.mainProgram = "elaborator"; };
configgen = _millOutput.configgen // { meta.mainProgram = "configgen"; };
Expand All @@ -38,52 +39,54 @@ lib.makeScope newScope

riscv-opcodes-src = self.submodules.sources.riscv-opcodes.src;
} //
lib.mapAttrs (configName: configPath:
# by using makeScope, callPackage can send the following attributes to package parameters
lib.makeScope self.newScope (innerSelf: rec {
recurseForDerivations = true;
lib.mapAttrs
(configName: configPath:
# by using makeScope, callPackage can send the following attributes to package parameters
lib.makeScope self.newScope (innerSelf: rec {
recurseForDerivations = true;

# For package name concatenate
inherit configName;
# For package name concatenate
inherit configName;

elaborateConfigJson = configPath;
elaborateConfig = builtins.fromJSON (lib.readFile configPath);
elaborateConfigJson = configPath;
elaborateConfig = builtins.fromJSON (lib.readFile configPath);

cases = innerSelf.callPackage ../../tests { };
cases = innerSelf.callPackage ../../tests { };

# for the convenience to use x86 cases on non-x86 machines, avoiding the extra build time
cases-x86 =
if system == "x86-64-linux"
then self.cases
else pkgsX86.t1."${configName}".cases;
# for the convenience to use x86 cases on non-x86 machines, avoiding the extra build time
cases-x86 =
if system == "x86-64-linux"
then self.cases
else pkgsX86.t1."${configName}".cases;

ip = rec {
recurseForDerivations = true;
ip = rec {
recurseForDerivations = true;

elaborate = innerSelf.callPackage ./elaborate.nix { target = "ip"; /* use-binder = true; */ };
mlirbc = innerSelf.callPackage ./mlirbc.nix { inherit elaborate; };
rtl = innerSelf.callPackage ./rtl.nix { inherit mlirbc; };
omreaderlib = innerSelf.callPackage ./omreaderlib.nix { inherit mlirbc; };
elaborate = innerSelf.callPackage ./elaborate.nix { target = "ip"; /* use-binder = true; */ };
mlirbc = innerSelf.callPackage ./mlirbc.nix { inherit elaborate; };
rtl = innerSelf.callPackage ./rtl.nix { inherit mlirbc; };
om = innerSelf.callPackage ./om.nix { inherit mlirbc; };

emu-elaborate = innerSelf.callPackage ./elaborate.nix { target = "ipemu"; /* use-binder = true; */ };
emu-mlirbc = innerSelf.callPackage ./mlirbc.nix { elaborate = emu-elaborate; };
emu-rtl = innerSelf.callPackage ./rtl.nix { mlirbc = emu-mlirbc; };
emu-elaborate = innerSelf.callPackage ./elaborate.nix { target = "ipemu"; /* use-binder = true; */ };
emu-mlirbc = innerSelf.callPackage ./mlirbc.nix { elaborate = emu-elaborate; };
emu-rtl = innerSelf.callPackage ./rtl.nix { mlirbc = emu-mlirbc; };

emu = innerSelf.callPackage ./ipemu.nix { rtl = ip.emu-rtl; stdenv = moldStdenv; };
emu-trace = innerSelf.callPackage ./ipemu.nix { rtl = emu-rtl; stdenv = moldStdenv; do-trace = true; };
emu = innerSelf.callPackage ./ipemu.nix { rtl = ip.emu-rtl; stdenv = moldStdenv; };
emu-trace = innerSelf.callPackage ./ipemu.nix { rtl = emu-rtl; stdenv = moldStdenv; do-trace = true; };

t1-simulator = innerSelf.callPackage ../../difftest/t1-simulator/default.nix { rtl = innerSelf.ip.emu-rtl; };
};
t1-simulator = innerSelf.callPackage ../../difftest/t1-simulator/default.nix { rtl = innerSelf.ip.emu-rtl; };
};

subsystem = rec {
recurseForDerivations = true;
subsystem = rec {
recurseForDerivations = true;

elaborate = innerSelf.callPackage ./elaborate.nix { target = "subsystem"; /* use-binder = true; */ };
mlirbc = innerSelf.callPackage ./mlirbc.nix { inherit elaborate; };
rtl = innerSelf.callPackage ./rtl.nix { inherit mlirbc; };
};
elaborate = innerSelf.callPackage ./elaborate.nix { target = "subsystem"; /* use-binder = true; */ };
mlirbc = innerSelf.callPackage ./mlirbc.nix { inherit elaborate; };
rtl = innerSelf.callPackage ./rtl.nix { inherit mlirbc; };
};

release = innerSelf.callPackage ./release { };
})
) allConfigs
release = innerSelf.callPackage ./release { };
})
)
allConfigs
)
2 changes: 2 additions & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ let
vLen;

scope = lib.recurseIntoAttrs (lib.makeScope newScope (casesSelf: {
recurseForDerivations = true;

makeBuilder = casesSelf.callPackage ./builder.nix { };

findAndBuild = dir: build:
Expand Down

0 comments on commit a287d1f

Please sign in to comment.