Esempio n. 1
0
        protected override void DoCommandAction()
        {
            FPGA.FPGATypes.AssertBackendType(FPGA.FPGATypes.BackendType.Vivado);

            TCLContainer       netlistContainer = (TCLContainer)GetNetlistContainer();
            TCLDesignHierarchy hier             = new TCLDesignHierarchy();

            hier.Name = Name;
            hier.Properties.SetProperty("REF_NAME", Reference, true);
            netlistContainer.Add(hier);
        }
        private bool AddArcsVivado(TCLContainer netlistContainer)
        {
            // which net to extend?
            TCLNet target;

            if (netlistContainer.Nets.Any(n => n.Name.Equals(Netname)))
            {
                target = (TCLNet)netlistContainer.GetNet(Netname);
            }
            else
            {
                target = (TCLNet)Net.CreateNet(Netname);
                target.IsBlockerNet = true;
                target.RoutingTree  = new TCLRoutingTree();
                TCLRoutingTreeNode root = new TCLRoutingTreeNode(null, null);
                root.VirtualNode        = true;
                target.RoutingTree.Root = root;

                netlistContainer.Add(target);
                netlistContainer.AddGndPrimitive(target);
            }

            Port from = new Port(From);
            Port to   = new Port(To);

            bool arcAdded = false;

            foreach (Tile tile in TileSelectionManager.Instance.GetSelectedTiles().Where(t => AddArcOnThisTile(from, to, t)))
            {
                TCLRoutingTreeNode driverNode = target.RoutingTree.Root.Children.FirstOrDefault(tile.Location, From);
                if (driverNode == null)
                {
                    driverNode = new TCLRoutingTreeNode(tile, from);
                    //driverNode.VivadoPipConnector = orderEl.VivadoPipConnector;
                    target.RoutingTree.Root.Children.Add(driverNode);
                }
                TCLRoutingTreeNode leaveNode = new TCLRoutingTreeNode(tile, to);
                driverNode.Children.Add(leaveNode);

                // block ports
                if (!tile.IsPortBlocked(from, Tile.BlockReason.Blocked))
                {
                    tile.BlockPort(from, Tile.BlockReason.Blocked);
                }
                tile.BlockPort(to, Tile.BlockReason.Blocked);
                arcAdded = true;
            }

            return(arcAdded);
        }
 private void RelocateInstancesForTCL(LibraryElement libElement, Tile anchorCLB, TCLContainer netlistContainer)
 {
     foreach (Tuple <Instance, Tile> tileSliceTupel in libElement.GetInstanceTiles(anchorCLB, libElement))
     {
         TCLInstance newInstance = new TCLInstance((TCLInstance)tileSliceTupel.Item1);
         // change LOC property and the other fields carries out the actual relocation
         Slice targetSlice = tileSliceTupel.Item2.Slices[(int)newInstance.SliceNumber];
         newInstance.Properties.SetProperty("LOC", targetSlice.SliceName, false);
         if (InsertPrefix)
         {
             newInstance.Name = InstanceName + "_" + newInstance.Name; // do not use / to avoid creating a new hierarchy for which w do not have a refernce cell
         }
         newInstance.SliceName        = targetSlice.SliceName;
         newInstance.SliceType        = targetSlice.SliceType;
         newInstance.SliceNumber      = targetSlice.ContainingTile.GetSliceNumberByName(targetSlice.SliceName);
         newInstance.TileKey          = targetSlice.ContainingTile.TileKey;
         newInstance.Location         = targetSlice.ContainingTile.Location;
         newInstance.LocationX        = targetSlice.ContainingTile.LocationX;
         newInstance.LocationY        = targetSlice.ContainingTile.LocationY;
         newInstance.OmitPlaceCommand = true; // TODO we only support GND primitves, overwork this when placing module
         netlistContainer.Add(newInstance);
     }
 }