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

Method compileAlwaysBlock

src/DesignCompile/CompileHelper.cpp:3100–3144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3098}
3099
3100always* CompileHelper::compileAlwaysBlock(DesignComponent* component,
3101 const FileContent* fC, NodeId id,
3102 CompileDesign* compileDesign,
3103 ValuedComponentI* instance) {
3104 UHDM::Serializer& s = compileDesign->getSerializer();
3105 compileDesign->lockSerializer();
3106 always* always = s.MakeAlways();
3107 NodeId always_keyword = fC->Child(id);
3108 switch (fC->Type(always_keyword)) {
3109 case VObjectType::paALWAYS:
3110 always->VpiAlwaysType(vpiAlways);
3111 break;
3112 case VObjectType::paALWAYS_COMB:
3113 always->VpiAlwaysType(vpiAlwaysComb);
3114 break;
3115 case VObjectType::paALWAYS_FF:
3116 always->VpiAlwaysType(vpiAlwaysFF);
3117 break;
3118 case VObjectType::paALWAYS_LATCH:
3119 always->VpiAlwaysType(vpiAlwaysLatch);
3120 break;
3121 default:
3122 break;
3123 }
3124 NodeId Statement = fC->Sibling(always_keyword);
3125 NodeId Statement_item = fC->Child(Statement);
3126 VectorOfany* stmts = nullptr;
3127 if (fC->Type(Statement_item) == VObjectType::slStringConst) {
3128 stmts = compileStmt(component, fC, Statement_item, compileDesign,
3129 Reduce::No, always, instance);
3130 } else {
3131 NodeId the_stmt = fC->Child(Statement_item);
3132 stmts = compileStmt(component, fC, the_stmt, compileDesign, Reduce::No,
3133 always, instance);
3134 }
3135 if (stmts) {
3136 any* stmt = (*stmts)[0];
3137 always->Stmt(stmt);
3138 stmt->VpiParent(always);
3139 }
3140
3141 fC->populateCoreMembers(id, id, always);
3142 compileDesign->unlockSerializer();
3143 return always;
3144}
3145
3146bool CompileHelper::isMultidimensional(UHDM::typespec* ts,
3147 DesignComponent* component) {

Callers 2

collectModuleObjects_Method · 0.80

Calls 6

lockSerializerMethod · 0.80
populateCoreMembersMethod · 0.80
unlockSerializerMethod · 0.80
ChildMethod · 0.45
TypeMethod · 0.45
SiblingMethod · 0.45

Tested by

no test coverage detected