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

Method compileExpression

src/DesignCompile/CompileExpression.cpp:1353–3430  ·  view source on GitHub ↗

This is a a very large function and probably should be split into smaller chunks.

Source from the content-addressed store, hash-verified

1351// This is a a very large function and probably should be split into
1352// smaller chunks.
1353UHDM::any *CompileHelper::compileExpression(
1354 DesignComponent *component, const FileContent *fC, NodeId parent,
1355 CompileDesign *compileDesign, Reduce reduce, UHDM::any *pexpr,
1356 ValuedComponentI *instance, bool muteErrors) {
1357 if (m_checkForLoops) {
1358 m_stackLevel++;
1359 }
1360 FileSystem *const fileSystem = FileSystem::getInstance();
1361 UHDM::Serializer &s = compileDesign->getSerializer();
1362 UHDM::any *result = nullptr;
1363 VObjectType parentType = fC->Type(parent);
1364 UHDM::VectorOfattribute *attributes = nullptr;
1365 if (parentType == VObjectType::paAttribute_instance) {
1366 attributes =
1367 compileAttributes(component, fC, parent, compileDesign, nullptr);
1368 while (fC->Type(parent) == VObjectType::paAttribute_instance)
1369 parent = fC->Sibling(parent);
1370 }
1371 parentType = fC->Type(parent);
1372 NodeId child = fC->Child(parent);
1373 VObjectType childType = VObjectType::sl_INVALID_;
1374 if (child) {
1375 childType = fC->Type(child);
1376 }
1377 switch (parentType) {
1378 case VObjectType::paIntegerAtomType_Byte: {
1379 result = s.MakeByte_var();
1380 result->VpiParent(pexpr);
1381 break;
1382 }
1383 case VObjectType::paIntegerAtomType_Int: {
1384 result = s.MakeInt_var();
1385 result->VpiParent(pexpr);
1386 break;
1387 }
1388 case VObjectType::paIntegerAtomType_Integer: {
1389 result = s.MakeInteger_var();
1390 result->VpiParent(pexpr);
1391 break;
1392 }
1393 case VObjectType::paIntegerAtomType_LongInt: {
1394 result = s.MakeLong_int_var();
1395 result->VpiParent(pexpr);
1396 break;
1397 }
1398 case VObjectType::paIntegerAtomType_Shortint: {
1399 result = s.MakeShort_int_var();
1400 result->VpiParent(pexpr);
1401 break;
1402 }
1403 case VObjectType::paValue_range: {
1404 UHDM::operation *list_op = s.MakeOperation();
1405 fC->populateCoreMembers(parent, parent, list_op);
1406 list_op->VpiOpType(vpiListOp);
1407 list_op->VpiParent(pexpr);
1408 UHDM::VectorOfany *operands = s.MakeAnyVec();
1409 list_op->Operands(operands);
1410 NodeId lexpr = child;

Callers 12

TESTFunction · 0.80
elaborateInstance_Method · 0.80
collectParams_Method · 0.80
exprFromAssign_Method · 0.80
writePortsMethod · 0.80
writeInterfaceMethod · 0.80
writeElabInterfaceMethod · 0.80
TESTFunction · 0.80
elab_parameters_Method · 0.80
high_conn_Method · 0.80
elabSignalMethod · 0.80
elab_ports_nets_Method · 0.80

Calls 15

StrCatFunction · 0.85
compileConstFunction · 0.85
populateCoreMembersMethod · 0.80
needLateBindingMethod · 0.80
getDesignMethod · 0.80
getParam_assignsMethod · 0.80
param_assignsMethod · 0.80
uhdmValueMethod · 0.80
decompiledValueMethod · 0.80
vpiValTypeMethod · 0.80
FunctionMethod · 0.80

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64