generated from saji/ecp5-template
start working on making flake work
Some checks failed
Verilator Unit Tests / Test (push) Failing after 1m36s
Some checks failed
Verilator Unit Tests / Test (push) Failing after 1m36s
This commit is contained in:
parent
63811b929a
commit
b25ab8bd52
11
Makefile
11
Makefile
|
@ -1,11 +0,0 @@
|
||||||
|
|
||||||
.PHONY all clean test
|
|
||||||
|
|
||||||
VERILOG_SOURCES := $(join $(wildcard verilog/*.v), $(wildcard verilog/*.sv))
|
|
||||||
TESTBENCH_SOURCES := $(wildcard verilog/tb/*.sv)
|
|
||||||
ICARUS_ARGS := "-g2012"
|
|
||||||
|
|
||||||
%.vcd: %.vvp
|
|
||||||
vvp $^
|
|
||||||
|
|
||||||
%.vvp: %.sv
|
|
33
flake.lock
33
flake.lock
|
@ -1,5 +1,22 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726560853,
|
||||||
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "flake-utils",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723637854,
|
"lastModified": 1723637854,
|
||||||
|
@ -18,8 +35,24 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
27
flake.nix
27
flake.nix
|
@ -5,17 +5,9 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, ... }:
|
outputs = inputs@{ nixpkgs, flake-utils, ... }:
|
||||||
let
|
let
|
||||||
# litex-overlay = final: prev: {
|
python-overlay = import ./python.nix;
|
||||||
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
|
||||||
# (python-final: python-prev: {
|
|
||||||
# litex = python-final.callPackage (import ./litex.nix) { };
|
|
||||||
# # can add more packages here!
|
|
||||||
# })
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
litex-overlay = import ./litex;
|
|
||||||
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
||||||
forAllSystems = function:
|
forAllSystems = function:
|
||||||
nixpkgs.lib.genAttrs systems (system: function (
|
nixpkgs.lib.genAttrs systems (system: function (
|
||||||
|
@ -23,38 +15,31 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [
|
overlays = [
|
||||||
]; # patches, version pins, new pkgs here.
|
python-overlay
|
||||||
|
];
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
in {
|
in {
|
||||||
packages = forAllSystems (pkgs: {
|
packages = forAllSystems (pkgs: {
|
||||||
sim = import ./sim/package.nix pkgs;
|
sim = import ./sim/package.nix pkgs;
|
||||||
|
|
||||||
});
|
});
|
||||||
devShells = forAllSystems (pkgs: {
|
devShells = forAllSystems (pkgs: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
(python3.withPackages (ps: with ps; [
|
(python3.withPackages (ps: with ps; [
|
||||||
cocotb
|
|
||||||
amaranth
|
amaranth
|
||||||
]))
|
]))
|
||||||
yosys
|
yosys
|
||||||
nextpnr
|
nextpnr
|
||||||
pkgsCross.riscv64.buildPackages.gcc
|
|
||||||
gnumake
|
|
||||||
wishbone-tool
|
|
||||||
# simulators
|
# simulators
|
||||||
verilog
|
iverilog
|
||||||
verilator
|
verilator
|
||||||
# support package
|
# support package
|
||||||
trellis
|
trellis
|
||||||
# loader
|
# loader
|
||||||
openfpgaloader
|
openfpgaloader
|
||||||
ecpdap # easier to poke probes.
|
ecpdap # easier to poke probes.
|
||||||
|
|
||||||
# for building the simulator
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
mdbook
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
18
python.nix
Normal file
18
python.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# overlay python patched version with amaranth/boards updated.
|
||||||
|
final: prev: {
|
||||||
|
python3 = prev.python3.override {
|
||||||
|
packageOverrides = pyfinal: pyprev: {
|
||||||
|
amaranth = pyprev.amaranth.overridePythonAttrs {
|
||||||
|
version = "0.6.0.dev53";
|
||||||
|
src = prev.pkgs.fetchFromGitHub {
|
||||||
|
owner = "amaranth-lang";
|
||||||
|
repo = "amaranth";
|
||||||
|
rev = "e30d822a7d93ee615e70e95a9958051dcc794802";
|
||||||
|
hash = "sha256-A46CMWGvqUFTp3geFFccUM9M7iECmNndzWm2GxA8XbE";
|
||||||
|
};
|
||||||
|
doCheck = false;
|
||||||
|
# installCheckPhase = "${prev.python3.interpreter} -m unittest discover -t . -s tests -v";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue