{% for file in includes %}
ahdl_include "{{ file }}"
{% endfor %}

{% for option in options %}
{{ option }}
{% endfor %}

* Power Supply
VGND vgd 0 vsource dc={{ vgd }} type=dc
VDD vdd 0 vsource dc={{ vdd }} type=dc
VSG vsgd 0 vsource dc= {{ vsgd }} type=dc

* Clock
VCLK clk vgd vsource type=pulse val0={{ vgd }} val1={{ vdd }} period={{ period }} rise={{ rise_time }} fall={{ fall_time }}

* Input Signal
VS u vgd vsource type=sine sinedc={{  input['offset'] }} ampl={{ input['amplitude'] }} freq={{ input["freq"] }} mag=1

* Analog frontend
analog_frontend {% for input in analog_frontend['inputs'] %}{{ input }}{% endfor %} {% for output in analog_frontend['outputs'] %}{{ output }}{% endfor %} {{ analog_frontend['name'] }}

tran tran cmin=0 stop={{ t_stop }} strobefreq={{ strobefreq }} strobedelay={{ strobedelay }}
save {% for var in save_variables %}{{ var }}{% endfor %}
