diff --git a/fpga_device_manager/Config.py b/fpga_device_manager/Config.py index 182e8e3159b55bb6bd7e5e0a06db5453563873b8..c054e96a72aaa96e517223be3c2e669f879e8500 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 0000000000000000000000000000000000000000..c126d5475ec6c5050e5dff9ec105577a5ad1b5b8 --- /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