Exemplo n.º 1
0
        public void AddToCanvas(VisFileContainer v)
        {
            Console.WriteLine("ADD CALLED");
            int start, end;

            getRangeForDrawMode(v, this.drawMode, out start, out end);
            for (int i = start; i < end; i++)
            {
//				Console.WriteLine("Adding "+i);
                MyLinePlot linePlot = v.plotTable[y_key][i];
                {
                    linePlot.Name = v.filepath + i;
                    canvas.Add(linePlot);
                }

                if (!containers.Contains(v))
                {
                    containers.Add(v);
                }
            }
            //	p("NumDrawn="+this.itemsDrawn);

            if (true || isClear)
            {
                canvas.XAxis1.Label = x_label;
                canvas.YAxis1.Label = y_label;

                canvas.YAxis1.LabelOffsetAbsolute = true;
                canvas.YAxis1.LabelOffset         = 40;
                canvas.XAxis1.HideTickText        = false;
                isClear = false;
            }
            canvas.Refresh();
        }
Exemplo n.º 2
0
        public void AddToCanvas(VisFileContainer v)
        {
            Console.WriteLine("ADD CALLED");
            int start, end;

            getRangeForDrawMode(v, this.drawMode, out start, out end);
            for (int i=start; i<end; i++)
            {
            //				Console.WriteLine("Adding "+i);
                MyLinePlot linePlot = v.plotTable[y_key][i];
                {
                    linePlot.Name = v.filepath+i;
                    canvas.Add(linePlot);
                }

                if (!containers.Contains(v))
                {
                    containers.Add(v);
                }
            }
            //	p("NumDrawn="+this.itemsDrawn);

            if (true || isClear)
            {
                canvas.XAxis1.Label = x_label;
                canvas.YAxis1.Label = y_label;

                canvas.YAxis1.LabelOffsetAbsolute = true;
                canvas.YAxis1.LabelOffset = 40;
                canvas.XAxis1.HideTickText = false;
                isClear = false;
            }
            canvas.Refresh();
        }
Exemplo n.º 3
0
        private void getRangeForDrawMode(VisFileContainer v, DrawMode d, out int start, out int end)
        {
            int rankOffset  = (int)v.systemParameters.NUM_RANKS * (int)v.deviceParameters.NUM_BANKS;
            int totalOffset = rankOffset + (int)v.systemParameters.NUM_RANKS;

            switch (d)
            {
            case DrawMode.BANK:
                start = 0;
                end   = rankOffset;
                break;

            case DrawMode.RANK:
                start = rankOffset;
                end   = totalOffset;
                break;

            case DrawMode.TOTAL:
                start = totalOffset;
                end   = totalOffset + 1;
                break;

            case DrawMode.AVERAGE:
                start = totalOffset + 1;
                end   = totalOffset + 2;
                break;

            default:
                start = 0;
                end   = totalOffset + 2;
                break;
            }
        }
Exemplo n.º 4
0
        public void HighlightGraph(VisFileContainer v)
        {
            //unhighlight everyone
            foreach (IDrawable d in canvas.Drawables)
            {
                if (d is MyLinePlot)
                {
                    MyLinePlot l = (MyLinePlot)d;
                    l.Pen.Width     = 1.0f;
                    l.Pen.Color     = l.OriginalColor;
                    l.isHighlighted = false;
                }
            }

            // if we wanted to unhighlight, that's all we need to do
            if (v == null)
            {
                canvas.Refresh();
                return;
            }
            int start;
            int end;

            getRangeForDrawMode(v, this.drawMode, out start, out end);

            //iterate over a copy since we can't change the collection while its being iterated
            foreach (IDrawable d in new ArrayList(canvas.Drawables))
            {
                if (d is MyLinePlot)
                {
                    for (int i = start; i < end; i++)
                    {
                        MyLinePlot l       = (MyLinePlot)d;
                        string     keyName = v.filepath + i;
                        if (l.Name.Equals(keyName))
                        {
                            l.Pen.Width     = 2.0f;
                            l.Pen.Color     = l.OriginalColor;
                            l.isHighlighted = true;
                            // remove/add to force the line graph to be on top
                            canvas.Remove(l, false);
                            canvas.Add(l);
                        }
                        else
                        {
                            // only unhiglight a plot that we haven't previously highlighted
                            if (!l.isHighlighted)
                            {
                                l.Pen.Width = 1.0f;
                                l.Pen.Color = Color.DarkGray;
                            }
                        }
                    }
                    // highlight a matching plot
                }
            }


            canvas.Refresh();
        }
Exemplo n.º 5
0
 public static List<BarPlot> HistogramPlot(VisFileContainer v)
 {
     List<BarPlot> ret = new List<BarPlot>();
     BarPlot histogram = MakeBarPlot(v.valueTable["latency_values"],v.valueTable["latency_counts"],Color.SlateGray);
     ret.Add(histogram);
     return ret;
 }
Exemplo n.º 6
0
        public void AddGraph(VisFileContainer v)
        {
            t.ColumnCount++;
            NPlot.Windows.PlotSurface2D plot = new NPlot.Windows.PlotSurface2D();
            plot.Dock = DockStyle.Fill;

            foreach (BarPlot bp in v.barPlotTable[keyName])
            {
                plot.Add(bp);
            }
            plot.Add(ComputeAveragePower(v));
            plot.Legend = new Legend();

            plot.Legend.HorizontalEdgePlacement = NPlot.Legend.Placement.Outside;
            plot.Legend.VerticalEdgePlacement   = NPlot.Legend.Placement.Inside;
            plot.Legend.NumberItemsVertically   = 4;
            plot.Legend.AttachTo(NPlot.PlotSurface2D.XAxisPosition.Bottom, NPlot.PlotSurface2D.YAxisPosition.Left);
            plot.Legend.YOffset = 40;

            plot.Title = v.deviceName + "\n" + v.configurationName;
            plot.Name  = v.filepath;
            t.Controls.Add(plot, t.ColumnCount - 1, 0);


            t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent));
            RescaleBarGraphs();
        }
Exemplo n.º 7
0
        // used for power graphs to put the bars on top of one another
        private static void ComputeStackedBarValues(VisFileContainer v, int rank, List <decimal> offsets)
        {
            Dictionary <string, List <decimal> > valueTable = v.valueTable;

            valueTable.Add("background_top_" + rank, new List <decimal>());
            valueTable.Add("actpre_top_" + rank, new List <decimal>());
            valueTable.Add("burst_top_" + rank, new List <decimal>());
            valueTable.Add("refresh_top_" + rank, new List <decimal>());
            valueTable.Add("background_bottom_" + rank, new List <decimal>(offsets));
            int j = 0;

            foreach (decimal val in valueTable["bgp_" + rank])
            {
                valueTable["background_top_" + rank].Add(offsets[j] + val);
                j++;
            }
            j = 0;
            foreach (decimal val in valueTable["ap_" + rank])
            {
                valueTable["actpre_top_" + rank].Add(valueTable["background_top_" + rank][j] + val);
                j++;
            }
            j = 0;
            foreach (decimal val in valueTable["bp_" + rank])
            {
                valueTable["burst_top_" + rank].Add(valueTable["actpre_top_" + rank][j] + val);
                j++;
            }
            j = 0;
            foreach (decimal val in valueTable["rp_" + rank])
            {
                valueTable["refresh_top_" + rank].Add(valueTable["burst_top_" + rank][j] + val);
                j++;
            }
        }
Exemplo n.º 8
0
        public static List <BarPlot> HistogramPlot(VisFileContainer v)
        {
            List <BarPlot> ret       = new List <BarPlot>();
            BarPlot        histogram = MakeBarPlot(v.valueTable["latency_values"], v.valueTable["latency_counts"], Color.SlateGray);

            ret.Add(histogram);
            return(ret);
        }
Exemplo n.º 9
0
        private static MyLinePlot ComputeAveragePower(VisFileContainer v)
        {
            Dictionary <string, List <decimal> > valueTable = v.valueTable;
            uint       rank = v.systemParameters.NUM_RANKS - 1;
            MyLinePlot line = LineGrapher.MakeLinePlot(valueTable["x_axis"], Grapher.GenerateRunningAverage(valueTable["refresh_top_" + rank]), Color.Red);

            line.Label = "Average Power";
            line.Pen   = new Pen(Color.Red, 2.0f);
            return(line);
        }
Exemplo n.º 10
0
        public static List <BarPlot> PowerGraph(VisFileContainer v)
        {
            p("PowerGraph for " + v.filepath);
            List <BarPlot> plots = new List <BarPlot>();
            Dictionary <string, List <decimal> > valueTable = v.valueTable;
            int numValues = valueTable["x_axis"].Count;

            ComputeStackedBarValues(v, 0, Grapher.ZeroList(numValues));
            Color c;

            // run the loop from 1 since the 0th case is taken care of above
            for (uint r = 1; r <= v.systemParameters.NUM_RANKS; r++)
            {
                //when r==NUM_RANKS, we don't want to compute the stacked values
                if (r < v.systemParameters.NUM_RANKS)
                {
                    ComputeStackedBarValues(v, (int)r, valueTable["refresh_top_" + (r - 1)]);
                }

                uint x = (r - 1) * 2;
                //adding these in reverse order of the stacks makes the legend work out well
                c = Grapher.GetColorRange(x, 0, 3);
                BarPlot bp = MakeBarPlot(valueTable["x_axis"], valueTable["refresh_top_" + (r - 1)], valueTable["burst_top_" + (r - 1)], c);
                bp.Label = "Refresh (Rank " + r + ")";
                plots.Add(bp);

                c        = Grapher.GetColorRange(x, 2, 3);
                bp       = MakeBarPlot(valueTable["x_axis"], valueTable["burst_top_" + (r - 1)], valueTable["actpre_top_" + (r - 1)], c);
                bp.Label = "Burst (Rank " + r + ")";
                plots.Add(bp);

                c        = Grapher.GetColorRange(x, 1, 3);
                bp       = MakeBarPlot(valueTable["x_axis"], valueTable["actpre_top_" + (r - 1)], valueTable["background_top_" + (r - 1)], c);
                bp.Label = "Activate/Precharge (Rank " + r + ")";
                plots.Add(bp);

                c        = Grapher.GetColorRange(x, 3, 3);
                bp       = MakeBarPlot(valueTable["x_axis"], valueTable["background_top_" + (r - 1)], valueTable["background_bottom_" + (r - 1)], c);
                bp.Label = "Background Power (Rank " + r + ")";
                plots.Add(bp);
            }


            /*
             *
             *
             * //		plot.Legend.NeverShiftAxes=true;
             *
             */

//			computeBarGraphTimeScales();
//			SetBarGraphWidths(plot);
            return(plots);
        }
Exemplo n.º 11
0
        public static List<BarPlot> PowerGraph(VisFileContainer v)
        {
            p("PowerGraph for "+v.filepath);
            List<BarPlot> plots = new List<BarPlot>();
            Dictionary<string, List<decimal>> valueTable = v.valueTable;
            int numValues = valueTable["x_axis"].Count;
            ComputeStackedBarValues(v, 0, Grapher.ZeroList(numValues));
            Color c;
            // run the loop from 1 since the 0th case is taken care of above
            for (uint r=1; r<=v.systemParameters.NUM_RANKS; r++)
            {
                //when r==NUM_RANKS, we don't want to compute the stacked values
                if (r<v.systemParameters.NUM_RANKS)
                {
                    ComputeStackedBarValues(v, (int)r, valueTable["refresh_top_"+(r-1)]);
                }

                uint x=(r-1)*2;
                //adding these in reverse order of the stacks makes the legend work out well
                c = Grapher.GetColorRange(x,0,3);
                BarPlot bp = MakeBarPlot(valueTable["x_axis"],valueTable["refresh_top_"+(r-1)],valueTable["burst_top_"+(r-1)], c);
                bp.Label = "Refresh (Rank "+r+")";
                plots.Add(bp);

                c = Grapher.GetColorRange(x,2,3);
                bp = MakeBarPlot(valueTable["x_axis"],valueTable["burst_top_"+(r-1)],valueTable["actpre_top_"+(r-1)], c);
                bp.Label = "Burst (Rank "+r+")";
                plots.Add(bp);

                c = Grapher.GetColorRange(x,1,3);
                bp = MakeBarPlot(valueTable["x_axis"],valueTable["actpre_top_"+(r-1)],valueTable["background_top_"+(r-1)], c);
                bp.Label = "Activate/Precharge (Rank "+r+")";
                plots.Add(bp);

                c = Grapher.GetColorRange(x,3,3);
                bp = MakeBarPlot(valueTable["x_axis"],valueTable["background_top_"+(r-1)],valueTable["background_bottom_"+(r-1)], c);
                bp.Label = "Background Power (Rank "+r+")";
                plots.Add(bp);

            }

            /*

            //		plot.Legend.NeverShiftAxes=true;

            */

            //			computeBarGraphTimeScales();
            //			SetBarGraphWidths(plot);
            return plots;
        }
Exemplo n.º 12
0
        public void RemoveGraph(VisFileContainer v)
        {
            int removeIndex = -1;

            for (int i = 0; i < t.ColumnCount; i++)
            {
                Control obj = t.GetControlFromPosition(i, 0);
                if (obj is NPlot.Windows.PlotSurface2D)
                {
                    NPlot.Windows.PlotSurface2D plot = (NPlot.Windows.PlotSurface2D)obj;

                    if (plot.Name.Equals(v.filepath))
                    {
                        t.Controls.Remove(plot);
                        t.ColumnStyles.RemoveAt(i);
                        removeIndex = i;
                        break;
                    }
                }
            }
            if (removeIndex == -1)
            {
                Console.WriteLine("WARNING: did not find graph to remove");
                return;
            }

            if (removeIndex != t.ColumnCount - 1)
            {
                // we need to scoot the graphs down before removing the columns
                for (int i = removeIndex + 1; i < t.ColumnCount; i++)
                {
                    Object nextObj = t.GetControlFromPosition(i, 0);
                    NPlot.Windows.PlotSurface2D nextPlot = (NPlot.Windows.PlotSurface2D)nextObj;

                    //				p("Moving "+nextPlot.Name+" from "+(i)+" to "+(i-1));

                    t.Controls.Remove(nextPlot);
                    t.Controls.Add(nextPlot, i - 1, 0);
                }
            }
            // then get rid of the last column and rescale everyone
            t.ColumnCount--;
            RescaleBarGraphs();

            //Console.WriteLine("Moving "+plot.Title+" from "+i+1+" to "+i);
            return;
        }
Exemplo n.º 13
0
        public void RemoveFromCanvas(VisFileContainer v)
        {
            int  start;
            int  end;
            bool needUnhighlight = false;

            getRangeForDrawMode(v, this.drawMode, out start, out end);

            ArrayList DrawablesCopy = new ArrayList(canvas.Drawables);

            foreach (IDrawable d in DrawablesCopy)
            {
                if (d is MyLinePlot)
                {
                    for (int i = start; i < end; i++)
                    {
                        MyLinePlot l       = (MyLinePlot)d;
                        string     keyName = v.filepath + i;
                        if (keyName.Equals(l.Name))
                        {
                            if (l.isHighlighted)
                            {
                                needUnhighlight = true;
                            }
//							Console.WriteLine("REMOVING="+l.Name);
                            canvas.Remove(l, true);
                        }
                    }
                }
            }
            if (needUnhighlight)
            {
                this.HighlightGraph(null);
            }
            canvas.Refresh();
            containers.Remove(v);
        }
Exemplo n.º 14
0
        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);
                }
            }
        }
Exemplo n.º 15
0
 private void getRangeForDrawMode(VisFileContainer v, DrawMode d, out int start, out int end)
 {
     int rankOffset = (int)v.systemParameters.NUM_RANKS * (int)v.deviceParameters.NUM_BANKS;
     int totalOffset = rankOffset + (int)v.systemParameters.NUM_RANKS;
     switch(d)
     {
         case DrawMode.BANK:
             start = 0;
             end = rankOffset;
             break;
         case DrawMode.RANK:
             start = rankOffset;
             end = totalOffset;
             break;
         case DrawMode.TOTAL:
             start = totalOffset;
             end = totalOffset+1;
             break;
         case DrawMode.AVERAGE:
             start = totalOffset+1;
             end = totalOffset+2;
             break;
         default:
             start=0;
             end=totalOffset+2;
             break;
     }
 }
Exemplo n.º 16
0
 public void HighlightGraph(VisFileContainer v)
 {
 }
Exemplo n.º 17
0
        // used for power graphs to put the bars on top of one another
        private static void ComputeStackedBarValues(VisFileContainer v, int rank, List<decimal> offsets)
        {
            Dictionary<string, List<decimal>> valueTable = v.valueTable;

            valueTable.Add("background_top_"+rank, new List<decimal>());
            valueTable.Add("actpre_top_"+rank, new List<decimal>());
            valueTable.Add("burst_top_"+rank, new List<decimal>());
            valueTable.Add("refresh_top_"+rank, new List<decimal>());
            valueTable.Add("background_bottom_"+rank, new List<decimal>(offsets));
            int j=0;
            foreach (decimal val in valueTable["bgp_"+rank])
            {
                valueTable["background_top_"+rank].Add(offsets[j] + val);
                j++;
            }
            j=0;
            foreach (decimal val in valueTable["ap_"+rank])
            {
                valueTable["actpre_top_"+rank].Add(valueTable["background_top_"+rank][j] + val);
                j++;
            }
            j=0;
            foreach (decimal val in valueTable["bp_"+rank])
            {
                valueTable["burst_top_"+rank].Add(valueTable["actpre_top_"+rank][j] + val);
                j++;
            }
            j=0;
            foreach (decimal val in valueTable["rp_"+rank])
            {
                valueTable["refresh_top_"+rank].Add(valueTable["burst_top_"+rank][j] + val);
                j++;
            }
        }
Exemplo n.º 18
0
 private static MyLinePlot ComputeAveragePower(VisFileContainer v)
 {
     Dictionary<string, List<decimal>> valueTable = v.valueTable;
     uint rank = v.systemParameters.NUM_RANKS-1;
     MyLinePlot line = LineGrapher.MakeLinePlot(valueTable["x_axis"], Grapher.GenerateRunningAverage(valueTable["refresh_top_"+rank]), Color.Red);
     line.Label = "Average Power";
     line.Pen = new Pen(Color.Red, 2.0f);
     return line;
 }
Exemplo n.º 19
0
        public void RemoveGraph(VisFileContainer v)
        {
            int removeIndex = -1;
            for (int i=0; i<t.ColumnCount; i++)
            {
                Control obj = t.GetControlFromPosition(i,0);
                if (obj is NPlot.Windows.PlotSurface2D)
                {
                    NPlot.Windows.PlotSurface2D plot = (NPlot.Windows.PlotSurface2D) obj;

                    if (plot.Name.Equals(v.filepath))
                    {
                        t.Controls.Remove(plot);
                        t.ColumnStyles.RemoveAt(i);
                        removeIndex=i;
                        break;
                    }
                }
            }
            if (removeIndex == -1) {
                Console.WriteLine("WARNING: did not find graph to remove");
                return;
            }

            if (removeIndex != t.ColumnCount-1)
            {
                // we need to scoot the graphs down before removing the columns
                for (int i=removeIndex+1; i<t.ColumnCount; i++)
                {
                    Object nextObj = t.GetControlFromPosition(i,0);
                    NPlot.Windows.PlotSurface2D nextPlot = (NPlot.Windows.PlotSurface2D) nextObj;

            //				p("Moving "+nextPlot.Name+" from "+(i)+" to "+(i-1));

                    t.Controls.Remove(nextPlot);
                    t.Controls.Add(nextPlot, i-1, 0);
                }
            }
            // then get rid of the last column and rescale everyone
            t.ColumnCount--;
            RescaleBarGraphs();

            //Console.WriteLine("Moving "+plot.Title+" from "+i+1+" to "+i);
            return;
        }
Exemplo n.º 20
0
 public void HighlightGraph(VisFileContainer v)
 {
 }
Exemplo n.º 21
0
        public void AddGraph(VisFileContainer v)
        {
            t.ColumnCount++;
            NPlot.Windows.PlotSurface2D plot = new NPlot.Windows.PlotSurface2D();
            plot.Dock = DockStyle.Fill;

            foreach (BarPlot bp in v.barPlotTable[keyName])
            {
                plot.Add(bp);
            }
            plot.Add(ComputeAveragePower(v));
            plot.Legend = new Legend();

            plot.Legend.HorizontalEdgePlacement = NPlot.Legend.Placement.Outside;
            plot.Legend.VerticalEdgePlacement = NPlot.Legend.Placement.Inside;
            plot.Legend.NumberItemsVertically = 4;
            plot.Legend.AttachTo(NPlot.PlotSurface2D.XAxisPosition.Bottom,NPlot.PlotSurface2D.YAxisPosition.Left);
            plot.Legend.YOffset = 40;

            plot.Title = v.deviceName+"\n"+v.configurationName;
            plot.Name = v.filepath;
            t.Controls.Add(plot,t.ColumnCount-1,0);

            t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent));
            RescaleBarGraphs();
        }
Exemplo n.º 22
0
        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);
                }
            }
        }
Exemplo n.º 23
0
        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);
                }
            }
        }
Exemplo n.º 24
0
        public void HighlightGraph(VisFileContainer v)
        {
            //unhighlight everyone
            foreach (IDrawable d in canvas.Drawables)
            {
                if (d is MyLinePlot)
                {
                    MyLinePlot l = (MyLinePlot)d;
                    l.Pen.Width=1.0f;
                    l.Pen.Color = l.OriginalColor;
                    l.isHighlighted = false;
                }
            }

            // if we wanted to unhighlight, that's all we need to do
            if (v == null) {
                canvas.Refresh();
                return;
            }
            int start;
            int end;
            getRangeForDrawMode(v, this.drawMode, out start, out end);

            //iterate over a copy since we can't change the collection while its being iterated
            foreach (IDrawable d in new ArrayList(canvas.Drawables))
            {
                if (d is MyLinePlot)
                {
                    for (int i=start; i<end; i++)
                    {
                        MyLinePlot l = (MyLinePlot)d;
                        string keyName = v.filepath+i;
                        if (l.Name.Equals(keyName))
                        {
                            l.Pen.Width=2.0f;
                            l.Pen.Color = l.OriginalColor;
                            l.isHighlighted = true;
                            // remove/add to force the line graph to be on top
                            canvas.Remove(l,false);
                            canvas.Add(l);

                        }
                        else
                        {
                            // only unhiglight a plot that we haven't previously highlighted
                            if (!l.isHighlighted)
                            {
                                l.Pen.Width=1.0f;
                                l.Pen.Color = Color.DarkGray;
                            }
                        }
                    }
                    // highlight a matching plot

                }
            }

            canvas.Refresh();
        }
Exemplo n.º 25
0
        public void RemoveFromCanvas(VisFileContainer v)
        {
            int start;
            int end;
            bool needUnhighlight=false;
            getRangeForDrawMode(v, this.drawMode, out start, out end);

            ArrayList DrawablesCopy = new ArrayList(canvas.Drawables);

            foreach (IDrawable d in DrawablesCopy)
            {
                if (d is MyLinePlot)
                {
                    for (int i=start; i<end; i++)
                    {
                        MyLinePlot l = (MyLinePlot)d;
                        string keyName = v.filepath+i;
                        if (keyName.Equals(l.Name))
                        {
                            if (l.isHighlighted)
                            {
                                needUnhighlight=true;
                            }
            //							Console.WriteLine("REMOVING="+l.Name);
                            canvas.Remove(l,true);
                        }
                    }
                }
            }
            if (needUnhighlight)
            {
                this.HighlightGraph(null);
            }
            canvas.Refresh();
            containers.Remove(v);
        }