Esempio n. 1
0
 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);
         }
     }
 }
Esempio n. 2
0
        public static DeviceFamily LoadFamily(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;

            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);
                    }
                    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(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);
        }