projects
/
sv2nmigen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup, add example output
[sv2nmigen.git]
/
absyn.py
diff --git
a/absyn.py
b/absyn.py
index d52250206719fbefcd53b2dba3c660b529f8ef9a..6ccbb0529944f48fcc57d1578f573bfcd8cffd10 100644
(file)
--- a/
absyn.py
+++ b/
absyn.py
@@
-39,8
+39,8
@@
class Assignment:
self.right = right
class Absyn:
self.right = right
class Absyn:
- def __init__(self):
- self.outputfile = open(
"output.py"
,"w")
+ def __init__(self
,outputfn
):
+ self.outputfile = open(
outputfn
,"w")
self.outputfile.write(preamble)
self.assign = []
self.ports = []
self.outputfile.write(preamble)
self.assign = []
self.ports = []
@@
-147,7
+147,12
@@
class Absyn:
print(str(clsdecl))
return clsdecl
print(str(clsdecl))
return clsdecl
+ def appendComments(self,data):
+ lines = data.split("\n")
+ for line in lines:
+ self.printpy("#"+line)
+
# combinatorical assign
def cont_assign_1(self,p):
# combinatorical assign
def cont_assign_1(self,p):
- print("#ASSIGN:BROKEN"+str(list(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])]