Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Display memory read/write stats

  • Loading branch information...
commit 7dda0b9ab344ba19a15e918f2d32ce7d62449bb3 1 parent 7330f84
Sébastien Bourdeauducq authored July 11, 2011

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. 10  tools/memadr_stats.py
10  tools/memadr_stats.py
@@ -74,13 +74,21 @@ def print_page_hits(p, adrs):
74 74
 
75 75
 print "=======    Reading input...   ======="
76 76
 transaction_count = 0
  77
+write_count = 0
77 78
 unordered_adrs = []
78 79
 for line in sys.stdin:
79  
-	unordered_adrs.append(int(line, 16) >> 2) # express address in 32-bit words
  80
+	adr = int(line, 16) >> 2 # express address in 32-bit words
  81
+	unordered_adrs.append(adr)
  82
+	if extract_bits(adr, param_capacity-2, 1) == 1:
  83
+		write_count = write_count + 1
80 84
 	transaction_count += 1
81 85
 
82 86
 print "...done."
83 87
 print "Transaction count: %d" % transaction_count
  88
+print "Writes:            %d%%" % (100*write_count/transaction_count)
  89
+print "Reads:             %d%%" % (100*(transaction_count-write_count)/transaction_count)
  90
+if write_count != 0:
  91
+	print "Reads/Writes:      %.2f" % (float(transaction_count-write_count)/float(write_count))
84 92
 
85 93
 print "=======    Full reordering    ======="
86 94
 print "(window size, page hit rate, utilization)"

0 notes on commit 7dda0b9

Please sign in to comment.
Something went wrong with that request. Please try again.