Skip to content

Commit

Permalink
Separate filters for generics and parameters and change boolean handl…
Browse files Browse the repository at this point in the history
…ing for older Quartus
  • Loading branch information
GCHQDeveloper560 authored and olofk committed Apr 10, 2019
1 parent 4f97345 commit 5964167
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion edalize/edatool.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def __init__(self, edam=None, work_root=None, eda_api=None):
trim_blocks = True,
lstrip_blocks = True,
)
self.jinja_env.filters['param_value_str'] = jinja_filter_param_value_str
self.jinja_env.filters['param_value_str'] = jinja_filter_param_value_str
self.jinja_env.filters['generic_value_str'] = jinja_filter_param_value_str

@classmethod
def get_doc(cls, api_ver):
Expand Down
6 changes: 6 additions & 0 deletions edalize/quartus.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ def __init__(self, edam=None, work_root=None, eda_api=None):

self.isPro = (version['edition'] == "Pro")

# Quartus Pro 17 and later use 1/0 for boolean generics. Other editions
# and versions use "true"/"false" strings
if (version['edition'] != "Pro") or (int(version['major']) < 17):
self.jinja_env.filters['generic_value_str'] = \
partial(self.jinja_env.filters['generic_value_str'], bool_is_str=True)

""" Configuration is the first phase of the build
This writes the project TCL files and Makefile. It first collects all
Expand Down
2 changes: 1 addition & 1 deletion edalize/templates/quartus/quartus-project.tcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set_parameter -name {{k}} {{v|param_value_str}}
{% endif %}
{% if generic %}
{% for k, v in generic.items() %}
set_parameter -name {{k}} {{v|param_value_str}}
set_parameter -name {{k}} {{v|generic_value_str}}
{% endfor %}
{% endif %}
{% if vlogdefine %}
Expand Down

0 comments on commit 5964167

Please sign in to comment.