looked in soc.vhdl in microwatt and the parameters are 64 cache
[soc.git] / flake.nix
1 {
2 description = "FOSS CPU/GPU/VPU/SoC all in one, see https://libre-soc.org/";
3
4 inputs.nixpkgs.url = "github:L-as/nixpkgs?ref=libresoc"; # for alliance and migen
5 inputs.c4m-jtag.url = "git+https://git.libre-soc.org/git/c4m-jtag.git";
6 inputs.c4m-jtag.flake = false;
7 inputs.nmigen.url = "git+https://git.libre-soc.org/git/nmigen.git";
8 inputs.nmigen.flake = false;
9 inputs.nmigen-soc.url = "git+https://git.libre-soc.org/git/nmigen-soc.git";
10 inputs.nmigen-soc.flake = false;
11 inputs.migen.url = "github:m-labs/migen";
12 inputs.migen.flake = false;
13 inputs.yosys.url = "github:YosysHQ/yosys?rev=a58571d0fe8971cb7d3a619a31b2c21be6d75bac";
14 inputs.yosys.flake = false;
15 # submodules needed
16 inputs.nix-litex.url = "git+https://git.sr.ht/~lschuermann/nix-litex?ref=main";
17 inputs.nix-litex.flake = false;
18
19 outputs = { self, nixpkgs, c4m-jtag, nmigen, nmigen-soc, nix-litex, migen, yosys }:
20 let
21 getv = x: builtins.substring 0 8 x.lastModifiedDate;
22
23 supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
24
25 forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
26
27 litex = pkgs: import "${nix-litex}/pkgs" {
28 inherit pkgs;
29 pkgMetas = builtins.fromTOML (builtins.readFile ./nix/litex.toml);
30 skipChecks = true; # FIXME: remove once checks work
31 };
32
33 nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
34
35 lib = nixpkgs.lib;
36 in
37 {
38 overlay = final: prev: {
39 python37 = prev.python37.override {
40 packageOverrides = lib.composeExtensions (litex final).pythonOverlay (pfinal: pprev: {
41 libresoc-ieee754fpu = pfinal.callPackage ./nix/ieee754fpu.nix {};
42 libresoc-openpower-isa = pfinal.callPackage ./nix/openpower-isa.nix {};
43 c4m-jtag = pfinal.callPackage (import ./nix/c4m-jtag.nix { src = c4m-jtag; version = getv c4m-jtag; }) {};
44 bigfloat = pfinal.callPackage ./nix/bigfloat.nix {};
45 modgrammar = pfinal.callPackage ./nix/modgrammar.nix {};
46 libresoc-nmutil = pfinal.callPackage ./nix/nmutil.nix {};
47 libresoc-soc = pfinal.callPackage (import ./nix/soc.nix { version = getv self; }) {};
48
49 nmigen-soc = pprev.nmigen-soc.overrideAttrs (_: {
50 doCheck = false;
51 src = nmigen-soc;
52 setuptoolsCheckPhase = "true";
53 });
54
55 nmigen = pprev.nmigen.overrideAttrs (_: {
56 src = nmigen;
57 });
58
59 migen = pprev.migen.overrideAttrs (_: {
60 src = migen;
61 });
62 });
63 };
64
65 yosys = prev.yosys.overrideAttrs (_: {
66 version = "0.9+4052";
67 src = yosys;
68 });
69
70 libresoc-verilog = final.callPackage (import ./nix/verilog.nix { version = getv self; }) { python3Packages = final.python37Packages; };
71 libresoc-ls180 = final.callPackage (import ./nix/ls180.nix { version = getv self; }) { python3Packages = final.python37Packages; };
72 libresoc-ecp5 = final.callPackage (import ./nix/ecp5.nix { version = getv self; }) { python3Packages = final.python37Packages; };
73 libresoc-ecp5-program = final.callPackage (import ./nix/ecp5-program.nix { version = getv self; }) { python3Packages = final.python37Packages; };
74 libresoc-pinmux = final.callPackage (import ./nix/pinmux.nix { version = getv self; }) {};
75 };
76
77 apps = forAllSystems (system: {
78 ecp5 = {
79 type = "app";
80 program = "${nixpkgsFor.${system}.libresoc-ecp5-program}";
81 };
82 });
83 defaultApp = forAllSystems (system: self.apps.${system}.ecp5);
84
85 packages = forAllSystems (system: {
86 soc = nixpkgsFor.${system}.python37Packages.libresoc-soc;
87 verilog = nixpkgsFor.${system}.libresoc-verilog;
88 pinmux = nixpkgsFor.${system}.libresoc-pinmux;
89 ls180 = nixpkgsFor.${system}.libresoc-ls180;
90 ecp5 = nixpkgsFor.${system}.libresoc-ecp5;
91 ecp5-program = nixpkgsFor.${system}.libresoc-ecp5-program;
92 openpower-isa = nixpkgsFor.${system}.python37Packages.libresoc-openpower-isa;
93 debugNixpkgs = nixpkgsFor.${system};
94 });
95
96 defaultPackage = forAllSystems (system: self.packages.${system}.verilog);
97 };
98 }