Ejemplo n.º 1
0
 public DeviceFamily(DeviceManufacture manufacture, string name, string shortName)
 {
     Manufacture = manufacture;
     Name        = name;
     ShortName   = shortName;
     Devices     = new List <Device>();
     Packages    = new List <DevicePackage>();
     Speeds      = new List <DeviceSpeed>();
 }
Ejemplo n.º 2
0
 public DeviceFamily(DeviceManufacture manufacture, string name, string shortName, DeviceType type)
 {
     Manufacture = manufacture;
     Name = name;
     ShortName = shortName;
     Type = type;
     Devices = new List<Device>();
     Packages = new List<DevicePackage>();
     Speeds = new List<DeviceSpeed>();
 }
Ejemplo n.º 3
0
 public DeviceManufacture CreateManufacture(string name)
 {
     DeviceManufacture manufacture = FindManufacture(name);
     if (manufacture == null)
     {
         manufacture = new DeviceManufacture(this, name);
         Manufacturers.Add(manufacture);
     }
     return manufacture;
 }
Ejemplo n.º 4
0
 public DeviceFamily(DeviceManufacture manufacture)
     : this(manufacture, null, null, DeviceType.Unknown)
 {
 }
Ejemplo n.º 5
0
 public DeviceFamily(DeviceManufacture manufacture)
     : this(manufacture, null, null)
 {
 }
Ejemplo n.º 6
0
        public void Deserialize(XElement element)
        {
            if (string.Compare(element.Name.ToString(), "devicemanager") == 0)
            {
                // Parse the speeds
                XElement cached = element.Element("cached");
                if (cached != null)
                {
                    foreach (XElement cachedElement in cached.Elements())
                    {
                        ToolchainReference reference = new ToolchainReference();
                        reference.Deserialize(cachedElement);
                        CachedToolchains.Add(reference);
                    }
                }

                // Parse the manufacturers
                XElement manufacturers = element.Element("manufacturers");
                if (manufacturers != null)
                {
                    foreach (XElement manufacturerElement in manufacturers.Elements())
                    {
                        DeviceManufacture manufacturer = new DeviceManufacture(this);
                        manufacturer.Deserialize(manufacturerElement);
                        Manufacturers.Add(manufacturer);
                    }
                }
            }
        }
 public static void DisplayManufacture(DeviceManufacture manufacture, bool forward, bool backward)
 {
     Logger.Instance.WriteInfo("o {0}", manufacture.Name);
     if (forward)
     {
         foreach (DeviceFamily family in manufacture.Families)
         {
             DisplayFamily(family, true, false);
         }
     }
 }
Ejemplo n.º 8
0
        public static DeviceFamily LoadFamily(XilinxToolchain toolchain, DeviceManufacture manufacture, string familyName)
        {
            DeviceFamily family = null;

            List<string> arguments = new List<string>();
            arguments.Add("-intstyle silent");
            arguments.Add("-arch " + familyName);
            ProcessHelper.ProcessExecutionResult result = XilinxProcess.ExecuteProcess(Environment.CurrentDirectory, "partgen", arguments);

            bool startedList = false;
            string realFamilyName = familyName;
            string defaultSpeeds = null;
            Device currentDevice = null;
            DeviceType familyType = ScanDeviceType(familyName);
            using (StringReader reader = new StringReader(result.StandardOutput))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    if (!startedList)
                    {
                        startedList = true;
                        realFamilyName = line.Trim(); // Picked up name
                        family = new DeviceFamily(manufacture, realFamilyName, familyName, familyType);
                    }
                    else if (family != null)
                    {
                        // The first line i the part + speeds, lines afterwards are packages
                        string cleanup = line.Trim();
                        if (line.StartsWith("    "))
                        {
                            if (currentDevice != null)
                            {
                                // Device
                                string[] splitUp = cleanup.Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
                                if (splitUp.Length >= 1 && !string.IsNullOrEmpty(splitUp[0]))
                                {
                                    // Package specifier
                                    Logger.Instance.WriteDebug("Create/Find Package '{0}'", splitUp[0]);
                                    DevicePackage partPackage = family.CreatePackage(splitUp[0]);
                                    Logger.Instance.WriteDebug("Create/Find part with package '{0}'", partPackage.Name);
                                    DevicePart part = currentDevice.CreatePart(partPackage);

                                    // Can have an exclusive set of speeds
                                    ParseSpeedDetails(toolchain, family, part, (splitUp.Length > 1) ? splitUp[1] : defaultSpeeds);
                                }
                            }
                        }
                        else
                        {
                            string[] splitUp = cleanup.Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
                            if (splitUp.Length >= 3 && !string.IsNullOrEmpty(splitUp[0]))
                            {
                                Logger.Instance.WriteDebug("Create/Find Device '{0}'", splitUp[0]);
                                currentDevice = family.CreateDevice(splitUp[0]);
                                defaultSpeeds = splitUp[2]; // Set default speed for devices
                            }
                        }
                    }
                }
            }
            return family;
        }