4 from nmigen
.build
import *
5 from nmigen
.vendor
.xilinx_7series
import *
6 from .resources
import *
9 __all__
= ["KC705Platform"]
12 class KC705Platform(Xilinx7SeriesPlatform
):
16 default_clk
= "clk156"
18 Resource("clk156", 0, DiffPairs("K28", "K29", dir="i"),
19 Clock(156e6
), Attrs(IOSTANDARD
="LVDS_25")),
21 *LEDResources(pins
="AB8 AA8 AC9 AB9 AE26 G19 E18 F16",
22 attrs
=Attrs(IOSTANDARD
="LVCMOS15")),
26 attrs
=Attrs(IOSTANDARD
="LVCMOS33")
31 def toolchain_program(self
, products
, name
):
32 openocd
= os
.environ
.get("OPENOCD", "openocd")
33 with products
.extract("{}.bit".format(name
)) as bitstream_filename
:
34 subprocess
.check_call([openocd
,
35 "-c", "source [find board/kc705.cfg]; init; pld load 0 {}; exit"
36 .format(bitstream_filename
)
40 if __name__
== "__main__":
41 from .test
.blinky
import *
42 KC705Platform().build(Blinky(), do_program
=True)