specials/Instance: add PreformattedParam

This commit is contained in:
Sebastien Bourdeauducq 2013-11-25 12:09:51 +01:00
parent 29f7b94e37
commit fa741f54fd
1 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,8 @@ class Instance(Special):
def __init__(self, name, value):
self.name = name
self.value = value
class PreformattedParam(str):
pass
def __init__(self, of, *items, name="", **kwargs):
Special.__init__(self)
@ -135,6 +137,8 @@ class Instance(Special):
r += verilog_printexpr(ns, p.value)[0]
elif isinstance(p.value, float):
r += str(p.value)
elif isinstance(p.value, Instance.PreformattedParam):
r += p.value
elif isinstance(p.value, str):
r += "\"" + p.value + "\""
else: