protected override void DoCommandAction()
        {
            if (!Range.Contains(":"))
            {
                throw new ArgumentException("Expecting range in foramt SLICE_X8Y55:SLICE_X12Y243, but found " + Range);
            }
            string[] atoms = Range.Split(':');
            Slice    s1    = FPGA.FPGA.Instance.GetSlice(atoms[0]);
            Slice    s2    = FPGA.FPGA.Instance.GetSlice(atoms[1]);

            if (s1 == null)
            {
                throw new ArgumentException("Could not find Slice1 " + atoms[0]);
            }
            if (s2 == null)
            {
                throw new ArgumentException("Could not find Slice2 " + atoms[1]);
            }

            Tile t1 = s1.ContainingTile;
            Tile t2 = s2.ContainingTile;

            // the sorting (UpperLeft LowerRight) is carried out by AddToSelectionXY
            AddToSelectionXY addCmd = new AddToSelectionXY();

            addCmd.UpperLeftX  = t1.TileKey.X;
            addCmd.UpperLeftY  = t1.TileKey.Y;
            addCmd.LowerRightX = t2.TileKey.X;
            addCmd.LowerRightY = t2.TileKey.Y;

            CommandExecuter.Instance.Execute(addCmd);
        }
示例#2
0
        private int FindSweepLine()
        {
            for (int y = FPGA.FPGA.Instance.MaxY; y >= 0; y--)
            {
                CommandExecuter.Instance.Execute(new ClearSelection());
                AddToSelectionXY addCmd = new AddToSelectionXY();
                addCmd.UpperLeftX  = 0;
                addCmd.UpperLeftY  = y;
                addCmd.LowerRightX = FPGA.FPGA.Instance.MaxX;
                addCmd.LowerRightY = y;
                CommandExecuter.Instance.Execute(addCmd);
                // no expand selection to end up at the buttom of BRAM block

                List <IdentifierManager.RegexTypes>            resTypes        = new List <IdentifierManager.RegexTypes>(m_resStringInfo.GetResourceTypes());
                Dictionary <IdentifierManager.RegexTypes, int> resourcesInLine =
                    TileSelectionManager.Instance.GetRessourcesInSelection(TileSelectionManager.Instance.GetSelectedTiles(), resTypes);
                if (resourcesInLine.Keys.Count == resTypes.Count && resourcesInLine[IdentifierManager.RegexTypes.CLB] > 2)
                {
                    // capture the row
                    return(y);
                }
            }
            throw new ArgumentException("Could not find a line to sweep");
        }