HeavyX/examples/simplesoc_ecp5.nix

28 lines
772 B
Nix

{ pkgs, hx }:
let
symbiflowInput = pkgs.runCommand "simplesoc-symbiflow-input" {
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.drvs.nmigen hx.drvs.heavycomps hx.drvs.minerva])) hx.drvs.yosys ];
}
''
mkdir $out
python ${./simplesoc_ecp5.py} ${hx.drvs.fw-helloworld}/helloworld.bin $out/top.il
cat > $out/top.lpf << EOF
LOCATE COMP "clk100" SITE "P3";
IOBUF PORT "clk100" IO_TYPE=LVDS;
LOCATE COMP "serial_tx" SITE "A11";
IOBUF PORT "serial_tx" IO_TYPE=LVCMOS33;
LOCATE COMP "led" SITE "E16";
IOBUF PORT "led" IO_TYPE=LVCMOS25;
EOF
echo -n "--um-45k --speed 8 --package CABGA381" > $out/device
'';
in
hx.lib.symbiflow.buildBitstream {
name = "simplesoc-bitstream";
src = symbiflowInput;
}