summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2004-08-18 23:12:16 -0400
committerAli Saidi <saidi@eecs.umich.edu>2004-08-18 23:12:16 -0400
commit7a1f4969ca9ef010f6861eb806cfc10929a70146 (patch)
tree6be007c19293dd45bc14e68fe7cb9c0abf97ffac
parent9d4ee7acaa930811bbb8e28894a96fd371702ef4 (diff)
downloadgem5-7a1f4969ca9ef010f6861eb806cfc10929a70146.tar.xz
added nate's memtest code to devtime
util/ccdrv/devtime.c: incorperated nate's changes for memory testing. --HG-- extra : convert_revision : 6c479dd6b9a79659bb4cfd3e03b794909b14db3b
-rw-r--r--util/ccdrv/devtime.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/util/ccdrv/devtime.c b/util/ccdrv/devtime.c
index e487f2fe7..62b0e2592 100644
--- a/util/ccdrv/devtime.c
+++ b/util/ccdrv/devtime.c
@@ -48,6 +48,9 @@
static char *dataAddr = NULL;
static int count = 0;
+#ifdef __alpha__
+static int memTest = 0;
+#endif
static inline uint32_t cycleCounter(uint32_t dep);
@@ -63,6 +66,31 @@ static int __init devtime_start(void)
printk("Devtime Driver Version %s Loaded...\n", DRIVER_VER);
+#ifdef __alpha__
+ if (memTest) {
+ addr = 0xfffffc0000000000;
+// addr += 16*1024*1024;
+
+ printk("Preparing memory test.\n");
+
+ t1 = cycleCounter(trash);
+ for (x = 0; x < count; x++) {
+ trash = readl(addr);
+ t2 = cycleCounter(trash);
+ times[num++] = t2 - t1;
+ t1 = t2;
+ addr += 4096;
+ }
+
+ printk("Measurements:\n");
+ for (x = 0; x < count; x++) {
+ printk("%d ", times[x]);
+ if (((x + 1) % 10) == 0)
+ printk("\n");
+ }
+ printk("\nDone.\n");
+ } else
+#endif
if (dataAddr != 0 && count != 0) {
addr = simple_strtoull(dataAddr, NULL, 0);
@@ -145,7 +173,7 @@ inline uint32_t cycleCounter(uint32_t dep)
return res;
}
#else
-#error Architecture NOT SUPPORTE
+#error Architecture NOT SUPPORTED
#endif
static void __exit devtime_end(void)
@@ -162,3 +190,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
module_param(dataAddr, charp, 0);
module_param(count, int, 0);
+#ifdef __alpha__
+module_param(memTest, int, 0);
+#endif