Skip to content

Commit

Permalink
edatool: Use lowercase for boolean strings
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Jun 26, 2019
1 parent 84cdfa9 commit 91c6572
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions edalize/edatool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def jinja_filter_param_value_str(value, str_quote_style="", bool_is_str=False):
- Everything else (including int, float, etc.) are converted using the str()
function.
"""
if (type(value) == bool) and not bool_is_str:
if (value) == True:
return '1'
if type(value) == bool:
if bool_is_str:
return 'true' if value else 'false'
else:
return '0'
return '1' if value else '0'
elif type(value) == str or ((type(value) == bool) and bool_is_str):
return str_quote_style + str(value) + str_quote_style
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vivado/test_vivado_0.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set_property part xc7a35tcsg324-1 [current_project]
#Default since Vivado 2016.1
set_param project.enableVHDL2008 1
set_property generic {vlogparam_bool=1 vlogparam_int=42 vlogparam_str=hello } [get_filesets sources_1]
set_property generic {generic_bool=True generic_int=42 generic_str=hello } [get_filesets sources_1]
set_property generic {generic_bool=true generic_int=42 generic_str=hello } [get_filesets sources_1]
set_property verilog_define {vlogdefine_bool=1 vlogdefine_int=42 vlogdefine_str=hello } [get_filesets sources_1]
read_verilog -sv sv_file.sv
source tcl_file.tcl
Expand Down

0 comments on commit 91c6572

Please sign in to comment.