From f8108cce63a3d3c0dcf70cdb2408c24b3015a046 Mon Sep 17 00:00:00 2001 From: Liam Beguin Date: Fri, 29 Dec 2023 00:17:28 -0500 Subject: [PATCH] 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 --- edalize/templates/libero/libero-syn-user.tcl.j2 | 6 +++--- tests/test_libero/libero-test-all-syn-user.tcl | 4 ++-- tests/test_libero/libero-test-syn-user.tcl | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/edalize/templates/libero/libero-syn-user.tcl.j2 b/edalize/templates/libero/libero-syn-user.tcl.j2 index 885812e3d..dece16704 100644 --- a/edalize/templates/libero/libero-syn-user.tcl.j2 +++ b/edalize/templates/libero/libero-syn-user.tcl.j2 @@ -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 %} diff --git a/tests/test_libero/libero-test-all-syn-user.tcl b/tests/test_libero/libero-test-all-syn-user.tcl index 36f43baaa..962ce7e62 100644 --- a/tests/test_libero/libero-test-all-syn-user.tcl +++ b/tests/test_libero/libero-test-all-syn-user.tcl @@ -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 {../../.} diff --git a/tests/test_libero/libero-test-syn-user.tcl b/tests/test_libero/libero-test-syn-user.tcl index 36f43baaa..962ce7e62 100644 --- a/tests/test_libero/libero-test-syn-user.tcl +++ b/tests/test_libero/libero-test-syn-user.tcl @@ -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 {../../.}