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

Method compileTypespec

src/DesignCompile/CompileType.cpp:1221–2117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1219}
1220
1221UHDM::typespec* CompileHelper::compileTypespec(
1222 DesignComponent* component, const FileContent* fC, NodeId type,
1223 CompileDesign* compileDesign, Reduce reduce, UHDM::any* pstmt,
1224 SURELOG::ValuedComponentI* instance, bool isVariable) {
1225 FileSystem* const fileSystem = FileSystem::getInstance();
1226 UHDM::Serializer& s = compileDesign->getSerializer();
1227 UHDM::typespec* result = nullptr;
1228 VObjectType the_type = fC->Type(type);
1229 if ((the_type == VObjectType::paData_type_or_implicit) ||
1230 (the_type == VObjectType::paData_type)) {
1231 if (fC->Child(type)) {
1232 type = fC->Child(type);
1233 if (fC->Type(type) == VObjectType::paVIRTUAL) type = fC->Sibling(type);
1234 } else {
1235 // Implicit type
1236 }
1237 the_type = fC->Type(type);
1238 }
1239 NodeId Packed_dimension;
1240 if (the_type == VObjectType::paPacked_dimension) {
1241 Packed_dimension = type;
1242 } else if (the_type == VObjectType::slStringConst) {
1243 // Class parameter or struct reference
1244 Packed_dimension = fC->Sibling(type);
1245 if (fC->Type(Packed_dimension) != VObjectType::paPacked_dimension)
1246 Packed_dimension = InvalidNodeId;
1247 } else {
1248 Packed_dimension = fC->Sibling(type);
1249 if (fC->Type(Packed_dimension) == VObjectType::paData_type_or_implicit) {
1250 Packed_dimension = fC->Child(Packed_dimension);
1251 }
1252 }
1253 bool isPacked = false;
1254 if (fC->Type(Packed_dimension) == VObjectType::paPacked_keyword) {
1255 Packed_dimension = fC->Sibling(Packed_dimension);
1256 isPacked = true;
1257 }
1258 if (fC->Type(Packed_dimension) == VObjectType::paStruct_union_member ||
1259 fC->Type(Packed_dimension) == VObjectType::slStringConst) {
1260 Packed_dimension = fC->Sibling(Packed_dimension);
1261 }
1262
1263 if (fC->Type(Packed_dimension) == VObjectType::paSigning_Signed ||
1264 fC->Type(Packed_dimension) == VObjectType::paSigning_Unsigned) {
1265 Packed_dimension = fC->Sibling(Packed_dimension);
1266 }
1267 if (fC->Type(Packed_dimension) == VObjectType::paPacked_dimension) {
1268 isPacked = true;
1269 }
1270 int32_t size;
1271 VectorOfrange* ranges =
1272 compileRanges(component, fC, Packed_dimension, compileDesign, reduce,
1273 pstmt, instance, size, false);
1274 switch (the_type) {
1275 case VObjectType::paConstant_mintypmax_expression:
1276 case VObjectType::paConstant_primary: {
1277 return compileTypespec(component, fC, fC->Child(type), compileDesign,
1278 reduce, pstmt, instance, false);

Callers 8

bindProperties_Method · 0.80
bindTypedefs_Method · 0.80
elabTypeParameter_Method · 0.80
makeVar_Method · 0.80
writePortsMethod · 0.80
writeNetsMethod · 0.80
elabSignalMethod · 0.80
elab_ports_nets_Method · 0.80

Calls 15

bindTypespecFunction · 0.85
StrCatFunction · 0.85
populateCoreMembersMethod · 0.80
ExprMethod · 0.80
evalExprMethod · 0.80
newLValueMethod · 0.80
getValueFactoryMethod · 0.80
uhdmValueMethod · 0.80
decompiledValueMethod · 0.80
getDesignMethod · 0.80
getUhdmDefinitionMethod · 0.80
getParam_assignsMethod · 0.80

Tested by 1

bindProperties_Method · 0.64