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

Function bindStructInPackage

src/DesignCompile/ElaborationStep.cpp:1233–1258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231}
1232
1233bool bindStructInPackage(Design* design, Signal* signal,
1234 std::string_view packageName,
1235 std::string_view structName) {
1236 Package* p = design->getPackage(packageName);
1237 if (p) {
1238 const DataType* dtype = p->getDataType(structName);
1239 if (dtype) {
1240 signal->setDataType(dtype);
1241 const DataType* actual = dtype->getActual();
1242 if (actual->getCategory() == DataType::Category::STRUCT) {
1243 Struct* st = (Struct*)actual;
1244 if (st->isNet()) {
1245 signal->setType(VObjectType::paNetType_Wire);
1246 }
1247 }
1248 return true;
1249 } else {
1250 const DataType* dtype = p->getClassDefinition(structName);
1251 if (dtype) {
1252 signal->setDataType(dtype);
1253 return true;
1254 }
1255 }
1256 }
1257 return false;
1258}
1259
1260bool ElaborationStep::bindPortType_(Signal* signal, const FileContent* fC,
1261 NodeId id, Scope* scope,

Callers 1

bindPortType_Method · 0.85

Calls 8

setTypeMethod · 0.80
getPackageMethod · 0.45
getDataTypeMethod · 0.45
setDataTypeMethod · 0.45
getActualMethod · 0.45
getCategoryMethod · 0.45
isNetMethod · 0.45
getClassDefinitionMethod · 0.45

Tested by

no test coverage detected