4 """Simple script that scans all of the simulator output text fed in
5 through stdin and summarises the total number of system clock ticks."""
8 lines = sys.stdin.readlines()
15 # 'n words read from ...', where = # bytes in hex file
16 if (re.search(r'words read from', line)):
17 (data, post) = re.split(r'w', line, 1)
18 bytes = string.atoi(data)
20 # 'Total time since last reset= 0.102021 sec (i clks)',
21 # where i = # system clock ticks.
22 if (re.search(r'^Total time', line)):
23 (pre, data) = re.split(r'\(', line)
24 (nticks, post) = re.split(r' ', data)
25 ticks = string.atoi(nticks)
27 print "\n--- Simulator: %d/%d: %d bytes, %d ticks" % (bytes, ticks, bytes, ticks)