Esempio n. 1
0
        private static IEnumerable <string> LoadPaoFileIntoRepositoryRaw(XilinxRepository repository, string filepath, string libraryName)
        {
            List <PaoFileModuleElement> fileElements      = LoadInPaoFile(filepath);
            HashSet <string>            librariesToExpand = new HashSet <string>();
            ILibrary libraryLoading = repository.GetLibraryAutoCreate(libraryName);

            // Expand File Elements
            while (fileElements.Count != 0)
            {
                PaoFileModuleElement element = fileElements[0];
                fileElements.RemoveAt(0);

                // Handles libraries outside of current pao library
                // When creating a library, the library needs to be manually loaded also, add it to the manual load collection
                // This check here ensures the library is only ever loaded once
                if (!repository.LibraryExists(element.Library) && string.Compare(libraryName, element.Library) != 0)
                {
                    librariesToExpand.Add(element.Library);
                }
                ILibrary library = repository.GetLibraryAutoCreate(element.Library);

                if (element.LibraryAllReference)
                {
                    // Collect Expected Libraries to Expand
                    libraryLoading.AddReference(repository.GetLibraryAutoCreate(element.Library));
                    if (repository.VerboseOutput)
                    {
                        Console.WriteLine("Library '{0}' referenced into library '{1}'", element.Library, libraryLoading.Name);
                    }
                }
                else
                {
                    IModule module = new GenericModule(library, element.ModuleType, element.Module);
                    module.Execution = element.ExecutionType;
                    library.AddModule(module);

                    // Check non-specific references
                    if (library != libraryLoading)
                    {
                        libraryLoading.AddReference(library);
                        if (repository.VerboseOutput)
                        {
                            Console.WriteLine("Library '{0}' referenced into library '{1}'", library.Name, libraryLoading.Name);
                        }
                    }
                    if (repository.VerboseOutput)
                    {
                        Console.WriteLine("Module loaded into library '{0}', with module name '{1}'", library.Name, module.RelativeLocation);
                    }
                }
            }

            return(librariesToExpand);
        }
Esempio n. 2
0
        private static IEnumerable<string> LoadPaoFileIntoRepositoryRaw(XilinxRepository repository, string filepath, string libraryName)
        {
            List<PaoFileModuleElement> fileElements = LoadInPaoFile(filepath);
            HashSet<string> librariesToExpand = new HashSet<string>();
            ILibrary libraryLoading = repository.GetLibraryAutoCreate(libraryName);

            // Expand File Elements
            while (fileElements.Count != 0)
            {
                PaoFileModuleElement element = fileElements[0];
                fileElements.RemoveAt(0);

                // Handles libraries outside of current pao library
                // When creating a library, the library needs to be manually loaded also, add it to the manual load collection
                // This check here ensures the library is only ever loaded once
                if (!repository.LibraryExists(element.Library) && string.Compare(libraryName, element.Library) != 0)
                {
                    librariesToExpand.Add(element.Library);
                }
                ILibrary library = repository.GetLibraryAutoCreate(element.Library);

                if (element.LibraryAllReference)
                {
                    // Collect Expected Libraries to Expand
                    libraryLoading.AddReference(repository.GetLibraryAutoCreate(element.Library));
                    if (repository.VerboseOutput)
                    {
                        Console.WriteLine("Library '{0}' referenced into library '{1}'", element.Library, libraryLoading.Name);
                    }
                }
                else
                {
                    IModule module = new GenericModule(library, element.ModuleType, element.Module);
                    module.Execution = element.ExecutionType;
                    library.AddModule(module);

                    // Check non-specific references
                    if (library != libraryLoading)
                    {
                        libraryLoading.AddReference(library);
                        if (repository.VerboseOutput)
                        {
                            Console.WriteLine("Library '{0}' referenced into library '{1}'", library.Name, libraryLoading.Name);
                        }
                    }
                    if (repository.VerboseOutput)
                    {
                        Console.WriteLine("Module loaded into library '{0}', with module name '{1}'", library.Name, module.RelativeLocation);
                    }
                }
            }

            return librariesToExpand;
        }
Esempio n. 3
0
        public static void LoadPaoFileIntoRepository(XilinxRepository repository, string filepath, string libraryName)
        {
            List <string> librariesToExpand = new List <string>();

            librariesToExpand.AddRange(LoadPaoFileIntoRepositoryRaw(repository, filepath, libraryName));

            // Expand Libraries that need manual loading
            while (librariesToExpand.Count != 0)
            {
                string expand = librariesToExpand[0];
                librariesToExpand.RemoveAt(0);

                // Open the relevant PAO File and load in the FileElements
                string paoLocation = repository.GetLibraryPaoFile(expand);
                librariesToExpand.AddRange(LoadPaoFileIntoRepositoryRaw(repository, paoLocation, expand));
            }
        }
Esempio n. 4
0
        public static void LoadPaoFileIntoRepository(XilinxRepository repository, string filepath, string libraryName)
        {
            List<string> librariesToExpand = new List<string>();

            librariesToExpand.AddRange(LoadPaoFileIntoRepositoryRaw(repository, filepath, libraryName));

            // Expand Libraries that need manual loading
            while (librariesToExpand.Count != 0)
            {
                string expand = librariesToExpand[0];
                librariesToExpand.RemoveAt(0);

                // Open the relevant PAO File and load in the FileElements
                string paoLocation = repository.GetLibraryPaoFile(expand);
                librariesToExpand.AddRange(LoadPaoFileIntoRepositoryRaw(repository, paoLocation, expand));
            }
        }