Skip to content
Snippets Groups Projects
Commit 6bc15051 authored by Julian's avatar Julian
Browse files

Add smarthome.lpf template

parent c4b1ab6d
No related branches found
No related tags found
No related merge requests found
......@@ -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())
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment