From 6bc15051edfc939b830874b7414714c273c0dcb3 Mon Sep 17 00:00:00 2001 From: Julian Leucker <leuckerj@gmail.com> Date: Fri, 10 Jul 2020 17:18:22 +0200 Subject: [PATCH] Add smarthome.lpf template --- fpga_device_manager/Config.py | 3 +++ .../res/vtemplates/smarthome.lpf.tpl | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 fpga_device_manager/res/vtemplates/smarthome.lpf.tpl diff --git a/fpga_device_manager/Config.py b/fpga_device_manager/Config.py index 182e8e3..c054e96 100644 --- a/fpga_device_manager/Config.py +++ b/fpga_device_manager/Config.py @@ -129,6 +129,7 @@ def export(out_path: str) -> None: # Gather and enumerate used pins output_pins = [pin for pin in Pins.all() if pin.is_output()] input_pins = [pin for pin in Pins.all() if pin.is_input()] + pins = Pins.all() # Reverse lookup tables for pin indices output_pin_indices = {pin.name: index for index, pin in enumerate(output_pins)} @@ -172,6 +173,8 @@ def export(out_path: str) -> None: timestamp=out_timestamp, device_count=len(input_devices), pins=input_pins), + "smarthome.lpf": tpl_loader.render("smarthome.lpf.tpl", + pins=pins), "smarthome.ldf": tpl_loader.render("smarthome.ldf.tpl", device_types=output_device_types.values(), input_types=input_device_types.values()) diff --git a/fpga_device_manager/res/vtemplates/smarthome.lpf.tpl b/fpga_device_manager/res/vtemplates/smarthome.lpf.tpl new file mode 100644 index 0000000..c126d54 --- /dev/null +++ b/fpga_device_manager/res/vtemplates/smarthome.lpf.tpl @@ -0,0 +1,15 @@ +BLOCK RESETPATHS ; +BLOCK ASYNCPATHS ; +IOBUF PORT "SDA" OPENDRAIN=ON IO_TYPE=LVCMOS33 PULLMODE=NONE DRIVE=8 SLEWRATE=SLOW CLAMP=OFF DIFFRESISTOR=OFF HYSTERESIS=SMALL ; +LOCATE COMP "SCL" SITE "5" ; +IOBUF PORT "SCL" IO_TYPE=LVCMOS33 ; +LOCATE COMP "SDA" SITE "24" ; + +{% for pin in pins %} + +// pin {{ pin.display_name }} on physical pin {{ pin.name }} +LOCATE COMP "pin_{{ pin.name }}" SITE "{{ pin.name }}" ; +{% if pin.voltage %}IOBUF PORT "pin_{{ pin.name }}" IO_TYPE=LVCMOS33 ;{% endif %} +{% endfor %} + +LOCATE COMP "btn_reset" SITE "28" ; \ No newline at end of file -- GitLab