projects
/
sv2nmigen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert always_comb assignments
[sv2nmigen.git]
/
absyn.py
diff --git
a/absyn.py
b/absyn.py
index a199daa4da6846ebe31ddf19fe9015248d712107..ecd3846516ddf89e773c7b3bdb20754cf52e5e8b 100644
(file)
--- a/
absyn.py
+++ b/
absyn.py
@@
-65,7
+65,9
@@
class Absyn:
p = list(p)
if(p[1] == "assign"):
self.printpy(p[4])
p = list(p)
if(p[1] == "assign"):
self.printpy(p[4])
- # m.d.comb += [l.eq(r)]
+
+ def assign3(self, left, op, right):
+ return Assignment(left, op, right)
def indent(self, count):
if(indent_debug):
def indent(self, count):
if(indent_debug):
@@
-148,12
+150,6
@@
class Absyn:
stmts.children.append(Leaf(token.STRING, ")"))
stmts.children.append(self.nl())
stmts.children.append(Leaf(token.STRING, ")"))
stmts.children.append(self.nl())
- # for a in self.assign:
- #
- #
- #ports = a[8]
- #
-
stmts.children.append(self.indent(2))
stmts.children.append(Leaf(token.STRING, "return m"))
stmts.children.append(self.nl())
stmts.children.append(self.indent(2))
stmts.children.append(Leaf(token.STRING, "return m"))
stmts.children.append(self.nl())
@@
-201,5
+197,10
@@
class Absyn:
# combinatorical assign
def cont_assign_1(self, p):
# combinatorical assign
def cont_assign_1(self, p):
- # print("#ASSIGN:BROKEN"+str(list(p)))
self.assign += [Assignment(p[1], p[2], p[3])]
self.assign += [Assignment(p[1], p[2], p[3])]
+
+ def always_comb(self, p3, p1):
+ print("always_comb")
+ slist = p3[6]
+ for s in slist.statements:
+ self.assign += [s]