Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
43 lines
869 B
Nix
43 lines
869 B
Nix
{
|
|
stdenv,
|
|
ghdl-llvm,
|
|
ghdl-mcode,
|
|
ghdl-gcc,
|
|
backend,
|
|
}:
|
|
|
|
let
|
|
ghdl =
|
|
if backend == "llvm" then
|
|
ghdl-llvm
|
|
else if backend == "gcc" then
|
|
ghdl-gcc
|
|
else
|
|
ghdl-mcode;
|
|
in
|
|
stdenv.mkDerivation {
|
|
name = "ghdl-test-simple";
|
|
meta.timeout = 300;
|
|
nativeBuildInputs = [ ghdl ];
|
|
buildCommand = ''
|
|
cp ${./simple.vhd} simple.vhd
|
|
cp ${./simple-tb.vhd} simple-tb.vhd
|
|
mkdir -p ghdlwork
|
|
ghdl -a --workdir=ghdlwork --ieee=synopsys simple.vhd simple-tb.vhd
|
|
ghdl -e --workdir=ghdlwork --ieee=synopsys -o sim-simple tb
|
|
''
|
|
+ (
|
|
if backend == "llvm" || backend == "gcc" then
|
|
''
|
|
./sim-simple --assert-level=warning > output.txt
|
|
''
|
|
else
|
|
''
|
|
ghdl -r --workdir=ghdlwork --ieee=synopsys tb > output.txt
|
|
''
|
|
)
|
|
+ ''
|
|
diff output.txt ${./expected-output.txt} && touch $out
|
|
'';
|
|
}
|