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

Method getTypespec

src/DesignCompile/CompileExpression.cpp:4135–4405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4133}
4134
4135const typespec *CompileHelper::getTypespec(DesignComponent *component,
4136 const FileContent *fC, NodeId id,
4137 CompileDesign *compileDesign,
4138 Reduce reduce,
4139 ValuedComponentI *instance) {
4140 if (loopDetected(fC->getFileId(), fC->Line(id), compileDesign, instance)) {
4141 return nullptr;
4142 }
4143 UHDM::Serializer &s = compileDesign->getSerializer();
4144 const DataType *dtype = nullptr;
4145 const typespec *result = nullptr;
4146 std::string basename;
4147 std::vector<std::string> suffixnames;
4148 switch (fC->Type(id)) {
4149 case VObjectType::paIntegerAtomType_Byte: {
4150 result = s.MakeByte_typespec();
4151 break;
4152 }
4153 case VObjectType::paIntegerAtomType_Int: {
4154 result = s.MakeInt_typespec();
4155 break;
4156 }
4157 case VObjectType::paIntegerAtomType_Integer: {
4158 result = s.MakeInteger_typespec();
4159 break;
4160 }
4161 case VObjectType::paIntegerAtomType_LongInt: {
4162 result = s.MakeLong_int_typespec();
4163 break;
4164 }
4165 case VObjectType::paIntegerAtomType_Shortint: {
4166 result = s.MakeShort_int_typespec();
4167 break;
4168 }
4169 case VObjectType::paIntegerAtomType_Time: {
4170 result = s.MakeTime_typespec();
4171 break;
4172 }
4173 case VObjectType::slStringConst: {
4174 basename = fC->SymName(id);
4175 NodeId suffix = fC->Sibling(id);
4176 while (suffix && (fC->Type(suffix) == VObjectType::slStringConst)) {
4177 suffixnames.emplace_back(fC->SymName(suffix));
4178 suffix = fC->Sibling(suffix);
4179 }
4180 break;
4181 }
4182 case VObjectType::paComplex_func_call: {
4183 UHDM::any *exp =
4184 compileExpression(component, fC, fC->Parent(id), compileDesign,
4185 reduce, nullptr, instance, false);
4186 if (exp) {
4187 if (exp->UhdmType() == uhdmhier_path) {
4188 bool invalidValue = false;
4189 result = (typespec *)decodeHierPath(
4190 (hier_path *)exp, invalidValue, component, compileDesign, reduce,
4191 instance, fC->getFileId(), fC->Line(id), nullptr, false, true);
4192 } else if (exp->UhdmType() == uhdmbit_select) {

Callers 15

LValueMethod · 0.45
collectParams_Method · 0.45
bindTypedefs_Method · 0.45
bindTypedefsPostElab_Method · 0.45
makeVar_Method · 0.45
compileVariableMethod · 0.45
bindTypespecFunction · 0.45
compileTypespecMethod · 0.45
writeDataTypesMethod · 0.45
lateBindingMethod · 0.45

Calls 15

getMemberTypespecFunction · 0.85
getDesignMethod · 0.80
getTypeSpecIdMethod · 0.80
getUnpackedDimensionMethod · 0.80
populateCoreMembersMethod · 0.80
getPackedDimensionMethod · 0.80
portsMethod · 0.80
param_assignsMethod · 0.80
getFileIdMethod · 0.45
LineMethod · 0.45
TypeMethod · 0.45
SymNameMethod · 0.45

Tested by

no test coverage detected