Beispiel #1
0
 private ProtoCore.VHDL.AST.ModuleNode CreateModule(string componentName, bool isBuiltIn = false)
 {
     ModuleName = componentName;
     if (!ModuleMap.ContainsKey(ModuleName))
     {
         ModuleMap[ModuleName] = new AST.ModuleNode(ModuleName, isBuiltIn);
         return(ModuleMap[ModuleName]);
     }
     return(null);
 }
Beispiel #2
0
        /// <summary>
        /// A default module contains only the following:
        ///     1. Default library list (IEEE)
        ///     2. Default use module list (IEEE numeric)
        ///     3. Reset signal
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ProtoCore.VHDL.AST.ModuleNode CreateAndAppendDefaultModule(string name, bool isBuiltIn = false)
        {
            ModuleName = name;
            Validity.Assert(!ModuleMap.ContainsKey(ModuleName));

            ProtoCore.VHDL.AST.ModuleNode module = new AST.ModuleNode(ModuleName, isBuiltIn);
            ModuleMap[ModuleName] = module;


            // Library list
            List <string> libaryNameList = new List <string>();

            libaryNameList.Add("IEEE");
            module.LibraryList = ProtoCore.VHDL.Utils.GenerateLibraryNodeList(libaryNameList);

            // Module list
            List <string> moduleNameList = new List <string>();

            moduleNameList.Add("IEEE.STD_LOGIC_1164.ALL");
            moduleNameList.Add("IEEE.NUMERIC_STD.ALL");
            module.UseNodeList = ProtoCore.VHDL.Utils.GenerateUseNodeList(moduleNameList);

            return(module);
        }