3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-29 20:59:03 +00:00

pyosys: restore remaining log functions

Co-authored-by: George Rennie <19538554+georgerennie@users.noreply.github.com>
This commit is contained in:
Mohamed Gaber 2025-09-15 17:02:11 +03:00 committed by Lofty
parent 9fa27dae3c
commit 1fa5ceee8c
2 changed files with 12 additions and 2 deletions

View file

@ -632,12 +632,17 @@ class Attribute:
arg.wtype.attr_type = attr_types.amp
arg.varname = arg.varname[1:]
# special exception: format strings
# handle string views
if arg.wtype.name in ["std::string_view", "string_view"]:
if arg.varname == "format":
if arg.varname == "format" and owner_fn_name.startswith("log_"):
# coerce format strings to "%s" (not bridgable)
arg.coerce_arg = '"%s"'
elif arg.varname == "prefix" and "warning" in owner_fn_name:
# coerce warning prefix to "warning:"
arg.coerce_arg = '"Warning: "'
else:
# boost::python can't bridge string views, so just copy them
arg.wtype.name = "string"
return arg