protected override sealed void DoCommandAction() { if (FPGA.FPGA.Instance.Contains(AnchorLocation)) { Tile anchor = FPGA.FPGA.Instance.GetTile(AnchorLocation); AddSingleInstantiationByTile addCmd = new AddSingleInstantiationByTile(); addCmd.AnchorLocation = AnchorLocation; SetBaseClassParametersAndExecuteCommand(addCmd); } else if (FPGA.FPGA.Instance.ContainsSlice(AnchorLocation)) { Slice s = FPGA.FPGA.Instance.GetSlice(AnchorLocation); AddSingleInstantiationBySlice addCmd = new AddSingleInstantiationBySlice(); addCmd.SliceName = AnchorLocation; SetBaseClassParametersAndExecuteCommand(addCmd); } else { throw new ArgumentException("Expecting either a tile or a slice identifier (CLB_X4Y3 or SLICE_X465). Found " + AnchorLocation); } if (GetAutoClearModuleSlotValue()) { FuseNets fuseCmd = new FuseNets(); fuseCmd.NetlistContainerName = NetlistContainerName; CommandExecuter.Instance.Execute(fuseCmd); } }
private void m_btnFuse_Click(object sender, EventArgs e) { FuseNets fuseCmd = new FuseNets(); fuseCmd.NetlistContainerName = m_netlistContainerSelector.SelectedNetlistContainerName; fuseCmd.PrintProgress = true; CommandExecuter.Instance.Execute(fuseCmd); }
protected override void DoCommandAction() { LibraryElement libElement = Objects.Library.Instance.GetElement(LibraryElementName); Tile anchor = FPGA.FPGA.Instance.GetTile(AnchorLocation); if (libElement.ResourceShape.Anchor.AnchorSliceNumber >= anchor.Slices.Count) { throw new ArgumentException("Too few slices on tile " + anchor.Location + ". Expecting " + libElement.ResourceShape.Anchor.AnchorSliceNumber + " but found " + anchor.Slices.Count + " slice."); } if (IdentifierManager.Instance.IsMatch(anchor.Location, IdentifierManager.RegexTypes.Interconnect)) { anchor = FPGATypes.GetCLTile(anchor).FirstOrDefault(); } if (AutoClearModuleSlot) { //this.FastAutoClearModuleSlotBeforeInstantiation(libElement, Enumerable.Repeat(anchor, 1)); AutoClearModuleSlotBeforeInstantiation(libElement, Enumerable.Repeat(anchor, 1)); } LibElemInst instantiation = new LibElemInst(); instantiation.AnchorLocation = AnchorLocation; instantiation.InstanceName = Hierarchy + InstanceName; instantiation.LibraryElementName = LibraryElementName; instantiation.SliceNumber = libElement.ResourceShape.Anchor.AnchorSliceNumber; instantiation.SliceName = anchor.Slices[(int)libElement.ResourceShape.Anchor.AnchorSliceNumber].SliceName; LibraryElementInstanceManager.Instance.Add(instantiation); // mark source as blocked ExcludeInstantiationSourcesFromBlocking markSrc = new ExcludeInstantiationSourcesFromBlocking(); markSrc.AnchorLocation = AnchorLocation; markSrc.LibraryElementName = LibraryElementName; CommandExecuter.Instance.Execute(markSrc); SaveLibraryElementInstantiation saveCmd = new SaveLibraryElementInstantiation(); saveCmd.AddDesignConfig = false; saveCmd.InsertPrefix = true; saveCmd.InstanceName = InstanceName; saveCmd.NetlistContainerName = NetlistContainerName; CommandExecuter.Instance.Execute(saveCmd); if (AutoFuse) { FuseNets fuseCmd = new FuseNets(); fuseCmd.NetlistContainerName = NetlistContainerName; fuseCmd.Mute = Mute; fuseCmd.Profile = Profile; fuseCmd.PrintProgress = PrintProgress; CommandExecuter.Instance.Execute(fuseCmd); } }
protected override void DoCommandAction() { NetlistContainer netlistContainer = GetNetlistContainer(); Slice anchor = FPGA.FPGA.Instance.GetSlice(SliceName); LibraryElement libElement = Objects.Library.Instance.GetElement(LibraryElementName); if (anchor == null) { throw new ArgumentException("Can not find Slice " + SliceName); } if (AutoClearModuleSlot) { AutoClearModuleSlotBeforeInstantiation(libElement, Enumerable.Repeat(anchor.ContainingTile, 1)); } LibElemInst instantiation = new LibElemInst(); instantiation.AnchorLocation = anchor.ContainingTile.Location; instantiation.InstanceName = Hierarchy + InstanceName; instantiation.LibraryElementName = LibraryElementName; instantiation.SliceNumber = anchor.ContainingTile.GetSliceNumberByName(SliceName); instantiation.SliceName = SliceName; LibraryElementInstanceManager.Instance.Add(instantiation); // mark source as blocked ExcludeInstantiationSourcesFromBlocking markSrc = new ExcludeInstantiationSourcesFromBlocking(); markSrc.AnchorLocation = anchor.ContainingTile.Location; markSrc.LibraryElementName = LibraryElementName; CommandExecuter.Instance.Execute(markSrc); SaveLibraryElementInstantiation saveCmd = new SaveLibraryElementInstantiation(); saveCmd.AddDesignConfig = false; saveCmd.InsertPrefix = true; saveCmd.InstanceName = InstanceName; saveCmd.NetlistContainerName = NetlistContainerName; CommandExecuter.Instance.Execute(saveCmd); if (AutoFuse) { FuseNets fuseCmd = new FuseNets(); fuseCmd.NetlistContainerName = NetlistContainerName; fuseCmd.Mute = Mute; fuseCmd.Profile = Profile; fuseCmd.PrintProgress = PrintProgress; CommandExecuter.Instance.Execute(fuseCmd); } }
public NetlistContainerCtrl() { InitializeComponent(); CutOff cutCmd = new CutOff(); m_lblCutOff.Text = cutCmd.GetCommandDescription(); PrintStatistics printCmd = new PrintStatistics(); m_lblStatistics.Text = printCmd.GetCommandDescription(); OpenDesign readCmd = new OpenDesign(); m_lblRead.Text = readCmd.GetCommandDescription(); FuseNets fuseCmd = new FuseNets(); m_lblFuse.Text = fuseCmd.GetCommandDescription(); }
protected override void DoCommandAction() { FPGATypes.AssertBackendType(FPGATypes.BackendType.ISE, FPGATypes.BackendType.Vivado); SortMode mode = SortMode.Undefined; HMode hMode = HMode.Undefined; VMode vMode = VMode.Undefined; SetSortModes(ref mode, ref hMode, ref vMode); List <TileKey> keys = new List <TileKey>(); foreach (Tile clb in TileSelectionManager.Instance.GetSelectedTiles().Where(t => IdentifierManager.Instance.IsMatch(t.Location, IdentifierManager.RegexTypes.CLB) || IdentifierManager.Instance.IsMatch(t.Location, IdentifierManager.RegexTypes.DSP) || IdentifierManager.Instance.IsMatch(t.Location, IdentifierManager.RegexTypes.BRAM))) { keys.Add(clb.TileKey); } var preOrderedKey = from key in keys group key by(mode == SortMode.R?key.Y : key.X) into g select g; List <Tile> tilesInFinalOrder = new List <Tile>(); if (mode == SortMode.R) { foreach (IGrouping <int, TileKey> group in (vMode == VMode.TD ? preOrderedKey.OrderBy(g => g.Key) : preOrderedKey.OrderByDescending(g => g.Key))) { foreach (TileKey key in (hMode == HMode.L2R ? group.OrderBy(k => k.X) : group.OrderBy(k => k.X).Reverse())) { tilesInFinalOrder.Add(FPGA.FPGA.Instance.GetTile(key)); } } } else { foreach (IGrouping <int, TileKey> group in (hMode == HMode.L2R ? preOrderedKey.OrderBy(g => g.Key) : preOrderedKey.OrderByDescending(g => g.Key))) { foreach (TileKey key in (vMode == VMode.TD ? group.OrderBy(k => k.Y) : group.OrderBy(k => k.Y).Reverse())) { tilesInFinalOrder.Add(FPGA.FPGA.Instance.GetTile(key)); } } } // apply filter tilesInFinalOrder.RemoveAll(t => !Regex.IsMatch(t.Location, Filter)); /* * // check prior to plaecment of valid placement * foreach (Tile t in tilesInFinalOrder) * { * LibraryElement libElement = Objects.Library.Instance.GetElement(this.LibraryElementName); * StringBuilder errorList = null; * bool placementOk = DesignRuleChecker.CheckLibraryElementPlacement(t, libElement, out errorList); * if (!placementOk) * { * throw new ArgumentException("Macro " + this.LibraryElementName + " can not be placed at " + t + ": " + errorList.ToString()); * } * } */ if (AutoClearModuleSlot) { LibraryElement libElement = Objects.Library.Instance.GetElement(LibraryElementName); AutoClearModuleSlotBeforeInstantiation(libElement, tilesInFinalOrder); } foreach (Tile t in tilesInFinalOrder) { // check again prior to placement and now consider already placed tiles /* * StringBuilder errorList = null; * bool placementOk = DesignRuleChecker.CheckLibraryElementPlacement(t, libElement, out errorList); * if (!placementOk) * { * throw new ArgumentException("Library element " + this.LibraryElementName + " can not be placed at " + t + ": " + errorList.ToString()); * }*/ switch (FPGA.FPGA.Instance.BackendType) { case FPGATypes.BackendType.ISE: AddISEInstantiation(t); break; case FPGATypes.BackendType.Vivado: AddVivadoInstantiation(t); break; } } if (AutoFuse) { FuseNets fuseCmd = new FuseNets(); fuseCmd.NetlistContainerName = NetlistContainerName; fuseCmd.Mute = Mute; fuseCmd.Profile = Profile; fuseCmd.PrintProgress = PrintProgress; CommandExecuter.Instance.Execute(fuseCmd); } }