Skip to content

Commit

Permalink
scripts: add a line-count statistic script
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwljwljwljw committed Jul 20, 2020
1 parent d2cf343 commit cba8f45
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/statistics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mymap = {}
last = ""

with open("../build/XSSimTop.v", "r") as f:
line = f.readline()
cnt = 0
while(line):
if "module " in line:
if last!="" :
mymap[last] = cnt
last = line[6:-2]
cnt = 1
else:
cnt = cnt + 1
line = f.readline()
for k,v in mymap.items():
print(k, v)

0 comments on commit cba8f45

Please sign in to comment.