MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / loopDetected

Method loopDetected

src/DesignCompile/CompileHelper.cpp:102–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102bool CompileHelper::loopDetected(PathId fileId, uint32_t lineNumber,
103 CompileDesign* compileDesign,
104 ValuedComponentI* instance) {
105#if defined(_WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
106 constexpr int32_t kMaxAllowedStackDepth = 100;
107#else
108 constexpr int32_t kMaxAllowedStackDepth = 1000;
109#endif
110 if (m_checkForLoops) {
111 if ((m_stackLevel > kMaxAllowedStackDepth) || (m_unwind)) {
112 std::string instName;
113 if (ModuleInstance* inst =
114 valuedcomponenti_cast<ModuleInstance*>(instance)) {
115 instName = inst->getFullPathName();
116 }
117 Location loc(fileId, lineNumber, 0, m_symbols->registerSymbol(instName));
118 Error err(ErrorDefinition::ELAB_EXPRESSION_LOOP, loc);
119 m_errors->addError(err);
120 m_unwind = true;
121 return true;
122 }
123 }
124 return false;
125}
126
127bool CompileHelper::importPackage(DesignComponent* scope, Design* design,
128 const FileContent* fC, NodeId id,

Callers

nothing calls this directly

Calls 3

getFullPathNameMethod · 0.80
registerSymbolMethod · 0.45
addErrorMethod · 0.45

Tested by

no test coverage detected