Merge pull request #8 from seldridge/master
Fix FPGA/VLSI Mem Gen for Python 2 and 3 Environments
This commit is contained in:
commit
12d8d8c5e3
@ -53,7 +53,7 @@ def parse_line(line):
|
|||||||
mask_gran = 1
|
mask_gran = 1
|
||||||
tokens = line.split()
|
tokens = line.split()
|
||||||
i = 0
|
i = 0
|
||||||
for i in xrange(0,len(tokens),2):
|
for i in range(0,len(tokens),2):
|
||||||
s = tokens[i]
|
s = tokens[i]
|
||||||
if s == 'name':
|
if s == 'name':
|
||||||
name = tokens[i+1]
|
name = tokens[i+1]
|
||||||
@ -188,7 +188,7 @@ def main():
|
|||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
sys.exit('Please give a .conf file as input')
|
sys.exit('Please give a .conf file as input')
|
||||||
for line in open(sys.argv[1]):
|
for line in open(sys.argv[1]):
|
||||||
print gen_mem(*parse_line(line))
|
print(gen_mem(*parse_line(line)))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -15,7 +15,7 @@ def parse_line(line):
|
|||||||
mask_gran = 1
|
mask_gran = 1
|
||||||
tokens = line.split()
|
tokens = line.split()
|
||||||
i = 0
|
i = 0
|
||||||
for i in xrange(0,len(tokens),2):
|
for i in range(0,len(tokens),2):
|
||||||
s = tokens[i]
|
s = tokens[i]
|
||||||
if s == 'name':
|
if s == 'name':
|
||||||
name = tokens[i+1]
|
name = tokens[i+1]
|
||||||
@ -130,7 +130,7 @@ def gen_mem(name, width, depth, ports):
|
|||||||
%s\n\
|
%s\n\
|
||||||
end\n\
|
end\n\
|
||||||
%s\n" % ('\n '.join(decl), '\n '.join(sequential), '\n '.join(combinational))
|
%s\n" % ('\n '.join(decl), '\n '.join(sequential), '\n '.join(combinational))
|
||||||
|
|
||||||
s = "module %s(\n\
|
s = "module %s(\n\
|
||||||
%s\n\
|
%s\n\
|
||||||
);\n\
|
);\n\
|
||||||
@ -144,7 +144,7 @@ def main():
|
|||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
sys.exit('Please give a .conf file as input')
|
sys.exit('Please give a .conf file as input')
|
||||||
for line in open(sys.argv[1]):
|
for line in open(sys.argv[1]):
|
||||||
print gen_mem(*parse_line(line))
|
print(gen_mem(*parse_line(line)))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user