vendor.intel: double-quote Tcl values rather than brace-quoting.
For unknown reasons, Quartus treats {foo} and "foo" in completely
different ways, which is not true for normal Tcl code; specifically,
it preserves the braces if they are used. Because of this, since
commit 6cee2804, the vendor.intel package was completely broken.
This commit is contained in:
parent
702e41ba3c
commit
7238e58224
2 changed files with 11 additions and 7 deletions
|
|
@ -388,6 +388,9 @@ class TemplatedPlatform(Platform):
|
|||
def tcl_escape(string):
|
||||
return "{" + re.sub(r"([{}\\])", r"\\\1", string) + "}"
|
||||
|
||||
def tcl_quote(string):
|
||||
return '"' + re.sub(r"([$[\\])", r"\\\1", string) + '"'
|
||||
|
||||
def verbose(arg):
|
||||
if "NMIGEN_verbose" in os.environ:
|
||||
return arg
|
||||
|
|
@ -409,6 +412,7 @@ class TemplatedPlatform(Platform):
|
|||
compiled.environment.filters["hierarchy"] = hierarchy
|
||||
compiled.environment.filters["ascii_escape"] = ascii_escape
|
||||
compiled.environment.filters["tcl_escape"] = tcl_escape
|
||||
compiled.environment.filters["tcl_quote"] = tcl_quote
|
||||
except jinja2.TemplateSyntaxError as e:
|
||||
e.args = ("{} (at {}:{})".format(e.message, origin, e.lineno),)
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue