示例#1
0
        public override void Execute()
        {
            base.Execute();

            if (!string.IsNullOrEmpty(OutputPath))
            {
                XilinxProjectFile prj = new XilinxProjectFile(Program.Repository);

                if (!string.IsNullOrEmpty(DeviceQueryString))
                {
                    DeviceManager    manager = new DeviceManager();
                    XilinxDeviceTree devTree = new XilinxDeviceTree();
                    devTree.Load();
                    manager.Manufacturers.Add(devTree);

                    prj.Device = GetPart(manager, DeviceQueryString);
                    if (prj.Device == null)
                    {
                        Logger.Instance.WriteError("Could not found a device to match the string '{0}'", DeviceQueryString);
                        return;
                    }
                    else
                    {
                        Logger.Instance.WriteVerbose("Selected device '{0}'", prj.Device.Name);
                    }
                }

                if (!string.IsNullOrEmpty(UserConstraintsFile))
                {
                    prj.UserConstraintsFile = Path.GetFullPath(UserConstraintsFile);
                    Logger.Instance.WriteVerbose("Including the user constaints located at '{0}'", prj.UserConstraintsFile);
                }

                foreach (string core in Cores)
                {
                    Logger.Instance.WriteVerbose("Selecting Core: {0}", core);
                    prj.AddAllInLibrary(prj.Environment.GetLibrary(core));
                }

                Logger.Instance.WriteVerbose("Generating...");
                File.WriteAllText(OutputPath, prj.ToString());
                Logger.Instance.WriteVerbose("Generated!");
            }
            else
            {
                Logger.Instance.WriteError("Output Path not specified, terminating...");
                return;
            }
        }
示例#2
0
        public override void Execute()
        {
            base.Execute();

            DeviceManager    manager = new DeviceManager();
            XilinxDeviceTree devTree = new XilinxDeviceTree();

            devTree.Load();
            manager.Manufacturers.Add(devTree);

            // Search the entire tree to get information on the device/part/package/family/etc.
            // currently supporting search by device name, and full device name
            // e.g. xc3s100e
            // e.g. xc3s100evq100
            // e.g. xc3s100evq100-5 or xc3s100e-5vq100

            IEnumerable <object> parts = manager.FindPart(Query);

            Logger.Instance.WriteVerbose("Found {0} matching object(s)", parts.Count());

            foreach (object o in parts)
            {
                if (o is Device)
                {
                    DisplayDevice(o as Device, true, true);
                }
                else if (o is DevicePart)
                {
                    DisplayDevicePart(o as DevicePart, true, true);
                }
                else if (o is DevicePartSpeed)
                {
                    DisplayDevicePartSpeed(o as DevicePartSpeed, true, true);
                }
            }
        }