27 lines
691 B
Nix
27 lines
691 B
Nix
|
{ pkgs ? import <nixpkgs> {}
|
||
|
, hx ? import ../default.nix { inherit pkgs; }}:
|
||
|
|
||
|
let
|
||
|
symbiflowInput = pkgs.runCommand "simplesoc-symbiflow-input" {
|
||
|
buildInputs = [ (pkgs.python3.withPackages(ps: [hx.nmigen hx.heavycomps hx.minerva])) hx.yosys ];
|
||
|
}
|
||
|
''
|
||
|
mkdir $out
|
||
|
|
||
|
python ${./simplesoc_ecp5.py} > $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;
|
||
|
EOF
|
||
|
|
||
|
echo -n "--um-45k --package CABGA381" > $out/device
|
||
|
'';
|
||
|
in
|
||
|
hx.symbiflow.buildBitstream {
|
||
|
name = "simplesoc-bitstream";
|
||
|
src = symbiflowInput;
|
||
|
}
|