specials/Instance: add PreformattedParam
This commit is contained in:
parent
29f7b94e37
commit
fa741f54fd
|
@ -86,6 +86,8 @@ class Instance(Special):
|
||||||
def __init__(self, name, value):
|
def __init__(self, name, value):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.value = value
|
self.value = value
|
||||||
|
class PreformattedParam(str):
|
||||||
|
pass
|
||||||
|
|
||||||
def __init__(self, of, *items, name="", **kwargs):
|
def __init__(self, of, *items, name="", **kwargs):
|
||||||
Special.__init__(self)
|
Special.__init__(self)
|
||||||
|
@ -135,6 +137,8 @@ class Instance(Special):
|
||||||
r += verilog_printexpr(ns, p.value)[0]
|
r += verilog_printexpr(ns, p.value)[0]
|
||||||
elif isinstance(p.value, float):
|
elif isinstance(p.value, float):
|
||||||
r += str(p.value)
|
r += str(p.value)
|
||||||
|
elif isinstance(p.value, Instance.PreformattedParam):
|
||||||
|
r += p.value
|
||||||
elif isinstance(p.value, str):
|
elif isinstance(p.value, str):
|
||||||
r += "\"" + p.value + "\""
|
r += "\"" + p.value + "\""
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue