private void DeviceComboBox_IndexChanged(object sender, EventArgs e) { selectedDeviceName = deviceComboBox.SelectedText; VisFileReader vfr = new VisFileReader(DRAMSimPath + "/ini/" + selectedDeviceName); deviceParameters = vfr.ReadDeviceData(DRAMSimPath + "/ini/" + selectedDeviceName); if (deviceParameters == null) { Console.WriteLine("wtf"); } devicePropertyGrid.SelectedObject = null; devicePropertyGrid.SelectedObject = deviceParameters; ((SystemParameters)(systemPropertyGrid.SelectedObject)).TOTAL_STORAGE = (long)(systemParameters.JEDEC_DATA_BUS_BITS / deviceParameters.DEVICE_WIDTH) * systemParameters.NUM_RANKS * ((long)deviceParameters.NUM_ROWS * deviceParameters.NUM_COLS * deviceParameters.DEVICE_WIDTH * deviceParameters.NUM_BANKS) / 8; systemPropertyGrid.Refresh(); }
private void PreviousResults_AfterSelect(object sender, EventArgs e) { //make sure something is selected if (previousResults.SelectedNode != null) { //check to make sure it is a child node if (previousResults.SelectedNode.Nodes.Count == 0 && previousResults.SelectedNode.Checked) { //display the correct property grids devicePropertyGrid.SelectedObject = visFileList[previousResults.SelectedNode.Name].deviceParameters; deviceParameters = visFileList[previousResults.SelectedNode.Name].deviceParameters; systemPropertyGrid.SelectedObject = visFileList[previousResults.SelectedNode.Name].systemParameters; systemParameters = visFileList[previousResults.SelectedNode.Name].systemParameters; //highlight correct listing in device combo box VisFileContainer vfc = visFileList[previousResults.SelectedNode.Name]; string[] pieces = vfc.filepath.Split(System.IO.Path.DirectorySeparatorChar); deviceComboBox.SelectedIndex = deviceComboBox.FindString(pieces[pieces.Length - 2]); ((SystemParameters)(systemPropertyGrid.SelectedObject)).TOTAL_STORAGE = (long)(systemParameters.JEDEC_DATA_BUS_BITS / deviceParameters.DEVICE_WIDTH) * systemParameters.NUM_RANKS * ((long)deviceParameters.NUM_ROWS * deviceParameters.NUM_COLS * deviceParameters.DEVICE_WIDTH * deviceParameters.NUM_BANKS) / 8; systemPropertyGrid.Refresh(); // highlight this data gBandwidth.HighlightGraph(vfc); gLatency.HighlightGraph(vfc); gPower.HighlightGraph(vfc); } else { gBandwidth.HighlightGraph(null); gLatency.HighlightGraph(null); gPower.HighlightGraph(null); } } }
public DeviceParameters ReadDeviceData(string deviceFile) { string line; DeviceParameters deviceParameters = new DeviceParameters(); if(deviceFile != null) { inputFile = File.OpenText(deviceFile); } while((line = inputFile.ReadLine())!=null) { line = line.Trim(); if(line.Equals("!!EPOCH_DATA")) break; if(line.Equals("!!DEVICE_INI") || line.StartsWith(";") || line.Length==0) continue; if(line.IndexOf(";")>0) { //trim off comments line = line.Substring(0,line.IndexOf(";")); } //Console.WriteLine(line); string param = line.Substring(0,line.IndexOf("=")); param = param.Trim(); string val = line.Substring(line.IndexOf("=")+1); val = val.Trim(); switch(param) { case "NUM_BANKS": deviceParameters.NUM_BANKS = uint.Parse(val); break; case "NUM_ROWS": deviceParameters.NUM_ROWS = uint.Parse(val); break; case "NUM_COLS": deviceParameters.NUM_COLS = uint.Parse(val); break; case "DEVICE_WIDTH": deviceParameters.DEVICE_WIDTH = uint.Parse(val); break; case "REFRESH_PERIOD": deviceParameters.REFRESH_PERIOD = uint.Parse(val); break; case "tCK": deviceParameters.tCK = float.Parse(val); break; case "CL": deviceParameters.CL = uint.Parse(val); break; case "AL": deviceParameters.AL = uint.Parse(val); break; case "BL": deviceParameters.BL = uint.Parse(val); break; case "tRAS": deviceParameters.tRAS = uint.Parse(val); break; case "tRCD": deviceParameters.tRCD = uint.Parse(val); break; case "tRRD": deviceParameters.tRRD = uint.Parse(val); break; case "tRC": deviceParameters.tRC = uint.Parse(val); break; case "tRP": deviceParameters.tRP = uint.Parse(val); break; case "tCCD": deviceParameters.tCCD = uint.Parse(val); break; case "tRTP": deviceParameters.tRTP = uint.Parse(val); break; case "tWTR": deviceParameters.tWTR = uint.Parse(val); break; case "tWR": deviceParameters.tWR = uint.Parse(val); break; case "tRTRS": deviceParameters.tRTRS = uint.Parse(val); break; case "tRFC": deviceParameters.tRFC = uint.Parse(val); break; case "tFAW": deviceParameters.tFAW = uint.Parse(val); break; case "tCKE": deviceParameters.tCKE = uint.Parse(val); break; case "tXP": deviceParameters.tXP = uint.Parse(val); break; case "tCMD": deviceParameters.tCMD = uint.Parse(val); break; case "IDD0": deviceParameters.IDD0 = uint.Parse(val); break; case "IDD1": deviceParameters.IDD1 = uint.Parse(val); break; case "IDD2P": deviceParameters.IDD2P = uint.Parse(val); break; case "IDD2Q": deviceParameters.IDD2Q = uint.Parse(val); break; case "IDD2N": deviceParameters.IDD2N = uint.Parse(val); break; case "IDD3Pf": deviceParameters.IDD3Pf = uint.Parse(val); break; case "IDD3Ps": deviceParameters.IDD3Ps = uint.Parse(val); break; case "IDD3N": deviceParameters.IDD3N = uint.Parse(val); break; case "IDD4W": deviceParameters.IDD4W = uint.Parse(val); break; case "IDD4R": deviceParameters.IDD4R = uint.Parse(val); break; case "IDD5": deviceParameters.IDD5 = uint.Parse(val); break; case "IDD6": deviceParameters.IDD6 = uint.Parse(val); break; case "IDD6L": deviceParameters.IDD6L = uint.Parse(val); break; case "IDD7": deviceParameters.IDD7 = uint.Parse(val); break; default: break; } } if (deviceParameters == null) { Console.WriteLine("wtf return"); } return deviceParameters; }
private void PreviousResults_AfterSelect(object sender, EventArgs e) { //make sure something is selected if(previousResults.SelectedNode!=null) { //check to make sure it is a child node if(previousResults.SelectedNode.Nodes.Count==0 && previousResults.SelectedNode.Checked) { //display the correct property grids devicePropertyGrid.SelectedObject = visFileList[previousResults.SelectedNode.Name].deviceParameters; deviceParameters = visFileList[previousResults.SelectedNode.Name].deviceParameters; systemPropertyGrid.SelectedObject = visFileList[previousResults.SelectedNode.Name].systemParameters; systemParameters = visFileList[previousResults.SelectedNode.Name].systemParameters; //highlight correct listing in device combo box VisFileContainer vfc = visFileList[previousResults.SelectedNode.Name]; string[] pieces = vfc.filepath.Split(System.IO.Path.DirectorySeparatorChar); deviceComboBox.SelectedIndex = deviceComboBox.FindString(pieces[pieces.Length-2]); ((SystemParameters)(systemPropertyGrid.SelectedObject)).TOTAL_STORAGE = (long)(systemParameters.JEDEC_DATA_BUS_BITS / deviceParameters.DEVICE_WIDTH) * systemParameters.NUM_RANKS * ((long)deviceParameters.NUM_ROWS * deviceParameters.NUM_COLS * deviceParameters.DEVICE_WIDTH * deviceParameters.NUM_BANKS) / 8; systemPropertyGrid.Refresh(); // highlight this data gBandwidth.HighlightGraph(vfc); gLatency.HighlightGraph(vfc); gPower.HighlightGraph(vfc); } else { gBandwidth.HighlightGraph(null); gLatency.HighlightGraph(null); gPower.HighlightGraph(null); } } }
private void PreviousResults_AfterCheck(object sender, TreeViewEventArgs e) { TreeNode checkedNode = e.Node; //handle recursion if(checkedNode.Checked) { if(checkedNode.Parent!=null && !checkedNode.Parent.Checked) { checkedNode.Parent.Checked = true; } if(e.Action != TreeViewAction.Unknown && checkedNode.Nodes.Count>0) { foreach(TreeNode tn in checkedNode.Nodes) { tn.Checked = true; CheckChildren(tn); } } } else { if(checkedNode.Nodes.Count>0) { foreach(TreeNode tn in checkedNode.Nodes) { if(tn.Checked) tn.Checked = false; } } } //if the node is a child if(e.Node.Nodes.Count==0) { //and it is checked if(e.Node.Checked) { string[] pieces = e.Node.FullPath.Split('\\'); string filename = DRAMSimPath+"/results/"+traceNameDisplay.Text+"/"+pieces[0]+"/"+pieces[1]+".1Ch."+ pieces[2]+"."+pieces[3]+"."+pieces[4]+"."+pieces[5]+".vis"; //Console.WriteLine("load file : "+filename); //make container of relevant data VisFileContainer vfc; //need to check if it is still present since it might have already been checked (and then unchecked) if(!visFileList.ContainsKey(filename)) { vfc = new VisFileContainer(filename); visFileList.Add(filename,vfc); //prevents a node from staying highlighted after it has been checked, thereby forcing user to reselect to highlight previousResults.SelectedNode = null; //ensures that the file which was just produced from simulator output or from an open vis file // dialog is the data which is displayed in the property grids string[] p = vfc.filepath.Split(System.IO.Path.DirectorySeparatorChar); if(inputFileName=="" || inputFileName==vfc.filepath) { //display the correct property grids devicePropertyGrid.SelectedObject = null; devicePropertyGrid.SelectedObject = vfc.deviceParameters; deviceParameters = vfc.deviceParameters; systemPropertyGrid.SelectedObject = null; systemPropertyGrid.SelectedObject = vfc.systemParameters; systemParameters = vfc.systemParameters; //highlight correct listing in device combo box deviceComboBox.SelectedIndex = deviceComboBox.FindString(p[p.Length-2]); ((SystemParameters)(systemPropertyGrid.SelectedObject)).TOTAL_STORAGE = (long)(systemParameters.JEDEC_DATA_BUS_BITS / deviceParameters.DEVICE_WIDTH) * systemParameters.NUM_RANKS * ((long)deviceParameters.NUM_ROWS * deviceParameters.NUM_COLS * deviceParameters.DEVICE_WIDTH * deviceParameters.NUM_BANKS) / 8; systemPropertyGrid.Refresh(); } vfc.configurationName = p[p.Length-1]; vfc.deviceName = p[p.Length-2]; Console.WriteLine("about to add "+vfc.configurationName+" and "+vfc.deviceName); this.gBandwidth.AddToCanvas(vfc); this.gLatency.AddToCanvas(vfc); this.gPower.AddGraph(vfc); this.gHistogram.AddGraph(vfc); } } //unchecking else { string filename = e.Node.Name; VisFileContainer vfc = this.visFileList[filename]; this.gBandwidth.RemoveFromCanvas(vfc); this.gLatency.RemoveFromCanvas(vfc); this.gPower.RemoveGraph(vfc); this.gHistogram.RemoveGraph(vfc); visFileList.Remove(filename); } } }
private void PreviousResults_AfterCheck(object sender, TreeViewEventArgs e) { TreeNode checkedNode = e.Node; //handle recursion if (checkedNode.Checked) { if (checkedNode.Parent != null && !checkedNode.Parent.Checked) { checkedNode.Parent.Checked = true; } if (e.Action != TreeViewAction.Unknown && checkedNode.Nodes.Count > 0) { foreach (TreeNode tn in checkedNode.Nodes) { tn.Checked = true; CheckChildren(tn); } } } else { if (checkedNode.Nodes.Count > 0) { foreach (TreeNode tn in checkedNode.Nodes) { if (tn.Checked) { tn.Checked = false; } } } } //if the node is a child if (e.Node.Nodes.Count == 0) { //and it is checked if (e.Node.Checked) { string[] pieces = e.Node.FullPath.Split('\\'); string filename = DRAMSimPath + "/results/" + traceNameDisplay.Text + "/" + pieces[0] + "/" + pieces[1] + ".1Ch." + pieces[2] + "." + pieces[3] + "." + pieces[4] + "." + pieces[5] + ".vis"; //Console.WriteLine("load file : "+filename); //make container of relevant data VisFileContainer vfc; //need to check if it is still present since it might have already been checked (and then unchecked) if (!visFileList.ContainsKey(filename)) { vfc = new VisFileContainer(filename); visFileList.Add(filename, vfc); //prevents a node from staying highlighted after it has been checked, thereby forcing user to reselect to highlight previousResults.SelectedNode = null; //ensures that the file which was just produced from simulator output or from an open vis file // dialog is the data which is displayed in the property grids string[] p = vfc.filepath.Split(System.IO.Path.DirectorySeparatorChar); if (inputFileName == "" || inputFileName == vfc.filepath) { //display the correct property grids devicePropertyGrid.SelectedObject = null; devicePropertyGrid.SelectedObject = vfc.deviceParameters; deviceParameters = vfc.deviceParameters; systemPropertyGrid.SelectedObject = null; systemPropertyGrid.SelectedObject = vfc.systemParameters; systemParameters = vfc.systemParameters; //highlight correct listing in device combo box deviceComboBox.SelectedIndex = deviceComboBox.FindString(p[p.Length - 2]); ((SystemParameters)(systemPropertyGrid.SelectedObject)).TOTAL_STORAGE = (long)(systemParameters.JEDEC_DATA_BUS_BITS / deviceParameters.DEVICE_WIDTH) * systemParameters.NUM_RANKS * ((long)deviceParameters.NUM_ROWS * deviceParameters.NUM_COLS * deviceParameters.DEVICE_WIDTH * deviceParameters.NUM_BANKS) / 8; systemPropertyGrid.Refresh(); } vfc.configurationName = p[p.Length - 1]; vfc.deviceName = p[p.Length - 2]; Console.WriteLine("about to add " + vfc.configurationName + " and " + vfc.deviceName); this.gBandwidth.AddToCanvas(vfc); this.gLatency.AddToCanvas(vfc); this.gPower.AddGraph(vfc); this.gHistogram.AddGraph(vfc); } } //unchecking else { string filename = e.Node.Name; VisFileContainer vfc = this.visFileList[filename]; this.gBandwidth.RemoveFromCanvas(vfc); this.gLatency.RemoveFromCanvas(vfc); this.gPower.RemoveGraph(vfc); this.gHistogram.RemoveGraph(vfc); visFileList.Remove(filename); } } }
public DeviceParameters ReadDeviceData(string deviceFile) { string line; DeviceParameters deviceParameters = new DeviceParameters(); if (deviceFile != null) { inputFile = File.OpenText(deviceFile); } while ((line = inputFile.ReadLine()) != null) { line = line.Trim(); if (line.Equals("!!EPOCH_DATA")) { break; } if (line.Equals("!!DEVICE_INI") || line.StartsWith(";") || line.Length == 0) { continue; } if (line.IndexOf(";") > 0) { //trim off comments line = line.Substring(0, line.IndexOf(";")); } //Console.WriteLine(line); string param = line.Substring(0, line.IndexOf("=")); param = param.Trim(); string val = line.Substring(line.IndexOf("=") + 1); val = val.Trim(); switch (param) { case "NUM_BANKS": deviceParameters.NUM_BANKS = uint.Parse(val); break; case "NUM_ROWS": deviceParameters.NUM_ROWS = uint.Parse(val); break; case "NUM_COLS": deviceParameters.NUM_COLS = uint.Parse(val); break; case "DEVICE_WIDTH": deviceParameters.DEVICE_WIDTH = uint.Parse(val); break; case "REFRESH_PERIOD": deviceParameters.REFRESH_PERIOD = uint.Parse(val); break; case "tCK": deviceParameters.tCK = float.Parse(val); break; case "CL": deviceParameters.CL = uint.Parse(val); break; case "AL": deviceParameters.AL = uint.Parse(val); break; case "BL": deviceParameters.BL = uint.Parse(val); break; case "tRAS": deviceParameters.tRAS = uint.Parse(val); break; case "tRCD": deviceParameters.tRCD = uint.Parse(val); break; case "tRRD": deviceParameters.tRRD = uint.Parse(val); break; case "tRC": deviceParameters.tRC = uint.Parse(val); break; case "tRP": deviceParameters.tRP = uint.Parse(val); break; case "tCCD": deviceParameters.tCCD = uint.Parse(val); break; case "tRTP": deviceParameters.tRTP = uint.Parse(val); break; case "tWTR": deviceParameters.tWTR = uint.Parse(val); break; case "tWR": deviceParameters.tWR = uint.Parse(val); break; case "tRTRS": deviceParameters.tRTRS = uint.Parse(val); break; case "tRFC": deviceParameters.tRFC = uint.Parse(val); break; case "tFAW": deviceParameters.tFAW = uint.Parse(val); break; case "tCKE": deviceParameters.tCKE = uint.Parse(val); break; case "tXP": deviceParameters.tXP = uint.Parse(val); break; case "tCMD": deviceParameters.tCMD = uint.Parse(val); break; case "IDD0": deviceParameters.IDD0 = uint.Parse(val); break; case "IDD1": deviceParameters.IDD1 = uint.Parse(val); break; case "IDD2P": deviceParameters.IDD2P = uint.Parse(val); break; case "IDD2Q": deviceParameters.IDD2Q = uint.Parse(val); break; case "IDD2N": deviceParameters.IDD2N = uint.Parse(val); break; case "IDD3Pf": deviceParameters.IDD3Pf = uint.Parse(val); break; case "IDD3Ps": deviceParameters.IDD3Ps = uint.Parse(val); break; case "IDD3N": deviceParameters.IDD3N = uint.Parse(val); break; case "IDD4W": deviceParameters.IDD4W = uint.Parse(val); break; case "IDD4R": deviceParameters.IDD4R = uint.Parse(val); break; case "IDD5": deviceParameters.IDD5 = uint.Parse(val); break; case "IDD6": deviceParameters.IDD6 = uint.Parse(val); break; case "IDD6L": deviceParameters.IDD6L = uint.Parse(val); break; case "IDD7": deviceParameters.IDD7 = uint.Parse(val); break; default: break; } } if (deviceParameters == null) { Console.WriteLine("wtf return"); } return(deviceParameters); }