Наследование: IXmlSerializable
Пример #1
0
 public virtual void Deserialize(XElement element)
 {
     if (string.Compare(element.Name.ToString(), "devicemanufacture") == 0)
     {
         XElement families = element.Element("families");
         foreach (XElement familyElement in families.Elements())
         {
             DeviceFamily family = new DeviceFamily(this);
             family.Deserialize(familyElement);
             Families.Add(family);
         }
     }
 }
Пример #2
0
        public virtual void Deserialize(XElement element)
        {
            if (string.Compare(element.Name.ToString(), "devicemanufacture") == 0)
            {
                // Parse the name
                XAttribute nameAttr = element.Attribute("name");
                if (nameAttr != null)
                {
                    Name = nameAttr.Value;
                }

                XElement families = element.Element("families");
                foreach (XElement familyElement in families.Elements())
                {
                    DeviceFamily family = new DeviceFamily(this);
                    family.Deserialize(familyElement);
                    Families.Add(family);
                }
            }
        }
Пример #3
0
 public DevicePackage(DeviceFamily family, string name)
 {
     Family = family;
     Name   = name;
 }
Пример #4
0
 public DevicePackage(DeviceFamily family)
     : this(family, null)
 {
 }
Пример #5
0
 public DeviceSpeed(DeviceFamily family, string name)
 {
     Family = family;
     Name   = name;
 }
Пример #6
0
 public DeviceSpeed(DeviceFamily family)
     : this(family, null)
 {
 }
Пример #7
0
 public Device(DeviceFamily family, string name)
 {
     Family = family;
     Name   = name;
     Parts  = new List <DevicePart>();
 }
Пример #8
0
 public DeviceSpeed(DeviceFamily family)
     : this(family, null)
 {
 }
Пример #9
0
 public DeviceSpeed(DeviceFamily family, string name)
 {
     Family = family;
     Name = name;
 }
Пример #10
0
 public DevicePackage(DeviceFamily family, string name)
 {
     Family = family;
     Name = name;
 }
Пример #11
0
 public DevicePackage(DeviceFamily family)
     : this(family, null)
 {
 }
 public static void DisplayFamily(DeviceFamily family, bool forward, bool backward)
 {
     if (backward)
     {
         DisplayManufacture(family.Manufacture, false, true);
     }
     Logger.Instance.WriteInfo("  + {0} ({1}) [{2}]", family.Name, family.ShortName, family.Type);
     if (forward)
     {
         foreach (Device device in family.Devices)
         {
             DisplayDevice(device, true, false);
         }
     }
 }
Пример #13
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;
        }
Пример #14
0
 private static void ParseSpeedDetails(XilinxToolchain toolchain, DeviceFamily family, DevicePart part, string speedDetails)
 {
     if (!string.IsNullOrEmpty(speedDetails))
     {
         string[] splitUpSpeeds = speedDetails.Split(new string[] { "    " }, StringSplitOptions.RemoveEmptyEntries);
         foreach (string speed in splitUpSpeeds)
         {
             // Shouldn't start with "("
             if (!speed.StartsWith("("))
             {
                 DeviceSpeed familySpeed = family.CreateSpeed(speed);
                 DevicePartSpeed partSpeed = part.CreateSpeed(familySpeed);
                 partSpeed.AddToolchain(toolchain);
             }
         }
     }
 }