Skip to content

Commit

Permalink
libero: properly escape string parameters
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
liambeguin committed Dec 29, 2023
1 parent 2f9ca27 commit f8108cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions edalize/templates/libero/libero-syn-user.tcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Libero

{% if vlogparam -%}{%- for k,v in vlogparam.items() %}
set_option -hdl_param -set {{k}}={{ v|generic_value_str(bool_is_str=True) }}
set_option -hdl_param -set {{k}}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }}
{% endfor -%}{%- endif %}
{% if vlogdefine -%}{%- for k,v in vlogdefine.items() %}
set_option -hdl_define -set {{k}}={{ v|generic_value_str(bool_is_str=True) }}
set_option -hdl_define -set {{k}}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }}
{% endfor -%}{%- endif %}
{% if generic -%}
set_option -hdl_param -set {
{%- for k, v in generic.items() %}{{ k }}={{ v|generic_value_str(bool_is_str=True) }} {% endfor -%}
{%- for k, v in generic.items() %}{{ k }}={{ v|generic_value_str(str_quote_style="\"", bool_is_str=True) }} {% endfor -%}
}
{%- endif %}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_libero/libero-test-all-syn-user.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

set_option -hdl_param -set vlogparam_bool=true
set_option -hdl_param -set vlogparam_int=42
set_option -hdl_param -set vlogparam_str=hello
set_option -hdl_param -set vlogparam_str="hello"
set_option -hdl_define -set vlogdefine_bool=true
set_option -hdl_define -set vlogdefine_int=42
set_option -hdl_define -set vlogdefine_str=hello
set_option -hdl_define -set vlogdefine_str="hello"

set_option -include_path {../../.}
4 changes: 2 additions & 2 deletions tests/test_libero/libero-test-syn-user.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

set_option -hdl_param -set vlogparam_bool=true
set_option -hdl_param -set vlogparam_int=42
set_option -hdl_param -set vlogparam_str=hello
set_option -hdl_param -set vlogparam_str="hello"
set_option -hdl_define -set vlogdefine_bool=true
set_option -hdl_define -set vlogdefine_int=42
set_option -hdl_define -set vlogdefine_str=hello
set_option -hdl_define -set vlogdefine_str="hello"

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

0 comments on commit f8108cc

Please sign in to comment.