Skip to content

Instantly share code, notes, and snippets.

@Taormina
Created April 24, 2013 22:23
Show Gist options
  • Save Taormina/5456107 to your computer and use it in GitHub Desktop.
Save Taormina/5456107 to your computer and use it in GitHub Desktop.
A script that generates the validations for CS4290 Project 3 as quickly as possible. If a diff actually prints something, then that validation failed.
import os, threading
class ThreadClass(threading.Thread):
def __init__(self, p, c):
super(ThreadClass, self).__init__()
self.p = p
self.c = c
def run(self):
trace_location = "traces/" + self.c + "proc_validation"
file_name = "validation/" + self.p + "_" + self.c
os.system("./sim_trace -t " + trace_location+ " -p" + self.p + " 2> " + file_name)
os.system("diff " + trace_location + "/"+ self.p + "_validation.txt " + file_name)
print file_name + " done!"
protocols = ["MI", "MSI", "MOSI", "MESI", "MOESI", "MOESIF"]
cores = ["4", "8", "16"]
os.system("rm validation/*;")
for p in protocols:
for c in cores:
t = ThreadClass(p, c)
t.start()
Copy link

ghost commented Apr 26, 2013

Yay :) someone has too much free time on their hands :-P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment