HeavyX/examples/helloworld_ecp5.nix

27 lines
683 B
Nix
Raw Normal View History

2019-04-26 18:21:47 +08:00
{ pkgs ? import <nixpkgs> {}
, hx ? import ../default.nix { inherit pkgs; }}:
let
symbiflowInput = pkgs.runCommand "helloworld-symbiflow-input" {
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.nmigen hx.heavycomps])) hx.yosys ];
}
''
mkdir $out
python ${./helloworld_ecp5.py} > $out/top.il
cat > $out/top.lpf << EOF
2019-04-27 14:39:34 +08:00
LOCATE COMP "clk100" SITE "P3";
IOBUF PORT "clk100" IO_TYPE=LVDS;
LOCATE COMP "serial_tx" SITE "C11";
IOBUF PORT "serial_tx" IO_TYPE=LVCMOS33;
2019-04-26 18:21:47 +08:00
EOF
echo -n "--um-45k --package CABGA381" > $out/device
'';
in
hx.symbiflow.buildBitstream {
name = "helloworld-bitstream";
src = symbiflowInput;
}