Skip to content

Commit f8108cc

Browse files
committed
libero: properly escape string parameters
This was causing string parameters to be ignored during synthesis, preventing things like: fusesoc run servant --target=polarfire_splashkit --memfile=anything.hex Signed-off-by: Liam Beguin <[email protected]>
1 parent 2f9ca27 commit f8108cc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

edalize/templates/libero/libero-syn-user.tcl.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# Libero
44

55
{% if vlogparam -%}{%- for k,v in vlogparam.items() %}
6-
set_option -hdl_param -set {{k}}={{ v|generic_value_str(bool_is_str=True) }}
6+
set_option -hdl_param -set {{k}}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }}
77
{% endfor -%}{%- endif %}
88
{% if vlogdefine -%}{%- for k,v in vlogdefine.items() %}
9-
set_option -hdl_define -set {{k}}={{ v|generic_value_str(bool_is_str=True) }}
9+
set_option -hdl_define -set {{k}}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }}
1010
{% endfor -%}{%- endif %}
1111
{% if generic -%}
1212
set_option -hdl_param -set {
13-
{%- for k, v in generic.items() %}{{ k }}={{ v|generic_value_str(bool_is_str=True) }} {% endfor -%}
13+
{%- for k, v in generic.items() %}{{ k }}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }} {% endfor -%}
1414
}
1515
{%- endif %}
1616

tests/test_libero/libero-test-all-syn-user.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
set_option -hdl_param -set vlogparam_bool=true
66
set_option -hdl_param -set vlogparam_int=42
7-
set_option -hdl_param -set vlogparam_str=hello
7+
set_option -hdl_param -set vlogparam_str="hello"
88
set_option -hdl_define -set vlogdefine_bool=true
99
set_option -hdl_define -set vlogdefine_int=42
10-
set_option -hdl_define -set vlogdefine_str=hello
10+
set_option -hdl_define -set vlogdefine_str="hello"
1111

1212
set_option -include_path {../../.}

tests/test_libero/libero-test-syn-user.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
set_option -hdl_param -set vlogparam_bool=true
66
set_option -hdl_param -set vlogparam_int=42
7-
set_option -hdl_param -set vlogparam_str=hello
7+
set_option -hdl_param -set vlogparam_str="hello"
88
set_option -hdl_define -set vlogdefine_bool=true
99
set_option -hdl_define -set vlogdefine_int=42
10-
set_option -hdl_define -set vlogdefine_str=hello
10+
set_option -hdl_define -set vlogdefine_str="hello"
1111

1212
set_option -include_path {../../.}

0 commit comments

Comments
 (0)