| 5411 | } |
| 5412 | |
| 5413 | void CompileHelper::compileLetDeclaration(DesignComponent* component, |
| 5414 | const FileContent* fC, |
| 5415 | NodeId Let_declaration, |
| 5416 | CompileDesign* compileDesign) { |
| 5417 | Serializer& s = compileDesign->getSerializer(); |
| 5418 | NodeId nameId = fC->Child(Let_declaration); |
| 5419 | const std::string_view name = fC->SymName(nameId); |
| 5420 | NodeId Let_port_list = fC->Sibling(nameId); |
| 5421 | NodeId Expression; |
| 5422 | if (fC->Type(Let_port_list) == VObjectType::paLet_port_list) { |
| 5423 | Expression = fC->Sibling(Let_port_list); |
| 5424 | } else { |
| 5425 | Expression = Let_port_list; |
| 5426 | } |
| 5427 | auto ios = |
| 5428 | compileTfPortList(component, nullptr, fC, Let_port_list, compileDesign); |
| 5429 | component->lateBinding(false); |
| 5430 | let_decl* decl = s.MakeLet_decl(); |
| 5431 | decl->VpiName(name); |
| 5432 | fC->populateCoreMembers(Let_declaration, Let_declaration, decl); |
| 5433 | expr* exp = (expr*)compileExpression(component, fC, Expression, compileDesign, |
| 5434 | Reduce::No, decl, nullptr, false); |
| 5435 | component->lateBinding(true); |
| 5436 | VectorOfexpr* exprs = s.MakeExprVec(); |
| 5437 | exprs->push_back(exp); |
| 5438 | decl->Expressions(exprs); |
| 5439 | VectorOfseq_formal_decl* args = s.MakeSeq_formal_declVec(); |
| 5440 | for (auto io : *ios) { |
| 5441 | seq_formal_decl* formal = s.MakeSeq_formal_decl(); |
| 5442 | formal->VpiName(io->VpiName()); |
| 5443 | formal->VpiParent(exp); |
| 5444 | args->push_back(formal); |
| 5445 | } |
| 5446 | LetStmt* stmt = new LetStmt(decl, args, exp); |
| 5447 | component->insertLetStmt(name, stmt); |
| 5448 | } |
| 5449 | |
| 5450 | bool CompileHelper::elaborationSystemTask(DesignComponent* component, |
| 5451 | const FileContent* fC, NodeId id, |
no test coverage detected