diff --git a/src/simulator/config/EmulatorConfig.java b/src/simulator/config/EmulatorConfig.java index dc03079..595b4c8 100755 --- a/src/simulator/config/EmulatorConfig.java +++ b/src/simulator/config/EmulatorConfig.java @@ -4,6 +4,7 @@ public class EmulatorConfig { public static CommunicationType communicationType; public static EmulatorType emulatorType; + public static boolean isVISATrace; public static int maxThreadsForTraceCollection = 1024; public static boolean storeExecutionTraceInAFile; diff --git a/src/simulator/config/SystemConfig.java b/src/simulator/config/SystemConfig.java index adf659f..9b71056 100755 --- a/src/simulator/config/SystemConfig.java +++ b/src/simulator/config/SystemConfig.java @@ -31,8 +31,13 @@ public class SystemConfig Bus, Noc } + public static int NUM_BENCHMARKS; + public static int NoOfCores; + public static String benchmarknames[]; // Number of benchmarks + public static String numCountThreads[]; + public static int maxNumJavaThreads; public static int numEmuThreadsPerJavaThread; diff --git a/src/simulator/config/XMLParser.java b/src/simulator/config/XMLParser.java index f612033..aae6f3e 100755 --- a/src/simulator/config/XMLParser.java +++ b/src/simulator/config/XMLParser.java @@ -67,7 +67,7 @@ public class XMLParser createSharedCacheConfigs(); setSimulationParameters(); setEmulatorParameters(); - + setBenchmarks(); setSystemParameters(); FrequencyConfig.setupStepSizes(); @@ -205,6 +205,7 @@ public class XMLParser EmulatorConfig.emulatorType = getEmulatorType(getImmediateString("EmulatorType", emulatorElmnt)); EmulatorConfig.communicationType = getCommunicationType(getImmediateString("CommunicationType", emulatorElmnt)); + EmulatorConfig.isVISATrace = Boolean.parseBoolean(getImmediateString("isVISATrace", emulatorElmnt)); EmulatorConfig.PinTool = getImmediateString("PinTool", emulatorElmnt); EmulatorConfig.PinInstrumentor = getImmediateString("PinInstrumentor", emulatorElmnt); @@ -1124,6 +1125,25 @@ public class XMLParser return ((Node) resultNode.item(0)).getNodeValue(); } + + private static void setBenchmarks() // Get the immediate string value of a particular tag name under a particular parent tag + { + NodeList nodeLst = doc.getElementsByTagName("Benchmark"); + SystemConfig.NUM_BENCHMARKS=nodeLst.getLength(); + SystemConfig.benchmarknames=new String[SystemConfig.NUM_BENCHMARKS]; + SystemConfig.numCountThreads=new String[SystemConfig.NUM_BENCHMARKS]; + + for(int i=0; i< nodeLst.getLength();i++){ + Node node = nodeLst.item(i); + System.out.println(""); + if (node.getNodeType() == Node.ELEMENT_NODE) + { Element eElement = (Element) node; + SystemConfig.benchmarknames[i]=eElement.getElementsByTagName("BenchmarkPath").item(0).getTextContent(); + SystemConfig.numCountThreads[i]=eElement.getElementsByTagName("Threads").item(0).getTextContent(); + } + } + } + private static PortType setPortType(String inputStr) { PortType result = null; diff --git a/src/simulator/config/config.xml b/src/simulator/config/config.xml index 376f77c..8e65add 100755 --- a/src/simulator/config/config.xml +++ b/src/simulator/config/config.xml @@ -31,12 +31,13 @@ TDP = 15W - pin + none - sharedMemory + file + false @@ -84,6 +85,13 @@ TDP = 15W sub 2 + + + + /store/Documents/B_Tech/Semester_7/ACA/Tejas-Dh/traces/qemuTrace/7zip + 2 + + @@ -477,7 +485,7 @@ TDP = 15W NOC - /nfs_home/rajshekar/resources/tejas_configs/config_2core_kabylake_NocConfig.txt + /store/Documents/B_Tech/Semester_7/ACA/Assignments/Assignment_4/NocConfig.txt STATIC 4 FCFS diff --git a/src/simulator/emulatorinterface/RunnableThread.java b/src/simulator/emulatorinterface/RunnableThread.java index c8bd576..8869ac7 100755 --- a/src/simulator/emulatorinterface/RunnableThread.java +++ b/src/simulator/emulatorinterface/RunnableThread.java @@ -116,7 +116,7 @@ public class RunnableThread implements Encoding, Runnable { public void run() { if (EmulatorConfig.emulatorType == EmulatorType.none - && EmulatorConfig.communicationType == CommunicationType.file) { + && EmulatorConfig.communicationType == CommunicationType.file && EmulatorConfig.isVISATrace) { //trace-file based simulation // for(int core = 0; core < maxCoreAssign; core++) diff --git a/src/simulator/emulatorinterface/communication/filePacket/FilePacket.java b/src/simulator/emulatorinterface/communication/filePacket/FilePacket.java index 67c09e7..6378c3e 100755 --- a/src/simulator/emulatorinterface/communication/filePacket/FilePacket.java +++ b/src/simulator/emulatorinterface/communication/filePacket/FilePacket.java @@ -34,9 +34,9 @@ public class FilePacket extends IpcBase implements Encoding { ArrayList pinpointWeights; int cur_slice = 0; String []basenameForBenchmarks; + int count[]=new int[SystemConfig.NUM_BENCHMARKS]; public FilePacket(String []basenameForBenchmarks) { - /* this.maxApplicationThreads = SystemConfig.maxNumJavaThreads*SystemConfig.numEmuThreadsPerJavaThread; this.basenameForBenchmarks = basenameForBenchmarks; @@ -60,10 +60,14 @@ public class FilePacket extends IpcBase implements Encoding { misc.Error.showErrorAndExit(e.getMessage()); } } + + for(int i=0;i< SystemConfig.NUM_BENCHMARKS;i++){ + count[i]=Integer.parseInt(SystemConfig.numCountThreads[i]); + } int numTotalThreads = 0; for (int benchmark=0; benchmark=maxApplicationThreads) { misc.Error.showErrorAndExit("FilePacket cannot handle tid = " + tidApp); } @@ -206,8 +209,6 @@ public class FilePacket extends IpcBase implements Encoding { } return maxSize; - */ - return 0; } public void errorCheck(int tidApp, long totalReads) { diff --git a/src/simulator/emulatorinterface/translator/x86/instruction/InstructionClassTable.java b/src/simulator/emulatorinterface/translator/x86/instruction/InstructionClassTable.java index c2e88bf..bfa13fb 100755 --- a/src/simulator/emulatorinterface/translator/x86/instruction/InstructionClassTable.java +++ b/src/simulator/emulatorinterface/translator/x86/instruction/InstructionClassTable.java @@ -857,7 +857,7 @@ public class InstructionClassTable { //unhandled x86 instruction type if(instructionClass == null && operation.compareTo("ud2") != 0) - System.out.println(operation); + System.out.println("[x86 Translator] Unhandled instruction type encountered: " +operation); if (instructionClass == null) return InstructionClass.INVALID; diff --git a/src/simulator/emulatorinterface/translator/x86/objparser/ObjParser.java b/src/simulator/emulatorinterface/translator/x86/objparser/ObjParser.java index 438be78..9f11cde 100755 --- a/src/simulator/emulatorinterface/translator/x86/objparser/ObjParser.java +++ b/src/simulator/emulatorinterface/translator/x86/objparser/ObjParser.java @@ -529,8 +529,15 @@ public class ObjParser assemblyTokens[0] = str; currentPointer = indexOf(asmBytes, ' ', previousPointer, 64); - assemblyTokens[1] = new String(asmBytes, previousPointer, (currentPointer-previousPointer)); - currentPointer++; previousPointer = currentPointer; + if(currentPointer==-1) { + assemblyTokens[1] = new String(asmBytes, previousPointer, len(asmBytes)-previousPointer); // only operation field is present + assemblyTokens[2] = assemblyTokens[3] = assemblyTokens[4] = null; + return assemblyTokens; + } + else { + assemblyTokens[1] = new String(asmBytes, previousPointer, (currentPointer-previousPointer)); + currentPointer++; previousPointer = currentPointer; + } } else { assemblyTokens[0] = null; assemblyTokens[1] = str; diff --git a/src/simulator/main/Main.java b/src/simulator/main/Main.java index cffece7..dad58ca 100755 --- a/src/simulator/main/Main.java +++ b/src/simulator/main/Main.java @@ -92,7 +92,20 @@ public class Main { } /*else if(EmulatorConfig.emulatorType==EmulatorType.none) { ObjParser.initializeThreadMicroOpsList(SystemConfig.numEmuThreadsPerJavaThread); }*/ + else{ + executableAndArguments = new String[SystemConfig.NUM_BENCHMARKS]; + + for(int i=0;i