clang-format {DesignCompile Design Config Common CommandLine} header files
diff --git a/SVIncCompil/CommandLine/CommandLineParser.hpp b/SVIncCompil/CommandLine/CommandLineParser.hpp
index e290653..0704410 100644
--- a/SVIncCompil/CommandLine/CommandLineParser.hpp
+++ b/SVIncCompil/CommandLine/CommandLineParser.hpp
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CommandLineParser.hpp
* Author: alain
*
@@ -29,165 +29,180 @@
#include "../SourceCompile/SymbolTable.h"
#include "../ErrorReporting/ErrorContainer.h"
-namespace SURELOG {
+namespace SURELOG {
class CommandLineParser {
-public:
- CommandLineParser(ErrorContainer* errors, SymbolTable* symbolTable, bool diff_comp_mode = false, bool fileUnit = false);
- virtual int parseCommandLine(int argc, const char ** argv);
- CommandLineParser(const CommandLineParser& orig);
- virtual ~CommandLineParser();
-
- /* Verilog command line content */
- const std::vector<SymbolId>& getLibraryPaths() { return m_libraryPaths; }
- const std::vector<SymbolId>& getSourceFiles() { return m_sourceFiles; }
- const std::vector<SymbolId>& getLibraryFiles() { return m_libraryFiles; }
- const std::vector<SymbolId>& getLibraryExtensions() { return m_libraryExtensions; }
- const std::vector<SymbolId>& getIncludePaths() { return m_includePaths; }
- const std::vector<SymbolId>& getOrdredLibraries() { return m_orderedLibraries; }
- const std::vector<SymbolId>& getLibraryMapFiles() { return m_libraryMapFiles; }
- const std::vector<SymbolId>& getConfigFiles() { return m_configFiles; }
- const std::vector<SymbolId>& getUseConfigs() { return m_useConfigs; }
- const std::map<SymbolId,std::string>& getDefineList() { return m_defineList; }
- bool fileunit() { return m_fileunit; } //File or all compilation semantic
+ public:
+ CommandLineParser(ErrorContainer* errors, SymbolTable* symbolTable,
+ bool diff_comp_mode = false, bool fileUnit = false);
+ virtual int parseCommandLine(int argc, const char** argv);
+ CommandLineParser(const CommandLineParser& orig);
+ virtual ~CommandLineParser();
- /* PP Output file/dir options */
- SymbolId writePpOutputFileId() { return m_writePpOutputFileId; }
- SymbolId getOutputDir() { return m_outputDir; }
- SymbolId getCompileAllDir() { return m_compileAllDirectory; }
- SymbolId getCompileUnitDir() { return m_compileUnitDirectory; }
- SymbolId getCompileDir() { return fileunit() ? m_compileUnitDirectory : m_compileAllDirectory; }
- SymbolId getFullCompileDir() { return m_fullCompileDir; }
- SymbolId getLogFileId() { return m_logFileId; }
- SymbolId getDefaultLogFileId() { return m_defaultLogFileId; }
- bool writePpOutput() { return m_writePpOutput; }
- bool cacheAllowed() { return m_cacheAllowed; }
- bool lineOffsetsAsComments() { return m_lineOffsetsAsComments; }
- SymbolId getCacheDir() { return m_cacheDirId; }
- SymbolId getPrecompiledDir() { return m_precompiledDirId; }
- bool usePPOutoutFileLocation() { return m_ppOutputFileLocation; }
- /* PP Output content generation options */
- bool filterFileLine () { return m_filterFileLine; }
- bool filterSimpleDirectives() { return m_filterSimpleDirectives; }
- bool filterProtectedRegions() { return m_filterProtectedRegions; }
- bool filterComments() { return m_filterComments; }
- bool filterInfo() { return !m_info; }
- bool filterNote() { return !m_note; }
- bool filterWarning() { return !m_warning; }
- /* Debug/traces options */
- bool muteStdout() { return m_muteStdout; }
- bool verbose() { return m_verbose; }
- bool profile() { return m_profile; }
- int getDebugLevel() { return m_debugLevel; }
- bool getDebugAstModel() { return m_debugAstModel;}
- bool getDebugInstanceTree() { return m_debugInstanceTree; }
- bool getDebugLibraryDef() { return m_debugLibraryDef; }
- bool getDebugIncludeFileInfo() { return m_debugIncludeFileInfo; }
- bool help() { return m_help; }
- void printBanner();
- void printFooter();
- void logBanner(int argc, const char ** argv);
- void logFooter();
- static std::string getVersionNumber() { return m_versionNumber; }
- /* Core functions options */
- bool parse() { return m_parse; }
- bool compile() { return m_compile; }
- bool elaborate() { return m_elaborate; }
- bool pythonListener() { return m_pythonListener && m_pythonAllowed; }
- bool pythonAllowed() { return m_pythonAllowed; }
-
- bool pythonEvalScriptPerFile() { return m_pythonEvalScriptPerFile && m_pythonAllowed; }
- bool pythonEvalScript() { return m_pythonEvalScript && m_pythonAllowed; }
- SymbolId pythonEvalScriptPerFileId() { return m_pythonEvalScriptPerFileId; }
- SymbolId pythonEvalScriptId() { return m_pythonEvalScriptId; }
- SymbolId pythonListenerId() { return m_pythonListenerFileId; }
- /* Internal */
- ErrorContainer* getErrorContainer() { return m_errors; }
- SymbolTable* getSymbolTable() { return m_symbolTable; }
- unsigned short int getNbMaxTreads() { return m_nbMaxTreads; }
- unsigned int getNbLinesForFileSpliting() { return m_nbLinesForFileSplitting; }
- bool useTbb() { return m_useTbb; }
- std::string getTimeScale() { return m_timescale; }
- bool createCache() { return m_createCache; }
- const std::string currentDateTime();
- bool parseBuiltIn();
+ /* Verilog command line content */
+ const std::vector<SymbolId>& getLibraryPaths() { return m_libraryPaths; }
+ const std::vector<SymbolId>& getSourceFiles() { return m_sourceFiles; }
+ const std::vector<SymbolId>& getLibraryFiles() { return m_libraryFiles; }
+ const std::vector<SymbolId>& getLibraryExtensions() {
+ return m_libraryExtensions;
+ }
+ const std::vector<SymbolId>& getIncludePaths() { return m_includePaths; }
+ const std::vector<SymbolId>& getOrdredLibraries() {
+ return m_orderedLibraries;
+ }
+ const std::vector<SymbolId>& getLibraryMapFiles() {
+ return m_libraryMapFiles;
+ }
+ const std::vector<SymbolId>& getConfigFiles() { return m_configFiles; }
+ const std::vector<SymbolId>& getUseConfigs() { return m_useConfigs; }
+ const std::map<SymbolId, std::string>& getDefineList() {
+ return m_defineList;
+ }
+ bool fileunit() { return m_fileunit; } // File or all compilation semantic
+
+ /* PP Output file/dir options */
+ SymbolId writePpOutputFileId() { return m_writePpOutputFileId; }
+ SymbolId getOutputDir() { return m_outputDir; }
+ SymbolId getCompileAllDir() { return m_compileAllDirectory; }
+ SymbolId getCompileUnitDir() { return m_compileUnitDirectory; }
+ SymbolId getCompileDir() {
+ return fileunit() ? m_compileUnitDirectory : m_compileAllDirectory;
+ }
+ SymbolId getFullCompileDir() { return m_fullCompileDir; }
+ SymbolId getLogFileId() { return m_logFileId; }
+ SymbolId getDefaultLogFileId() { return m_defaultLogFileId; }
+ bool writePpOutput() { return m_writePpOutput; }
+ bool cacheAllowed() { return m_cacheAllowed; }
+ bool lineOffsetsAsComments() { return m_lineOffsetsAsComments; }
+ SymbolId getCacheDir() { return m_cacheDirId; }
+ SymbolId getPrecompiledDir() { return m_precompiledDirId; }
+ bool usePPOutoutFileLocation() { return m_ppOutputFileLocation; }
+ /* PP Output content generation options */
+ bool filterFileLine() { return m_filterFileLine; }
+ bool filterSimpleDirectives() { return m_filterSimpleDirectives; }
+ bool filterProtectedRegions() { return m_filterProtectedRegions; }
+ bool filterComments() { return m_filterComments; }
+ bool filterInfo() { return !m_info; }
+ bool filterNote() { return !m_note; }
+ bool filterWarning() { return !m_warning; }
+ /* Debug/traces options */
+ bool muteStdout() { return m_muteStdout; }
+ bool verbose() { return m_verbose; }
+ bool profile() { return m_profile; }
+ int getDebugLevel() { return m_debugLevel; }
+ bool getDebugAstModel() { return m_debugAstModel; }
+ bool getDebugInstanceTree() { return m_debugInstanceTree; }
+ bool getDebugLibraryDef() { return m_debugLibraryDef; }
+ bool getDebugIncludeFileInfo() { return m_debugIncludeFileInfo; }
+ bool help() { return m_help; }
+ void printBanner();
+ void printFooter();
+ void logBanner(int argc, const char** argv);
+ void logFooter();
+ static std::string getVersionNumber() { return m_versionNumber; }
+ /* Core functions options */
+ bool parse() { return m_parse; }
+ bool compile() { return m_compile; }
+ bool elaborate() { return m_elaborate; }
+ bool pythonListener() { return m_pythonListener && m_pythonAllowed; }
+ bool pythonAllowed() { return m_pythonAllowed; }
+
+ bool pythonEvalScriptPerFile() {
+ return m_pythonEvalScriptPerFile && m_pythonAllowed;
+ }
+ bool pythonEvalScript() { return m_pythonEvalScript && m_pythonAllowed; }
+ SymbolId pythonEvalScriptPerFileId() { return m_pythonEvalScriptPerFileId; }
+ SymbolId pythonEvalScriptId() { return m_pythonEvalScriptId; }
+ SymbolId pythonListenerId() { return m_pythonListenerFileId; }
+ /* Internal */
+ ErrorContainer* getErrorContainer() { return m_errors; }
+ SymbolTable* getSymbolTable() { return m_symbolTable; }
+ unsigned short int getNbMaxTreads() { return m_nbMaxTreads; }
+ unsigned int getNbLinesForFileSpliting() { return m_nbLinesForFileSplitting; }
+ bool useTbb() { return m_useTbb; }
+ std::string getTimeScale() { return m_timescale; }
+ bool createCache() { return m_createCache; }
+ const std::string currentDateTime();
+ bool parseBuiltIn();
+
private:
- bool plus_arguments_ (const std::string& s);
- void processArgs_ (std::vector<std::string>& args, std::vector<std::string>& container);
- void splitPlusArg_(std::string s, std::string prefix, std::vector<SymbolId>& container);
- void splitPlusArg_(std::string s, std::string prefix, std::map<SymbolId,std::string>& container);
- bool checkCommandLine_();
- bool prepareCompilation_(int argc, const char ** argv);
- std::vector<SymbolId> m_libraryPaths; // -y
- std::vector<SymbolId> m_sourceFiles; // .v .sv
- std::vector<SymbolId> m_libraryFiles; // -v
- std::vector<SymbolId> m_includePaths; // +incdir+
- std::vector<SymbolId> m_libraryExtensions; // +libext+
- std::vector<SymbolId> m_orderedLibraries; // -L <libName>
- std::vector<SymbolId> m_libraryMapFiles; // -map
- std::vector<SymbolId> m_configFiles; // -cfgFile <config file>
- std::vector<SymbolId> m_useConfigs; // -cfg <configName>
- std::map<SymbolId,std::string> m_defineList; // +define+
- SymbolId m_writePpOutputFileId;
- bool m_writePpOutput;
- bool m_filterFileLine;
- int m_debugLevel;
- ErrorContainer* m_errors;
- SymbolTable* m_symbolTable;
- SymbolId m_logFileId;
- bool m_lineOffsetsAsComments;
- bool m_liborder;
- bool m_librescan;
- bool m_libverbose;
- bool m_nolibcell;
- bool m_muteStdout;
- bool m_verbose;
- bool m_fileunit;
- bool m_filterSimpleDirectives;
- bool m_filterProtectedRegions;
- bool m_filterComments;
- bool m_parse;
- bool m_compile;
- bool m_elaborate;
- bool m_diff_comp_mode;
- bool m_help;
- bool m_cacheAllowed;
- unsigned short int m_nbMaxTreads;
- SymbolId m_compileUnitDirectory;
- SymbolId m_compileAllDirectory;
- SymbolId m_outputDir;
- SymbolId m_fullCompileDir;
- SymbolId m_defaultLogFileId;
- SymbolId m_defaultCacheDirId;
- SymbolId m_cacheDirId;
- SymbolId m_precompiledDirId;
- static std::string m_versionNumber;
- bool m_note;
- bool m_info;
- bool m_warning;
- bool m_pythonListener;
- bool m_debugAstModel;
- bool m_debugInstanceTree;
- bool m_debugLibraryDef;
- bool m_useTbb;
- bool m_pythonAllowed;
- unsigned int m_nbLinesForFileSplitting;
- std::string m_timescale;
- bool m_pythonEvalScriptPerFile;
- bool m_pythonEvalScript;
- SymbolId m_pythonEvalScriptPerFileId;
- SymbolId m_pythonEvalScriptId;
- SymbolId m_pythonListenerFileId;
- bool m_debugIncludeFileInfo;
- bool m_createCache;
- bool m_profile;
- bool m_parseBuiltIn;
- bool m_ppOutputFileLocation;
- bool m_logFileSpecified;
+ bool plus_arguments_(const std::string& s);
+ void processArgs_(std::vector<std::string>& args,
+ std::vector<std::string>& container);
+ void splitPlusArg_(std::string s, std::string prefix,
+ std::vector<SymbolId>& container);
+ void splitPlusArg_(std::string s, std::string prefix,
+ std::map<SymbolId, std::string>& container);
+ bool checkCommandLine_();
+ bool prepareCompilation_(int argc, const char** argv);
+ std::vector<SymbolId> m_libraryPaths; // -y
+ std::vector<SymbolId> m_sourceFiles; // .v .sv
+ std::vector<SymbolId> m_libraryFiles; // -v
+ std::vector<SymbolId> m_includePaths; // +incdir+
+ std::vector<SymbolId> m_libraryExtensions; // +libext+
+ std::vector<SymbolId> m_orderedLibraries; // -L <libName>
+ std::vector<SymbolId> m_libraryMapFiles; // -map
+ std::vector<SymbolId> m_configFiles; // -cfgFile <config file>
+ std::vector<SymbolId> m_useConfigs; // -cfg <configName>
+ std::map<SymbolId, std::string> m_defineList; // +define+
+ SymbolId m_writePpOutputFileId;
+ bool m_writePpOutput;
+ bool m_filterFileLine;
+ int m_debugLevel;
+ ErrorContainer* m_errors;
+ SymbolTable* m_symbolTable;
+ SymbolId m_logFileId;
+ bool m_lineOffsetsAsComments;
+ bool m_liborder;
+ bool m_librescan;
+ bool m_libverbose;
+ bool m_nolibcell;
+ bool m_muteStdout;
+ bool m_verbose;
+ bool m_fileunit;
+ bool m_filterSimpleDirectives;
+ bool m_filterProtectedRegions;
+ bool m_filterComments;
+ bool m_parse;
+ bool m_compile;
+ bool m_elaborate;
+ bool m_diff_comp_mode;
+ bool m_help;
+ bool m_cacheAllowed;
+ unsigned short int m_nbMaxTreads;
+ SymbolId m_compileUnitDirectory;
+ SymbolId m_compileAllDirectory;
+ SymbolId m_outputDir;
+ SymbolId m_fullCompileDir;
+ SymbolId m_defaultLogFileId;
+ SymbolId m_defaultCacheDirId;
+ SymbolId m_cacheDirId;
+ SymbolId m_precompiledDirId;
+ static std::string m_versionNumber;
+ bool m_note;
+ bool m_info;
+ bool m_warning;
+ bool m_pythonListener;
+ bool m_debugAstModel;
+ bool m_debugInstanceTree;
+ bool m_debugLibraryDef;
+ bool m_useTbb;
+ bool m_pythonAllowed;
+ unsigned int m_nbLinesForFileSplitting;
+ std::string m_timescale;
+ bool m_pythonEvalScriptPerFile;
+ bool m_pythonEvalScript;
+ SymbolId m_pythonEvalScriptPerFileId;
+ SymbolId m_pythonEvalScriptId;
+ SymbolId m_pythonListenerFileId;
+ bool m_debugIncludeFileInfo;
+ bool m_createCache;
+ bool m_profile;
+ bool m_parseBuiltIn;
+ bool m_ppOutputFileLocation;
+ bool m_logFileSpecified;
};
-};
+}; // namespace SURELOG
#endif /* COMMANDLINEPARSER_HPP */
-
-
diff --git a/SVIncCompil/Common/ClockingBlockHolder.h b/SVIncCompil/Common/ClockingBlockHolder.h
index ab2d04a..ee6fc73 100644
--- a/SVIncCompil/Common/ClockingBlockHolder.h
+++ b/SVIncCompil/Common/ClockingBlockHolder.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: ClockingBlockHolder.h
* Author: alain
*
@@ -31,20 +31,19 @@
namespace SURELOG {
class ClockingBlockHolder {
-public:
- ClockingBlockHolder() {}
- virtual ~ClockingBlockHolder() {}
-
- typedef std::map<SymbolId, ClockingBlock> ClockingBlockMap;
- ClockingBlockMap& getClockingBlockMap() { return m_clockingBlockMap; }
- void addClockingBlock(SymbolId blockId, ClockingBlock& block);
- ClockingBlock* getClockingBlock(SymbolId blockId);
-private:
- ClockingBlockMap m_clockingBlockMap;
+ public:
+ ClockingBlockHolder() {}
+ virtual ~ClockingBlockHolder() {}
+
+ typedef std::map<SymbolId, ClockingBlock> ClockingBlockMap;
+ ClockingBlockMap& getClockingBlockMap() { return m_clockingBlockMap; }
+ void addClockingBlock(SymbolId blockId, ClockingBlock& block);
+ ClockingBlock* getClockingBlock(SymbolId blockId);
+
+ private:
+ ClockingBlockMap m_clockingBlockMap;
};
-};
+}; // namespace SURELOG
#endif /* CLOCKINGBLOCKHOLDER_H */
-
-
diff --git a/SVIncCompil/Config/Config.h b/SVIncCompil/Config/Config.h
index 7591f4f..0c2d97d 100644
--- a/SVIncCompil/Config/Config.h
+++ b/SVIncCompil/Config/Config.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: Config.h
* Author: alain
*
@@ -31,72 +31,91 @@
namespace SURELOG {
class UseClause {
-public:
- typedef enum {
- UseLib,
- UseConfig,
- UseModule,
- UseParam
- } Type;
- UseClause(Type type, std::string name, FileContent* fC, NodeId id) : m_type(type), m_name(name), m_fileContent(fC), m_node(id), m_used(false) {}
- UseClause(Type type, FileContent* fC, NodeId id) : m_type(type), m_name(""), m_fileContent(fC), m_node(id), m_used(false) {}
- UseClause(Type type, std::vector<std::string>& libs, FileContent* fC, NodeId id) : m_type(type), m_name(""), m_libs(libs), m_fileContent(fC), m_node(id), m_used(false) {}
- Type getType() { return m_type; }
- std::string getName() { return m_name; }
- std::vector<std::string> getLibs() { return m_libs; }
- FileContent* getFileContent() { return m_fileContent; }
- NodeId getNodeId() { return m_node; }
- void setUsed() { m_used = true; }
- bool isUsed () { return m_used; }
-private:
- Type m_type;
- std::string m_name;
- std::vector<std::string> m_libs;
- FileContent* m_fileContent;
- NodeId m_node;
- bool m_used;
-};
-
-
-class Config {
-public:
- Config(std::string name, FileContent* fC, NodeId nodeId) : m_name(name), m_fileContent(fC), m_nodeId(nodeId), m_used(false), m_isTopLevel(false) {}
- void setIsUsed() { m_used = true; }
- void setDesignTop(std::string top) { m_designTop = top; }
- void setDesignLib(std::string lib) { m_designLib = lib; }
- void addDefaultLib(std::string lib) { m_defaultLibs.push_back(lib); }
- void addInstanceUseClause(std::string instance, UseClause use);
- void addCellUseClause(std::string cell, UseClause use);
- virtual ~Config();
- std::string getName() { return m_name; }
- FileContent* getFileContent() { return m_fileContent; }
- NodeId getNodeId() { return m_nodeId; }
- bool isUsed() { return m_used; }
- std::string getDesignTop() { return m_designTop; }
- std::string getDesignLib() { return m_designLib; }
- std::vector<std::string>& getDefaultLibs() { return m_defaultLibs; }
- std::map<std::string, UseClause>& getInstanceUseClauses() { return m_instanceUseClauses; }
- UseClause* getInstanceUseClause(std::string instance);
- std::map<std::string, UseClause>& getCellUseClauses() { return m_cellUseClauses; }
- UseClause* getCellUseClause(std::string cell);
- bool isTopLevel() { return m_isTopLevel; }
- void setTopLevel(bool top) { m_isTopLevel = top; }
-private:
- std::string m_name;
- FileContent* m_fileContent;
- NodeId m_nodeId;
- bool m_used;
- bool m_isTopLevel;
- std::string m_designLib;
- std::string m_designTop;
- std::vector<std::string> m_defaultLibs;
- std::map<std::string, UseClause> m_instanceUseClauses;
- std::map<std::string, UseClause> m_cellUseClauses;
-
+ public:
+ typedef enum { UseLib, UseConfig, UseModule, UseParam } Type;
+ UseClause(Type type, std::string name, FileContent* fC, NodeId id)
+ : m_type(type),
+ m_name(name),
+ m_fileContent(fC),
+ m_node(id),
+ m_used(false) {}
+ UseClause(Type type, FileContent* fC, NodeId id)
+ : m_type(type),
+ m_name(""),
+ m_fileContent(fC),
+ m_node(id),
+ m_used(false) {}
+ UseClause(Type type, std::vector<std::string>& libs, FileContent* fC,
+ NodeId id)
+ : m_type(type),
+ m_name(""),
+ m_libs(libs),
+ m_fileContent(fC),
+ m_node(id),
+ m_used(false) {}
+ Type getType() { return m_type; }
+ std::string getName() { return m_name; }
+ std::vector<std::string> getLibs() { return m_libs; }
+ FileContent* getFileContent() { return m_fileContent; }
+ NodeId getNodeId() { return m_node; }
+ void setUsed() { m_used = true; }
+ bool isUsed() { return m_used; }
+
+ private:
+ Type m_type;
+ std::string m_name;
+ std::vector<std::string> m_libs;
+ FileContent* m_fileContent;
+ NodeId m_node;
+ bool m_used;
};
+class Config {
+ public:
+ Config(std::string name, FileContent* fC, NodeId nodeId)
+ : m_name(name),
+ m_fileContent(fC),
+ m_nodeId(nodeId),
+ m_used(false),
+ m_isTopLevel(false) {}
+ void setIsUsed() { m_used = true; }
+ void setDesignTop(std::string top) { m_designTop = top; }
+ void setDesignLib(std::string lib) { m_designLib = lib; }
+ void addDefaultLib(std::string lib) { m_defaultLibs.push_back(lib); }
+ void addInstanceUseClause(std::string instance, UseClause use);
+ void addCellUseClause(std::string cell, UseClause use);
+ virtual ~Config();
+ std::string getName() { return m_name; }
+ FileContent* getFileContent() { return m_fileContent; }
+ NodeId getNodeId() { return m_nodeId; }
+ bool isUsed() { return m_used; }
+ std::string getDesignTop() { return m_designTop; }
+ std::string getDesignLib() { return m_designLib; }
+ std::vector<std::string>& getDefaultLibs() { return m_defaultLibs; }
+ std::map<std::string, UseClause>& getInstanceUseClauses() {
+ return m_instanceUseClauses;
+ }
+ UseClause* getInstanceUseClause(std::string instance);
+ std::map<std::string, UseClause>& getCellUseClauses() {
+ return m_cellUseClauses;
+ }
+ UseClause* getCellUseClause(std::string cell);
+ bool isTopLevel() { return m_isTopLevel; }
+ void setTopLevel(bool top) { m_isTopLevel = top; }
+
+ private:
+ std::string m_name;
+ FileContent* m_fileContent;
+ NodeId m_nodeId;
+ bool m_used;
+ bool m_isTopLevel;
+ std::string m_designLib;
+ std::string m_designTop;
+ std::vector<std::string> m_defaultLibs;
+ std::map<std::string, UseClause> m_instanceUseClauses;
+ std::map<std::string, UseClause> m_cellUseClauses;
};
+}; // namespace SURELOG
+
#endif /* CONFIG_H */
-
-
diff --git a/SVIncCompil/Config/ConfigSet.h b/SVIncCompil/Config/ConfigSet.h
index 850d5f9..e999c49 100644
--- a/SVIncCompil/Config/ConfigSet.h
+++ b/SVIncCompil/Config/ConfigSet.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: ConfigSet.h
* Author: alain
*
@@ -29,18 +29,17 @@
namespace SURELOG {
class ConfigSet {
-public:
- ConfigSet() {}
- virtual ~ConfigSet();
- void addConfig(Config& config) { m_configs.push_back(config) ; }
- std::vector<Config>& getAllConfigs() { return m_configs; }
- Config* getConfig(std::string configName);
-private:
- std::vector<Config> m_configs;
+ public:
+ ConfigSet() {}
+ virtual ~ConfigSet();
+ void addConfig(Config& config) { m_configs.push_back(config); }
+ std::vector<Config>& getAllConfigs() { return m_configs; }
+ Config* getConfig(std::string configName);
+
+ private:
+ std::vector<Config> m_configs;
};
-};
+}; // namespace SURELOG
#endif /* CONFIGSET_H */
-
-
diff --git a/SVIncCompil/DesignCompile/Builtin.h b/SVIncCompil/DesignCompile/Builtin.h
index 37f54df..6808874 100644
--- a/SVIncCompil/DesignCompile/Builtin.h
+++ b/SVIncCompil/DesignCompile/Builtin.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: Builtin.h
* Author: alain
*
@@ -25,23 +25,21 @@
#define BUILTIN_H
namespace SURELOG {
-
+
class Design;
-
+
class Builtin {
-
-public:
- Builtin(Design* design) : m_design(design) {}
-
- void addBuiltins();
+ public:
+ Builtin(Design* design) : m_design(design) {}
- virtual ~Builtin();
-private:
- Design* m_design;
+ void addBuiltins();
+
+ virtual ~Builtin();
+
+ private:
+ Design* m_design;
};
-};
+}; // namespace SURELOG
#endif /* BUILTIN_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileClass.h b/SVIncCompil/DesignCompile/CompileClass.h
index db03914..ec1ad44 100644
--- a/SVIncCompil/DesignCompile/CompileClass.h
+++ b/SVIncCompil/DesignCompile/CompileClass.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileClass.h
* Author: alain
*
@@ -28,54 +28,60 @@
namespace SURELOG {
- struct FunctorCompileClass {
+struct FunctorCompileClass {
+ FunctorCompileClass(CompileDesign* compiler, ClassDefinition* classDef,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_class(classDef),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {}
+ int operator()() const;
- FunctorCompileClass(CompileDesign* compiler, ClassDefinition* classDef, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_class(classDef), m_design(design), m_symbols(symbols), m_errors(errors) {
- }
- int operator()() const;
-
- private:
- CompileDesign* m_compileDesign;
- ClassDefinition* m_class;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- };
-
- class CompileClass {
- public:
-
- CompileClass(CompileDesign* compiler, ClassDefinition* classDef, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_class(classDef), m_design(design), m_symbols(symbols), m_errors(errors) {
- m_helper.seterrorReporting(errors, symbols);
- }
-
- virtual ~CompileClass();
-
- bool compile();
-
- private:
- CompileDesign* m_compileDesign;
- ClassDefinition* m_class;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- CompileHelper m_helper;
- bool compile_class_parameters_(FileContent* fC, NodeId id);
- bool compile_class_property_(FileContent* fC, NodeId id);
- bool compile_class_method_(FileContent* fC, NodeId id);
- bool compile_class_constraint_(FileContent* fC, NodeId id);
- bool compile_type_declaration_(FileContent* fC, NodeId id);
- bool compile_class_declaration_(FileContent* fC, NodeId id);
- bool compile_covergroup_declaration_(FileContent* fC, NodeId id);
- bool compile_local_parameter_declaration_(FileContent* fC, NodeId id);
- bool compile_parameter_declaration_(FileContent* fC, NodeId id);
- bool compile_class_type_(FileContent* fC, NodeId id);
- };
-
+ private:
+ CompileDesign* m_compileDesign;
+ ClassDefinition* m_class;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
};
+class CompileClass {
+ public:
+ CompileClass(CompileDesign* compiler, ClassDefinition* classDef,
+ Design* design, SymbolTable* symbols, ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_class(classDef),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {
+ m_helper.seterrorReporting(errors, symbols);
+ }
+
+ virtual ~CompileClass();
+
+ bool compile();
+
+ private:
+ CompileDesign* m_compileDesign;
+ ClassDefinition* m_class;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+ CompileHelper m_helper;
+ bool compile_class_parameters_(FileContent* fC, NodeId id);
+ bool compile_class_property_(FileContent* fC, NodeId id);
+ bool compile_class_method_(FileContent* fC, NodeId id);
+ bool compile_class_constraint_(FileContent* fC, NodeId id);
+ bool compile_type_declaration_(FileContent* fC, NodeId id);
+ bool compile_class_declaration_(FileContent* fC, NodeId id);
+ bool compile_covergroup_declaration_(FileContent* fC, NodeId id);
+ bool compile_local_parameter_declaration_(FileContent* fC, NodeId id);
+ bool compile_parameter_declaration_(FileContent* fC, NodeId id);
+ bool compile_class_type_(FileContent* fC, NodeId id);
+};
+
+}; // namespace SURELOG
+
#endif /* COMPILECLASS_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileDesign.h b/SVIncCompil/DesignCompile/CompileDesign.h
index 7e33265..40a311c 100644
--- a/SVIncCompil/DesignCompile/CompileDesign.h
+++ b/SVIncCompil/DesignCompile/CompileDesign.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileDesign.h
* Author: alain
*
@@ -25,36 +25,33 @@
#define COMPILEDESIGN_H
namespace SURELOG {
-
class CompileDesign {
-public:
- CompileDesign(Compiler* compiler);
-
- bool compile();
- bool elaborate();
-
- CompileDesign(const CompileDesign& orig);
- virtual ~CompileDesign();
- Compiler* getCompiler() { return m_compiler; }
-private:
-
- template <class ObjectType, class ObjectMapType, typename FunctorType>
- void compileMT_ (ObjectMapType& objects, int maxThreadCount);
-
- void collectObjects_ (Design::FileIdDesignContentMap& all_files, Design* design, bool finalCollection);
- bool preCompile_();
- bool checkPrecompilation_();
- bool elaboration_();
-
-
- Compiler* m_compiler;
- std::vector<SymbolTable*> m_symbolTables;
- std::vector<ErrorContainer*> m_errorContainers;
+ public:
+ CompileDesign(Compiler* compiler);
+
+ bool compile();
+ bool elaborate();
+
+ CompileDesign(const CompileDesign& orig);
+ virtual ~CompileDesign();
+ Compiler* getCompiler() { return m_compiler; }
+
+ private:
+ template <class ObjectType, class ObjectMapType, typename FunctorType>
+ void compileMT_(ObjectMapType& objects, int maxThreadCount);
+
+ void collectObjects_(Design::FileIdDesignContentMap& all_files,
+ Design* design, bool finalCollection);
+ bool preCompile_();
+ bool checkPrecompilation_();
+ bool elaboration_();
+
+ Compiler* m_compiler;
+ std::vector<SymbolTable*> m_symbolTables;
+ std::vector<ErrorContainer*> m_errorContainers;
};
-};
+}; // namespace SURELOG
#endif /* COMPILEDESIGN_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileFileContent.h b/SVIncCompil/DesignCompile/CompileFileContent.h
index b892792..6823b40 100644
--- a/SVIncCompil/DesignCompile/CompileFileContent.h
+++ b/SVIncCompil/DesignCompile/CompileFileContent.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileFileContent.h
* Author: alain
*
@@ -27,46 +27,52 @@
#include "CompileHelper.h"
namespace SURELOG {
-
- struct FunctorCompileFileContent {
- FunctorCompileFileContent(CompileDesign* compiler, FileContent* file, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_fileContent(file), m_design(design), m_symbols(symbols), m_errors(errors) {
- }
- int operator()() const;
+struct FunctorCompileFileContent {
+ FunctorCompileFileContent(CompileDesign* compiler, FileContent* file,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_fileContent(file),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {}
+ int operator()() const;
- private:
- CompileDesign* m_compileDesign;
- FileContent* m_fileContent;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
-
- };
-
- class CompileFileContent {
- public:
-
- CompileFileContent(CompileDesign* compiler, FileContent* file, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_fileContent(file), m_design(design), m_symbols(symbols), m_errors(errors) {
- m_helper.seterrorReporting(errors,symbols);
- }
-
- bool compile();
-
- virtual ~CompileFileContent();
- private:
- bool collectObjects_();
- CompileDesign* m_compileDesign;
- FileContent* m_fileContent;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- CompileHelper m_helper;
- };
-
+ private:
+ CompileDesign* m_compileDesign;
+ FileContent* m_fileContent;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
};
+class CompileFileContent {
+ public:
+ CompileFileContent(CompileDesign* compiler, FileContent* file, Design* design,
+ SymbolTable* symbols, ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_fileContent(file),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {
+ m_helper.seterrorReporting(errors, symbols);
+ }
+
+ bool compile();
+
+ virtual ~CompileFileContent();
+
+ private:
+ bool collectObjects_();
+ CompileDesign* m_compileDesign;
+ FileContent* m_fileContent;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+ CompileHelper m_helper;
+};
+
+}; // namespace SURELOG
+
#endif /* COMPILEFILECONTENT_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileHelper.h b/SVIncCompil/DesignCompile/CompileHelper.h
index 92a1886..368a909 100644
--- a/SVIncCompil/DesignCompile/CompileHelper.h
+++ b/SVIncCompil/DesignCompile/CompileHelper.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileHelper.h
* Author: alain
*
@@ -33,48 +33,60 @@
#include "../ErrorReporting/ErrorContainer.h"
namespace SURELOG {
- class Scope;
- class Statement;
- class Design;
- typedef std::vector<TfPortItem*> TfPortList;
-
+class Scope;
+class Statement;
+class Design;
+typedef std::vector<TfPortItem*> TfPortList;
+
class CompileHelper {
-public:
- CompileHelper() {}
-
- void seterrorReporting(ErrorContainer* errors, SymbolTable* symbols) { m_errors = errors; m_symbols = symbols; m_exprBuilder.seterrorReporting(errors, symbols); }
+ public:
+ CompileHelper() {}
- bool importPackage(DesignComponent* scope, Design* design, FileContent* fC, NodeId id);
-
- bool compileTfPortList(Procedure* parent, FileContent* fC, NodeId id, TfPortList& targetList);
-
- DataType* compileTypeDef(DesignComponent* scope, FileContent* fC, NodeId id);
-
- bool compileScopeBody(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- bool compileScopeVariable (Scope* parent, FileContent* fC, NodeId id);
-
- bool compileSubroutine_call(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- bool compileSeqBlock_stmt(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- bool compileLoop_stmt(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- bool compileForLoop_stmt(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- bool compileForeachLoop_stmt(Scope* parent, Statement* parentStmt, FileContent* fC, NodeId id);
-
- Function* compileFunctionPrototype(DesignComponent* scope, FileContent* fC, NodeId id);
-
- virtual ~CompileHelper();
-private:
- ErrorContainer* m_errors;
- SymbolTable* m_symbols;
- ExprBuilder m_exprBuilder;
+ void seterrorReporting(ErrorContainer* errors, SymbolTable* symbols) {
+ m_errors = errors;
+ m_symbols = symbols;
+ m_exprBuilder.seterrorReporting(errors, symbols);
+ }
+
+ bool importPackage(DesignComponent* scope, Design* design, FileContent* fC,
+ NodeId id);
+
+ bool compileTfPortList(Procedure* parent, FileContent* fC, NodeId id,
+ TfPortList& targetList);
+
+ DataType* compileTypeDef(DesignComponent* scope, FileContent* fC, NodeId id);
+
+ bool compileScopeBody(Scope* parent, Statement* parentStmt, FileContent* fC,
+ NodeId id);
+
+ bool compileScopeVariable(Scope* parent, FileContent* fC, NodeId id);
+
+ bool compileSubroutine_call(Scope* parent, Statement* parentStmt,
+ FileContent* fC, NodeId id);
+
+ bool compileSeqBlock_stmt(Scope* parent, Statement* parentStmt,
+ FileContent* fC, NodeId id);
+
+ bool compileLoop_stmt(Scope* parent, Statement* parentStmt, FileContent* fC,
+ NodeId id);
+
+ bool compileForLoop_stmt(Scope* parent, Statement* parentStmt,
+ FileContent* fC, NodeId id);
+
+ bool compileForeachLoop_stmt(Scope* parent, Statement* parentStmt,
+ FileContent* fC, NodeId id);
+
+ Function* compileFunctionPrototype(DesignComponent* scope, FileContent* fC,
+ NodeId id);
+
+ virtual ~CompileHelper();
+
+ private:
+ ErrorContainer* m_errors;
+ SymbolTable* m_symbols;
+ ExprBuilder m_exprBuilder;
};
-};
+}; // namespace SURELOG
#endif /* COMPILEHELPER_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileModule.h b/SVIncCompil/DesignCompile/CompileModule.h
index 4e66c38..af912ea 100644
--- a/SVIncCompil/DesignCompile/CompileModule.h
+++ b/SVIncCompil/DesignCompile/CompileModule.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileModule.h
* Author: alain
*
@@ -26,52 +26,57 @@
#include "CompileHelper.h"
-
namespace SURELOG {
- struct FunctorCompileModule {
+struct FunctorCompileModule {
+ FunctorCompileModule(CompileDesign* compiler, ModuleDefinition* module,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_module(module),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {}
+ int operator()() const;
- FunctorCompileModule(CompileDesign* compiler, ModuleDefinition* module, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_module(module), m_design(design), m_symbols(symbols), m_errors(errors) {
- }
- int operator()() const;
+ private:
+ CompileDesign* m_compileDesign;
+ ModuleDefinition* m_module;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+};
- private:
- CompileDesign* m_compileDesign;
- ModuleDefinition* m_module;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
-
- };
-
-
class CompileModule {
-public:
- CompileModule(CompileDesign* compiler, ModuleDefinition* module, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_module(module), m_design(design), m_symbols(symbols), m_errors(errors) {
- m_helper.seterrorReporting(errors, symbols);
- }
-
- bool compile();
-
- virtual ~CompileModule();
-private:
- bool collectModuleObjects_();
- bool checkModule_();
- bool collectInterfaceObjects_();
- bool checkInterface_();
- void compileClockingBlock_ (FileContent* fC, NodeId id);
- CompileDesign* m_compileDesign;
- ModuleDefinition* m_module;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- CompileHelper m_helper;
+ public:
+ CompileModule(CompileDesign* compiler, ModuleDefinition* module,
+ Design* design, SymbolTable* symbols, ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_module(module),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {
+ m_helper.seterrorReporting(errors, symbols);
+ }
+
+ bool compile();
+
+ virtual ~CompileModule();
+
+ private:
+ bool collectModuleObjects_();
+ bool checkModule_();
+ bool collectInterfaceObjects_();
+ bool checkInterface_();
+ void compileClockingBlock_(FileContent* fC, NodeId id);
+ CompileDesign* m_compileDesign;
+ ModuleDefinition* m_module;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+ CompileHelper m_helper;
};
-};
+}; // namespace SURELOG
#endif /* COMPILEMODULE_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompilePackage.h b/SVIncCompil/DesignCompile/CompilePackage.h
index 61e24a7..b06507e 100644
--- a/SVIncCompil/DesignCompile/CompilePackage.h
+++ b/SVIncCompil/DesignCompile/CompilePackage.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompilePackage.h
* Author: alain
*
@@ -26,44 +26,51 @@
namespace SURELOG {
- struct FunctorCompilePackage {
+struct FunctorCompilePackage {
+ FunctorCompilePackage(CompileDesign* compiler, Package* package,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_package(package),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {}
+ int operator()() const;
- FunctorCompilePackage(CompileDesign* compiler, Package* package, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_package(package), m_design(design), m_symbols(symbols), m_errors(errors) {
- }
- int operator()() const;
+ private:
+ CompileDesign* m_compileDesign;
+ Package* m_package;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+};
- private:
- CompileDesign* m_compileDesign;
- Package* m_package;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- };
-
-
class CompilePackage {
-public:
- CompilePackage(CompileDesign* compiler, Package* package, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_package(package), m_design(design), m_symbols(symbols), m_errors(errors) {
- m_helper.seterrorReporting(errors,symbols);
- }
-
- bool compile();
-
- virtual ~CompilePackage();
-private:
- bool collectObjects_();
- CompileDesign* m_compileDesign;
- Package* m_package;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- CompileHelper m_helper;
+ public:
+ CompilePackage(CompileDesign* compiler, Package* package, Design* design,
+ SymbolTable* symbols, ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_package(package),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {
+ m_helper.seterrorReporting(errors, symbols);
+ }
+
+ bool compile();
+
+ virtual ~CompilePackage();
+
+ private:
+ bool collectObjects_();
+ CompileDesign* m_compileDesign;
+ Package* m_package;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+ CompileHelper m_helper;
};
-};
+}; // namespace SURELOG
#endif /* COMPILEPACKAGE_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileProgram.h b/SVIncCompil/DesignCompile/CompileProgram.h
index 34a7ccb..aac270c 100644
--- a/SVIncCompil/DesignCompile/CompileProgram.h
+++ b/SVIncCompil/DesignCompile/CompileProgram.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileProgram.h
* Author: alain
*
@@ -29,44 +29,50 @@
namespace SURELOG {
- struct FunctorCompileProgram {
+struct FunctorCompileProgram {
+ FunctorCompileProgram(CompileDesign* compiler, Program* program,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_program(program),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {}
+ int operator()() const;
- FunctorCompileProgram(CompileDesign* compiler, Program* program, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_program(program), m_design(design), m_symbols(symbols), m_errors(errors) {
- }
- int operator()() const;
+ private:
+ CompileDesign* m_compileDesign;
+ Program* m_program;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+};
- private:
- CompileDesign* m_compileDesign;
- Program* m_program;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
-
- };
-
class CompileProgram : public CompileToolbox {
-public:
- CompileProgram(CompileDesign* compiler, Program* program, Design* design, SymbolTable* symbols, ErrorContainer* errors) :
- m_compileDesign(compiler), m_program(program), m_design(design), m_symbols(symbols), m_errors(errors) {
- m_helper.seterrorReporting(errors, symbols);
- }
+ public:
+ CompileProgram(CompileDesign* compiler, Program* program, Design* design,
+ SymbolTable* symbols, ErrorContainer* errors)
+ : m_compileDesign(compiler),
+ m_program(program),
+ m_design(design),
+ m_symbols(symbols),
+ m_errors(errors) {
+ m_helper.seterrorReporting(errors, symbols);
+ }
- bool compile();
-
- virtual ~CompileProgram();
-private:
-
- CompileDesign* m_compileDesign;
- Program* m_program;
- Design* m_design;
- SymbolTable* m_symbols;
- ErrorContainer* m_errors;
- CompileHelper m_helper;
+ bool compile();
+
+ virtual ~CompileProgram();
+
+ private:
+ CompileDesign* m_compileDesign;
+ Program* m_program;
+ Design* m_design;
+ SymbolTable* m_symbols;
+ ErrorContainer* m_errors;
+ CompileHelper m_helper;
};
-};
+}; // namespace SURELOG
#endif /* COMPILEPROGRAM_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileStep.h b/SVIncCompil/DesignCompile/CompileStep.h
index d6af56f..e675a63 100644
--- a/SVIncCompil/DesignCompile/CompileStep.h
+++ b/SVIncCompil/DesignCompile/CompileStep.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileStep.h
* Author: alain
*
@@ -26,53 +26,57 @@
#include "../Design/VObject.h"
namespace SURELOG {
- class CompileStep {
- public:
- CompileStep();
- CompileStep(const CompileStep& orig);
- virtual ~CompileStep();
+class CompileStep {
+ public:
+ CompileStep();
+ CompileStep(const CompileStep& orig);
+ virtual ~CompileStep();
- virtual VObject& Object(NodeId index) = 0;
+ virtual VObject& Object(NodeId index) = 0;
- virtual NodeId UniqueId(NodeId index) = 0;
+ virtual NodeId UniqueId(NodeId index) = 0;
- virtual SymbolId Name(NodeId index) = 0;
+ virtual SymbolId Name(NodeId index) = 0;
- virtual NodeId Child(NodeId index) = 0;
+ virtual NodeId Child(NodeId index) = 0;
- virtual NodeId Sibling(NodeId index) = 0;
+ virtual NodeId Sibling(NodeId index) = 0;
- virtual NodeId& Definition(NodeId index) = 0;
+ virtual NodeId& Definition(NodeId index) = 0;
- virtual NodeId Parent(NodeId index) = 0;
+ virtual NodeId Parent(NodeId index) = 0;
- virtual unsigned short& Type(NodeId index) = 0;
+ virtual unsigned short& Type(NodeId index) = 0;
- virtual unsigned int Line(NodeId index) = 0;
+ virtual unsigned int Line(NodeId index) = 0;
- virtual std::string Symbol(SymbolId id) = 0;
-
- virtual NodeId sl_get(NodeId parent, VObjectType type) = 0; // Get first item of type
-
- virtual NodeId sl_parent(NodeId parent, VObjectType type) = 0; // Get first parent item of type
-
- virtual NodeId sl_parent(NodeId parent, std::vector<VObjectType> types, VObjectType& actualType) = 0;
+ virtual std::string Symbol(SymbolId id) = 0;
- virtual std::vector<NodeId> sl_get_all(NodeId parent, VObjectType type) = 0; // get all items of type
+ virtual NodeId sl_get(NodeId parent,
+ VObjectType type) = 0; // Get first item of type
- virtual NodeId sl_collect(NodeId parent, VObjectType type) = 0; // Recursively search for first item of type
+ virtual NodeId sl_parent(
+ NodeId parent, VObjectType type) = 0; // Get first parent item of type
- virtual std::vector<NodeId> sl_collect_all(NodeId parent, VObjectType type) = 0; // Recursively search for all items of type
-
- virtual std::string SymName(NodeId index) = 0 ;
-
-
- private:
+ virtual NodeId sl_parent(NodeId parent, std::vector<VObjectType> types,
+ VObjectType& actualType) = 0;
- };
+ virtual std::vector<NodeId> sl_get_all(
+ NodeId parent, VObjectType type) = 0; // get all items of type
+ virtual NodeId sl_collect(
+ NodeId parent,
+ VObjectType type) = 0; // Recursively search for first item of type
+
+ virtual std::vector<NodeId> sl_collect_all(
+ NodeId parent,
+ VObjectType type) = 0; // Recursively search for all items of type
+
+ virtual std::string SymName(NodeId index) = 0;
+
+ private:
};
+}; // namespace SURELOG
+
#endif /* COMPILESTEP_H */
-
-
diff --git a/SVIncCompil/DesignCompile/CompileToolbox.h b/SVIncCompil/DesignCompile/CompileToolbox.h
index 1825daf..57879c4 100644
--- a/SVIncCompil/DesignCompile/CompileToolbox.h
+++ b/SVIncCompil/DesignCompile/CompileToolbox.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: CompileToolbox.h
* Author: alain
*
@@ -27,20 +27,18 @@
namespace SURELOG {
class CompileToolbox {
-public:
- CompileToolbox();
-
- virtual ~CompileToolbox();
-protected:
- virtual bool compileInitialBlock_(FileContent* fC, NodeId nodeId, DesignComponent* component);
+ public:
+ CompileToolbox();
-private:
+ virtual ~CompileToolbox();
+ protected:
+ virtual bool compileInitialBlock_(FileContent* fC, NodeId nodeId,
+ DesignComponent* component);
+
+ private:
};
-};
-
+}; // namespace SURELOG
#endif /* COMPILETOOLBOX_H */
-
-
diff --git a/SVIncCompil/DesignCompile/DesignElaboration.h b/SVIncCompil/DesignCompile/DesignElaboration.h
index a4d303b..fe26346 100644
--- a/SVIncCompil/DesignCompile/DesignElaboration.h
+++ b/SVIncCompil/DesignCompile/DesignElaboration.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: DesignElaboration.h
* Author: alain
*
@@ -30,49 +30,57 @@
namespace SURELOG {
class DesignElaboration : public ElaborationStep {
-public:
- DesignElaboration(CompileDesign* compileDesign);
- DesignElaboration(const DesignElaboration& orig) = delete;
- virtual ~DesignElaboration();
-
- bool createModuleAndPackageDefinitions();
+ public:
+ DesignElaboration(CompileDesign* compileDesign);
+ DesignElaboration(const DesignElaboration& orig) = delete;
+ virtual ~DesignElaboration();
- bool elaborate();
-
-private:
- bool createBuiltinPrimitives_();
- bool setupConfigurations_();
- bool identifyTopModules_();
- bool elaborateAllModules_(bool onlyTopLevel);
- void reportElaboration_();
- bool elaborateModule_(std::string moduleName, FileContent* fileContent, bool onlyTopLevel);
- void checkElaboration_();
- void collectParams_(std::vector<std::string>& params, FileContent* fC, NodeId nodeId, ModuleInstance* instance, NodeId parentParamOverride);
- void elaborateInstance_ (FileContent* fC, NodeId nodeId, NodeId parentParamOverride, ModuleInstanceFactory* factory, ModuleInstance* parent, Config* config);
- void recurseInstanceLoop_ (std::vector<int>& from, std::vector<int>& to, std::vector<int>& indexes, unsigned int pos,
- DesignComponent* def, FileContent* fC, NodeId subInstanceId, NodeId paramOverride,
- ModuleInstanceFactory* factory, ModuleInstance* parent, Config* config, std::string instanceName, std::string modName,
- std::vector<ModuleInstance*>& allSubInstances);
- void recurseBuildInstanceClause_(std::string parentPath, Config* config, std::set<Config*>& stack);
- void reduceUnnamedBlocks_();
- void checkConfigurations_();
- Config* getInstConfig(std::string name);
- Config* getCellConfig(std::string name);
- std::vector<std::pair<std::string, FileContent*>> m_topLevelModules;
- std::set<std::string> m_uniqueTopLevelModules;
- ExprBuilder m_exprBuilder;
- ModuleDefinitionFactory* m_moduleDefFactory;
- ModuleInstanceFactory* m_moduleInstFactory;
- std::set<std::string> m_toplevelConfigModules;
- std::map<std::string, Config> m_instConfig;
- std::map<std::string, Config> m_cellConfig;
- std::map<std::string, UseClause> m_instUseClause;
- std::map<std::string, UseClause> m_cellUseClause;
+ bool createModuleAndPackageDefinitions();
+
+ bool elaborate();
+
+ private:
+ bool createBuiltinPrimitives_();
+ bool setupConfigurations_();
+ bool identifyTopModules_();
+ bool elaborateAllModules_(bool onlyTopLevel);
+ void reportElaboration_();
+ bool elaborateModule_(std::string moduleName, FileContent* fileContent,
+ bool onlyTopLevel);
+ void checkElaboration_();
+ void collectParams_(std::vector<std::string>& params, FileContent* fC,
+ NodeId nodeId, ModuleInstance* instance,
+ NodeId parentParamOverride);
+ void elaborateInstance_(FileContent* fC, NodeId nodeId,
+ NodeId parentParamOverride,
+ ModuleInstanceFactory* factory,
+ ModuleInstance* parent, Config* config);
+ void recurseInstanceLoop_(std::vector<int>& from, std::vector<int>& to,
+ std::vector<int>& indexes, unsigned int pos,
+ DesignComponent* def, FileContent* fC,
+ NodeId subInstanceId, NodeId paramOverride,
+ ModuleInstanceFactory* factory,
+ ModuleInstance* parent, Config* config,
+ std::string instanceName, std::string modName,
+ std::vector<ModuleInstance*>& allSubInstances);
+ void recurseBuildInstanceClause_(std::string parentPath, Config* config,
+ std::set<Config*>& stack);
+ void reduceUnnamedBlocks_();
+ void checkConfigurations_();
+ Config* getInstConfig(std::string name);
+ Config* getCellConfig(std::string name);
+ std::vector<std::pair<std::string, FileContent*>> m_topLevelModules;
+ std::set<std::string> m_uniqueTopLevelModules;
+ ExprBuilder m_exprBuilder;
+ ModuleDefinitionFactory* m_moduleDefFactory;
+ ModuleInstanceFactory* m_moduleInstFactory;
+ std::set<std::string> m_toplevelConfigModules;
+ std::map<std::string, Config> m_instConfig;
+ std::map<std::string, Config> m_cellConfig;
+ std::map<std::string, UseClause> m_instUseClause;
+ std::map<std::string, UseClause> m_cellUseClause;
};
-};
-
+}; // namespace SURELOG
#endif /* DESIGNELABORATION_H */
-
-
diff --git a/SVIncCompil/DesignCompile/ElaborationStep.h b/SVIncCompil/DesignCompile/ElaborationStep.h
index a479afa..33bcd57 100644
--- a/SVIncCompil/DesignCompile/ElaborationStep.h
+++ b/SVIncCompil/DesignCompile/ElaborationStep.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: ElaborationStep.h
* Author: alain
*
@@ -29,37 +29,43 @@
namespace SURELOG {
class ElaborationStep {
-public:
- ElaborationStep(CompileDesign* compileDesign) : m_compileDesign(compileDesign) {}
- ElaborationStep(const ElaborationStep& orig) = delete;
-
- virtual bool elaborate() = 0;
-
- virtual ~ElaborationStep();
-
-
-protected:
-
- DataType* bindTypeDef_(TypeDef* typd, DesignComponent* parent, ErrorDefinition::ErrorType errtype);
-
- DataType* bindDataType_(std::string type_name, FileContent* fC, NodeId id, DesignComponent* parent, ErrorDefinition::ErrorType errtype);
+ public:
+ ElaborationStep(CompileDesign* compileDesign)
+ : m_compileDesign(compileDesign) {}
+ ElaborationStep(const ElaborationStep& orig) = delete;
- Variable* bindVariable_(std::string var_name, Scope* scope, FileContent* fc, NodeId id,
- DesignComponent* parent, ErrorDefinition::ErrorType errtype, bool returnClassParam);
+ virtual bool elaborate() = 0;
- Variable* locateVariable_ (std::vector<std::string>& var_chain, FileContent* fC, NodeId id, Scope* scope, DesignComponent* parentComponent, ErrorDefinition::ErrorType errtype);
-
- Variable* locateStaticVariable_ (std::vector<std::string>& var_chain, FileContent* fC, NodeId id, Scope* scope, DesignComponent* parentComponent, ErrorDefinition::ErrorType errtype);
-
- CompileDesign* m_compileDesign;
+ virtual ~ElaborationStep();
- std::map<std::string, Variable*> m_staticVariables;
-
+ protected:
+ DataType* bindTypeDef_(TypeDef* typd, DesignComponent* parent,
+ ErrorDefinition::ErrorType errtype);
+
+ DataType* bindDataType_(std::string type_name, FileContent* fC, NodeId id,
+ DesignComponent* parent,
+ ErrorDefinition::ErrorType errtype);
+
+ Variable* bindVariable_(std::string var_name, Scope* scope, FileContent* fc,
+ NodeId id, DesignComponent* parent,
+ ErrorDefinition::ErrorType errtype,
+ bool returnClassParam);
+
+ Variable* locateVariable_(std::vector<std::string>& var_chain,
+ FileContent* fC, NodeId id, Scope* scope,
+ DesignComponent* parentComponent,
+ ErrorDefinition::ErrorType errtype);
+
+ Variable* locateStaticVariable_(std::vector<std::string>& var_chain,
+ FileContent* fC, NodeId id, Scope* scope,
+ DesignComponent* parentComponent,
+ ErrorDefinition::ErrorType errtype);
+
+ CompileDesign* m_compileDesign;
+
+ std::map<std::string, Variable*> m_staticVariables;
};
-};
-
+}; // namespace SURELOG
#endif /* ELABORATIONSTEP_H */
-
-
diff --git a/SVIncCompil/DesignCompile/PackageAndRootElaboration.h b/SVIncCompil/DesignCompile/PackageAndRootElaboration.h
index 96466fa..9bcefa1 100644
--- a/SVIncCompil/DesignCompile/PackageAndRootElaboration.h
+++ b/SVIncCompil/DesignCompile/PackageAndRootElaboration.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: PackageAndRootElaboration.h
* Author: alain
*
@@ -28,20 +28,19 @@
namespace SURELOG {
-class PackageAndRootElaboration : public ElaborationStep {
-public:
- PackageAndRootElaboration(CompileDesign* compileDesign) : ElaborationStep(compileDesign) {}
-
- virtual ~PackageAndRootElaboration();
-
- bool elaborate();
-
-private:
- bool bindTypedefs_();
+class PackageAndRootElaboration : public ElaborationStep {
+ public:
+ PackageAndRootElaboration(CompileDesign* compileDesign)
+ : ElaborationStep(compileDesign) {}
+
+ virtual ~PackageAndRootElaboration();
+
+ bool elaborate();
+
+ private:
+ bool bindTypedefs_();
};
-};
+}; // namespace SURELOG
#endif /* PACKAGEANDROOTELABORATION_H */
-
-
diff --git a/SVIncCompil/DesignCompile/ResolveSymbols.h b/SVIncCompil/DesignCompile/ResolveSymbols.h
index 3283aa3..60607d4 100644
--- a/SVIncCompil/DesignCompile/ResolveSymbols.h
+++ b/SVIncCompil/DesignCompile/ResolveSymbols.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: ResolveSymbols.h
* Author: alain
*
@@ -29,96 +29,109 @@
namespace SURELOG {
- struct FunctorCreateLookup {
+struct FunctorCreateLookup {
+ FunctorCreateLookup(CompileDesign* compileDesign, FileContent* fileContent,
+ Design* design, SymbolTable* symbolTable,
+ ErrorContainer* errors)
+ : m_compileDesign(compileDesign),
+ m_fileData(fileContent),
+ m_symbolTable(symbolTable),
+ m_errorContainer(errors) {}
+ int operator()() const;
- FunctorCreateLookup(CompileDesign* compileDesign, FileContent* fileContent, Design* design, SymbolTable* symbolTable, ErrorContainer* errors) :
- m_compileDesign(compileDesign), m_fileData(fileContent), m_symbolTable(symbolTable), m_errorContainer(errors) {
- }
- int operator()() const;
-
- private:
- CompileDesign* m_compileDesign;
- FileContent* m_fileData;
- SymbolTable* m_symbolTable;
- ErrorContainer* m_errorContainer;
- };
-
- struct FunctorResolve {
-
- FunctorResolve(CompileDesign* compileDesign, FileContent* fileContent, Design* design, SymbolTable* symbolTable, ErrorContainer* errors) :
- m_compileDesign(compileDesign), m_fileData(fileContent), m_symbolTable(symbolTable), m_errorContainer(errors) {
- }
- int operator()() const;
-
- private:
- CompileDesign* m_compileDesign;
- FileContent* m_fileData;
- SymbolTable* m_symbolTable;
- ErrorContainer* m_errorContainer;
- };
-
- class ResolveSymbols : public CompileStep {
- public:
-
- ResolveSymbols(CompileDesign* compileDesign, FileContent* fileContent, SymbolTable* symbolTable, ErrorContainer* errors) :
- m_compileDesign(compileDesign), m_fileData(fileContent), m_symbolTable(symbolTable), m_errorContainer(errors) {
- }
-
- void createFastLookup();
-
- bool resolve();
-
- VObject& Object(NodeId index);
-
- NodeId UniqueId(NodeId index);
-
- SymbolId Name(NodeId index);
-
- NodeId Child(NodeId index);
-
- NodeId Sibling(NodeId index);
-
- NodeId& Definition(NodeId index);
-
- NodeId Parent(NodeId index);
-
- unsigned short& Type(NodeId index);
-
- unsigned int Line(NodeId index);
-
- std::string Symbol(SymbolId id);
-
- std::string SymName(NodeId index);
-
- NodeId sl_get(NodeId parent, VObjectType type); // Get first item of type
-
- NodeId sl_parent(NodeId parent, VObjectType type); // Get first parent item of type
-
- NodeId sl_parent(NodeId parent, std::vector<VObjectType> types, VObjectType& actualType);
-
- std::vector<NodeId> sl_get_all(NodeId parent, VObjectType type); // get all items of type
-
- NodeId sl_collect(NodeId parent, VObjectType type); // Recursively search for first item of type
-
- std::vector<NodeId> sl_collect_all(NodeId parent, VObjectType type); // Recursively search for all items of type
-
-
- ResolveSymbols(const ResolveSymbols& orig);
- virtual ~ResolveSymbols();
-
- Compiler* getCompiler() { return m_compileDesign->getCompiler(); }
-
- private:
- bool bindDefinition_(unsigned int objIndex, std::vector<VObjectType> bindTypes);
-
- CompileDesign* m_compileDesign;
- FileContent* m_fileData;
- SymbolTable* m_symbolTable;
- ErrorContainer* m_errorContainer;
- };
-
+ private:
+ CompileDesign* m_compileDesign;
+ FileContent* m_fileData;
+ SymbolTable* m_symbolTable;
+ ErrorContainer* m_errorContainer;
};
+struct FunctorResolve {
+ FunctorResolve(CompileDesign* compileDesign, FileContent* fileContent,
+ Design* design, SymbolTable* symbolTable,
+ ErrorContainer* errors)
+ : m_compileDesign(compileDesign),
+ m_fileData(fileContent),
+ m_symbolTable(symbolTable),
+ m_errorContainer(errors) {}
+ int operator()() const;
+
+ private:
+ CompileDesign* m_compileDesign;
+ FileContent* m_fileData;
+ SymbolTable* m_symbolTable;
+ ErrorContainer* m_errorContainer;
+};
+
+class ResolveSymbols : public CompileStep {
+ public:
+ ResolveSymbols(CompileDesign* compileDesign, FileContent* fileContent,
+ SymbolTable* symbolTable, ErrorContainer* errors)
+ : m_compileDesign(compileDesign),
+ m_fileData(fileContent),
+ m_symbolTable(symbolTable),
+ m_errorContainer(errors) {}
+
+ void createFastLookup();
+
+ bool resolve();
+
+ VObject& Object(NodeId index);
+
+ NodeId UniqueId(NodeId index);
+
+ SymbolId Name(NodeId index);
+
+ NodeId Child(NodeId index);
+
+ NodeId Sibling(NodeId index);
+
+ NodeId& Definition(NodeId index);
+
+ NodeId Parent(NodeId index);
+
+ unsigned short& Type(NodeId index);
+
+ unsigned int Line(NodeId index);
+
+ std::string Symbol(SymbolId id);
+
+ std::string SymName(NodeId index);
+
+ NodeId sl_get(NodeId parent, VObjectType type); // Get first item of type
+
+ NodeId sl_parent(NodeId parent,
+ VObjectType type); // Get first parent item of type
+
+ NodeId sl_parent(NodeId parent, std::vector<VObjectType> types,
+ VObjectType& actualType);
+
+ std::vector<NodeId> sl_get_all(NodeId parent,
+ VObjectType type); // get all items of type
+
+ NodeId sl_collect(
+ NodeId parent,
+ VObjectType type); // Recursively search for first item of type
+
+ std::vector<NodeId> sl_collect_all(
+ NodeId parent,
+ VObjectType type); // Recursively search for all items of type
+
+ ResolveSymbols(const ResolveSymbols& orig);
+ virtual ~ResolveSymbols();
+
+ Compiler* getCompiler() { return m_compileDesign->getCompiler(); }
+
+ private:
+ bool bindDefinition_(unsigned int objIndex,
+ std::vector<VObjectType> bindTypes);
+
+ CompileDesign* m_compileDesign;
+ FileContent* m_fileData;
+ SymbolTable* m_symbolTable;
+ ErrorContainer* m_errorContainer;
+};
+
+}; // namespace SURELOG
+
#endif /* RESOLVESYMBOLS_H */
-
-
diff --git a/SVIncCompil/DesignCompile/TestbenchElaboration.h b/SVIncCompil/DesignCompile/TestbenchElaboration.h
index 56050d7..b510ff0 100644
--- a/SVIncCompil/DesignCompile/TestbenchElaboration.h
+++ b/SVIncCompil/DesignCompile/TestbenchElaboration.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: TestbenchElaboration.h
* Author: alain
*
@@ -24,40 +24,39 @@
#ifndef TESTBENCHELABORATION_H
#define TESTBENCHELABORATION_H
-
#include "ElaborationStep.h"
-namespace SURELOG {
- class Variable;
- class Procedure;
+namespace SURELOG {
+class Variable;
+class Procedure;
class TestbenchElaboration : public ElaborationStep {
-public:
- TestbenchElaboration(CompileDesign* compileDesign) : ElaborationStep(compileDesign) {}
-
- TestbenchElaboration(const TestbenchElaboration& orig);
+ public:
+ TestbenchElaboration(CompileDesign* compileDesign)
+ : ElaborationStep(compileDesign) {}
- virtual ~TestbenchElaboration();
+ TestbenchElaboration(const TestbenchElaboration& orig);
-protected:
+ virtual ~TestbenchElaboration();
- bool bindTypedefs_();
- bool checkForMultipleDefinition_();
- bool bindClasses_();
- bool bindBaseClasses_();
- bool bindDataTypes_();
- bool bindFunctions_();
- bool bindTasks_();
- bool bindFunctionReturnTypesAndParamaters_();
- bool bindFunctionBodies_();
- bool bindSubRoutineCall_(ClassDefinition* classDefinition, Statement* stmt, Design* design, SymbolTable* symbols, ErrorContainer* errors);
- bool bindForeachLoop_(ClassDefinition* classDefinition, Statement* stmt, ForeachLoopStmt* st);
- bool bindForLoop_(ClassDefinition* classDefinition, Statement* stmt, ForLoopStmt* st);
-
+ protected:
+ bool bindTypedefs_();
+ bool checkForMultipleDefinition_();
+ bool bindClasses_();
+ bool bindBaseClasses_();
+ bool bindDataTypes_();
+ bool bindFunctions_();
+ bool bindTasks_();
+ bool bindFunctionReturnTypesAndParamaters_();
+ bool bindFunctionBodies_();
+ bool bindSubRoutineCall_(ClassDefinition* classDefinition, Statement* stmt,
+ Design* design, SymbolTable* symbols,
+ ErrorContainer* errors);
+ bool bindForeachLoop_(ClassDefinition* classDefinition, Statement* stmt,
+ ForeachLoopStmt* st);
+ bool bindForLoop_(ClassDefinition* classDefinition, Statement* stmt,
+ ForLoopStmt* st);
};
-}
-
+} // namespace SURELOG
#endif /* TESTBENCHELABORATION_H */
-
-
diff --git a/SVIncCompil/DesignCompile/UVMElaboration.h b/SVIncCompil/DesignCompile/UVMElaboration.h
index 9bc97aa..bffa87f 100644
--- a/SVIncCompil/DesignCompile/UVMElaboration.h
+++ b/SVIncCompil/DesignCompile/UVMElaboration.h
@@ -1,12 +1,12 @@
/*
Copyright 2019 Alain Dargelas
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,7 +14,7 @@
limitations under the License.
*/
-/*
+/*
* File: UVMElaboration.h
* Author: alain
*
@@ -29,19 +29,16 @@
namespace SURELOG {
class UVMElaboration : public TestbenchElaboration {
-public:
- UVMElaboration(CompileDesign* compileDesign);
- UVMElaboration(const UVMElaboration& orig) = delete;
- virtual ~UVMElaboration();
-
- bool elaborate();
-
-private:
-
+ public:
+ UVMElaboration(CompileDesign* compileDesign);
+ UVMElaboration(const UVMElaboration& orig) = delete;
+ virtual ~UVMElaboration();
+
+ bool elaborate();
+
+ private:
};
-};
+}; // namespace SURELOG
#endif /* UVMELABORATION_H */
-
-
diff --git a/SVIncCompil/Testcases/Monitor/Monitor_diff.log b/SVIncCompil/Testcases/Monitor/Monitor_diff.log
index 3ef3951..e35e82c 100644
--- a/SVIncCompil/Testcases/Monitor/Monitor_diff.log
+++ b/SVIncCompil/Testcases/Monitor/Monitor_diff.log
@@ -827,5 +827,5 @@
* End SURELOG SVerilog Compiler/Linter *
********************************************
-11.58user 0.18system 0:11.77elapsed 99%CPU (0avgtext+0avgdata 268736maxresident)k
-0inputs+15192outputs (0major+69421minor)pagefaults 0swaps
+11.67user 0.14system 0:11.81elapsed 99%CPU (0avgtext+0avgdata 268572maxresident)k
+0inputs+15192outputs (0major+69429minor)pagefaults 0swaps
diff --git a/SVIncCompil/Testcases/SimpleUVM/SimpleUVM_diff.log b/SVIncCompil/Testcases/SimpleUVM/SimpleUVM_diff.log
index 565b866..7a7a411 100644
--- a/SVIncCompil/Testcases/SimpleUVM/SimpleUVM_diff.log
+++ b/SVIncCompil/Testcases/SimpleUVM/SimpleUVM_diff.log
@@ -763,5 +763,5 @@
* End SURELOG SVerilog Compiler/Linter *
********************************************
-2.27user 0.07system 0:02.35elapsed 99%CPU (0avgtext+0avgdata 116552maxresident)k
-0inputs+7688outputs (0major+31471minor)pagefaults 0swaps
+2.22user 0.05system 0:02.28elapsed 99%CPU (0avgtext+0avgdata 116604maxresident)k
+0inputs+7688outputs (0major+31473minor)pagefaults 0swaps
diff --git a/SVIncCompil/Testcases/UnitDefParam/UnitDefParam_diff.log b/SVIncCompil/Testcases/UnitDefParam/UnitDefParam_diff.log
index 201098b..4922268 100644
--- a/SVIncCompil/Testcases/UnitDefParam/UnitDefParam_diff.log
+++ b/SVIncCompil/Testcases/UnitDefParam/UnitDefParam_diff.log
@@ -990,5 +990,5 @@
* End SURELOG SVerilog Compiler/Linter *
********************************************
-0.73user 0.02system 0:00.76elapsed 100%CPU (0avgtext+0avgdata 45596maxresident)k
-0inputs+144outputs (0major+13733minor)pagefaults 0swaps
+0.75user 0.03system 0:00.78elapsed 100%CPU (0avgtext+0avgdata 45660maxresident)k
+0inputs+144outputs (0major+13712minor)pagefaults 0swaps
diff --git a/SVIncCompil/Testcases/UnitForLoop/UnitForLoop.log b/SVIncCompil/Testcases/UnitForLoop/UnitForLoop.log
index 747fe1e..761de31 100644
--- a/SVIncCompil/Testcases/UnitForLoop/UnitForLoop.log
+++ b/SVIncCompil/Testcases/UnitForLoop/UnitForLoop.log
@@ -328,5 +328,5 @@
* End SURELOG SVerilog Compiler/Linter *
********************************************
-0.35user 0.03system 0:00.38elapsed 99%CPU (0avgtext+0avgdata 45852maxresident)k
-0inputs+16outputs (0major+13198minor)pagefaults 0swaps
+0.34user 0.03system 0:00.38elapsed 100%CPU (0avgtext+0avgdata 45492maxresident)k
+0inputs+16outputs (0major+13203minor)pagefaults 0swaps
diff --git a/SVIncCompil/Testcases/YosysSmall/YosysSmall_diff.log b/SVIncCompil/Testcases/YosysSmall/YosysSmall_diff.log
index d283328..96a887b 100644
--- a/SVIncCompil/Testcases/YosysSmall/YosysSmall_diff.log
+++ b/SVIncCompil/Testcases/YosysSmall/YosysSmall_diff.log
@@ -71,5 +71,5 @@
* End SURELOG SVerilog Compiler/Linter *
********************************************
-1.54user 0.01system 0:01.55elapsed 99%CPU (0avgtext+0avgdata 48404maxresident)k
-0inputs+608outputs (0major+9735minor)pagefaults 0swaps
+1.52user 0.03system 0:01.55elapsed 100%CPU (0avgtext+0avgdata 48368maxresident)k
+0inputs+608outputs (0major+9730minor)pagefaults 0swaps