aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-utils.stanza
diff options
context:
space:
mode:
authorazidar2015-08-20 15:31:22 -0700
committerazidar2015-08-20 15:31:22 -0700
commit169164c3ad828ccae89c43d4bdbb531f3a2e6237 (patch)
tree4eadf26bb6c5c102633c524ab11a4ddd039e79ab /src/main/stanza/ir-utils.stanza
parentc50afcbdd1a6a2835aaa97d28412d7b913193135 (diff)
Added Poison node. Includes tests. #26.
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
-rw-r--r--src/main/stanza/ir-utils.stanza4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 8f260e8c..3e375e81 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -71,6 +71,7 @@ public defn get-sym-hash (m:InModule,keywords:Streamable<Symbol>) -> HashTable<S
(s:DefInstance) : add-name(name(s))
(s:DefMemory) : add-name(name(s))
(s:DefNode) : add-name(name(s))
+ (s:DefPoison) : add-name(name(s))
(s:DefAccessor) : add-name(name(s))
(s) : false
map(to-stmt,s)
@@ -219,6 +220,8 @@ defmethod print (o:OutputStream, e:Expression) :
defmethod print (o:OutputStream, c:Stmt) :
val io = IndentedStream(o, 3)
match(c) :
+ (c:DefPoison) :
+ print-all(o,["poison " name(c) " : " type(c)])
(c:DefWire) :
print-all(o,["wire " name(c) " : " type(c)])
(c:DefRegister) :
@@ -381,6 +384,7 @@ defmethod map (f: Type -> Type, c:Expression) -> Expression :
public defmulti map<?T> (f: Type -> Type, c:?T&Stmt) -> T
defmethod map (f: Type -> Type, c:Stmt) -> Stmt :
match(c) :
+ (c:DefPoison) : DefPoison(info(c),name(c),f(type(c)))
(c:DefWire) : DefWire(info(c),name(c),f(type(c)))
(c:DefRegister) : DefRegister(info(c),name(c),f(type(c)),clock(c),reset(c))
(c:DefMemory) : DefMemory(info(c),name(c),f(type(c)) as VectorType,seq?(c),clock(c))