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

Method compileContinuousAssignment

src/DesignCompile/CompileHelper.cpp:2412–2536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2410}
2411
2412std::vector<cont_assign*> CompileHelper::compileContinuousAssignment(
2413 DesignComponent* component, const FileContent* fC,
2414 NodeId List_of_net_assignments, CompileDesign* compileDesign,
2415 ValuedComponentI* instance) {
2416 UHDM::Serializer& s = compileDesign->getSerializer();
2417 std::vector<cont_assign*> assigns;
2418 /*
2419n<o> u<6> t<StringConst> p<7> l<4>
2420n<> u<7> t<Ps_or_hierarchical_identifier> p<10> c<6> s<9> l<4>
2421n<> u<8> t<Constant_bit_select> p<9> l<4>
2422n<> u<9> t<Constant_select> p<10> c<8> l<4>
2423n<> u<10> t<Net_lvalue> p<15> c<7> s<14> l<4>
2424n<i> u<11> t<StringConst> p<12> l<4>
2425n<> u<12> t<Primary_literal> p<13> c<11> l<4>
2426n<> u<13> t<Primary> p<14> c<12> l<4>
2427n<> u<14> t<Expression> p<15> c<13> l<4>
2428n<> u<15> t<Net_assignment> p<16> c<10> l<4>
2429n<> u<16> t<List_of_net_assignments> p<17> c<15> l<4>
2430n<> u<17> t<Continuous_assign> p<18> c<16> l<4>
2431*/
2432 NodeId Strength0;
2433 NodeId Strength1;
2434 expr* delay_expr = nullptr;
2435 // NodeId List_of_net_assignments = fC->Child(id);
2436 if (fC->Type(List_of_net_assignments) == VObjectType::paDrive_strength) {
2437 NodeId Drive_strength = List_of_net_assignments;
2438 Strength0 = fC->Child(Drive_strength);
2439 Strength1 = fC->Sibling(Strength0);
2440 List_of_net_assignments = fC->Sibling(List_of_net_assignments);
2441 } else if (fC->Type(List_of_net_assignments) == VObjectType::paDelay3) {
2442 delay_expr =
2443 (expr*)compileExpression(component, fC, List_of_net_assignments,
2444 compileDesign, Reduce::No, nullptr, instance);
2445 List_of_net_assignments = fC->Sibling(List_of_net_assignments);
2446 }
2447 NodeId Net_assignment = fC->Child(List_of_net_assignments);
2448 while (Net_assignment) {
2449 NodeId Net_lvalue = fC->Child(Net_assignment);
2450 NodeId Expression = fC->Sibling(Net_lvalue);
2451 if (Expression &&
2452 (fC->Type(Expression) != VObjectType::paUnpacked_dimension)) {
2453 // LHS
2454 NodeId Ps_or_hierarchical_identifier = fC->Child(Net_lvalue);
2455 NodeId Hierarchical_identifier = Ps_or_hierarchical_identifier;
2456 if (fC->Type(fC->Child(Ps_or_hierarchical_identifier)) ==
2457 VObjectType::paHierarchical_identifier) {
2458 Hierarchical_identifier = fC->Child(fC->Child(Hierarchical_identifier));
2459 }
2460 UHDM::any* lhs_exp =
2461 compileExpression(component, fC, Hierarchical_identifier,
2462 compileDesign, Reduce::No, nullptr, instance);
2463 NodeId Constant_select = fC->Sibling(Ps_or_hierarchical_identifier);
2464 if ((fC->Type(Constant_select) == VObjectType::paConstant_select) &&
2465 (Ps_or_hierarchical_identifier != Hierarchical_identifier) &&
2466 (lhs_exp->UhdmType() == uhdmhier_path)) {
2467 if (UHDM::any* sel = compileSelectExpression(
2468 component, fC, fC->Child(Constant_select), "", compileDesign,
2469 Reduce::No, lhs_exp, instance, false)) {

Callers 3

collectObjects_Method · 0.80
collectModuleObjects_Method · 0.80

Calls 5

StrCatFunction · 0.85
populateCoreMembersMethod · 0.80
TypeMethod · 0.45
ChildMethod · 0.45
SiblingMethod · 0.45

Tested by

no test coverage detected