Skip to content

Commit c7e5369

Browse files
committed
openflow: re-added VHDL support (WIP)
1 parent 7851b97 commit c7e5369

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pyfpga/templates/openflow.jinja

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ DOCKER="docker run --user $(id -u):$(id -g) --rm -v $HOME:$HOME -w $PWD"
1313
{% if 'syn' in steps %}# Synthesis
1414
$DOCKER hdlc/ghdl:yosys /bin/bash -c "
1515
{% if hooks %}{{ hooks.presyn | join('\n') }}{% endif %}
16+
17+
{% set gflags = '--std=08 -fsynopsys -fexplicit -frelaxed' %}
18+
{% if files %}# Files inclusion
19+
{% for name, attr in files.items() %}
20+
{% if attr.hdl == "vhdl" %}
21+
ghdl -a {{ gflags }}{% if 'lib' in attr %} --work={{ attr.lib }}{% endif %} {{ name }}
22+
{% endif %}
23+
{% endfor %}
24+
{% endif %}
25+
ghdl -a --std=08 -fsynopsys -fexplicit -frelaxed /home/rodrigo/repos-ram/PyFPGA/pyfpga/examples/sources/vhdl/top.vhdl
26+
1627
yosys -Q -m ghdl -p '
1728

1829
{% if includes %}# Verilog Includes
@@ -29,13 +40,21 @@ verilog_defines{% for key, value in defines.items() %} -D{{ key }}={{ value }}{%
2940
read_verilog -defer {{ name }}
3041
{% elif attr.hdl == "slog" %}
3142
read_verilog -defer -sv {{ name }}
43+
{% elif attr.hdl == "vhdl" %}
44+
{% if loop.first %}
45+
# VHDL Generics
46+
{% set generics = "-gFREQ=125000000 -gSECS=1" %}
47+
ghdl {{ gflags }} {{ generics }} {{ top }}
48+
{% endif %}
3249
{% endif %}
3350
{% endfor %}
3451
{% endif %}
3552

36-
{% if params %}# Verilog Parameters / VHDL Generics
53+
{#
54+
{% if params %}# Verilog Parameters
3755
chparam{% for key, value in params.items() %} -set {{ key }} {{ value }}{% endfor %}
3856
{% endif %}
57+
#}
3958

4059
# Top-level specification and Syntesis
4160
{% if family in ['ice40', 'ecp5'] %}

0 commit comments

Comments
 (0)