HeavyX/examples/simplesoc_ecp5.nix

28 lines
772 B
Nix
Raw Normal View History

2019-06-06 17:25:11 +08:00
{ pkgs, hx }:
2019-05-02 12:53:28 +08:00
let
symbiflowInput = pkgs.runCommand "simplesoc-symbiflow-input" {
2019-06-06 17:25:11 +08:00
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.drvs.nmigen hx.drvs.heavycomps hx.drvs.minerva])) hx.drvs.yosys ];
2019-05-02 12:53:28 +08:00
}
''
mkdir $out
2019-06-06 18:11:54 +08:00
python ${./simplesoc_ecp5.py} ${hx.drvs.fw-helloworld}/helloworld.bin $out/top.il
2019-05-02 12:53:28 +08:00
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;
2019-06-07 23:17:19 +08:00
LOCATE COMP "led" SITE "E16";
IOBUF PORT "led" IO_TYPE=LVCMOS25;
2019-05-02 12:53:28 +08:00
EOF
2019-05-06 22:44:58 +08:00
echo -n "--um-45k --speed 8 --package CABGA381" > $out/device
2019-05-02 12:53:28 +08:00
'';
in
2019-06-06 17:25:11 +08:00
hx.lib.symbiflow.buildBitstream {
2019-05-02 12:53:28 +08:00
name = "simplesoc-bitstream";
src = symbiflowInput;
}