| 3688 | } |
| 3689 | |
| 3690 | std::vector<UHDM::range *> *CompileHelper::compileRanges( |
| 3691 | DesignComponent *component, const FileContent *fC, NodeId Packed_dimension, |
| 3692 | CompileDesign *compileDesign, Reduce reduce, UHDM::any *pexpr, |
| 3693 | ValuedComponentI *instance, int32_t &size, bool muteErrors) { |
| 3694 | FileSystem *const fileSystem = FileSystem::getInstance(); |
| 3695 | UHDM::Serializer &s = compileDesign->getSerializer(); |
| 3696 | VectorOfrange *ranges = nullptr; |
| 3697 | size = 0; |
| 3698 | if (Packed_dimension && |
| 3699 | ((fC->Type(Packed_dimension) == VObjectType::paPacked_dimension) || |
| 3700 | (fC->Type(Packed_dimension) == VObjectType::paUnpacked_dimension) || |
| 3701 | (fC->Type(Packed_dimension) == VObjectType::paVariable_dimension) || |
| 3702 | (fC->Type(Packed_dimension) == VObjectType::paConstant_range) || |
| 3703 | (fC->Type(Packed_dimension) == VObjectType::paUnsized_dimension))) { |
| 3704 | ranges = s.MakeRangeVec(); |
| 3705 | size = 1; |
| 3706 | while (Packed_dimension) { |
| 3707 | NodeId Constant_range = fC->Child(Packed_dimension); |
| 3708 | if (fC->Type(Packed_dimension) == VObjectType::paConstant_range) { |
| 3709 | Constant_range = Packed_dimension; |
| 3710 | } |
| 3711 | if (fC->Type(Constant_range) == VObjectType::paUnpacked_dimension || |
| 3712 | fC->Type(Constant_range) == VObjectType::paPacked_dimension) { |
| 3713 | Constant_range = fC->Child(Constant_range); |
| 3714 | } |
| 3715 | if (fC->Type(Constant_range) == VObjectType::paConstant_range) { |
| 3716 | // Specified by range |
| 3717 | NodeId lexpr = fC->Child(Constant_range); |
| 3718 | NodeId rexpr = fC->Sibling(lexpr); |
| 3719 | UHDM::range *range = s.MakeRange(); |
| 3720 | |
| 3721 | expr *lexp = any_cast<expr *>( |
| 3722 | compileExpression(component, fC, lexpr, compileDesign, reduce, |
| 3723 | pexpr, instance, muteErrors)); |
| 3724 | if (reduce == Reduce::Yes) { |
| 3725 | if (errorOnNegativeConstant(component, lexp, compileDesign, |
| 3726 | instance)) { |
| 3727 | bool replay = false; |
| 3728 | // GDB: p replay=true |
| 3729 | if (replay) { |
| 3730 | compileExpression(component, fC, lexpr, compileDesign, reduce, |
| 3731 | pexpr, instance, muteErrors); |
| 3732 | } |
| 3733 | } |
| 3734 | } |
| 3735 | |
| 3736 | if (lexp) { |
| 3737 | lexp->VpiParent(range); |
| 3738 | range->Left_expr(lexp); |
| 3739 | } |
| 3740 | expr *rexp = any_cast<expr *>( |
| 3741 | compileExpression(component, fC, rexpr, compileDesign, reduce, |
| 3742 | pexpr, instance, muteErrors)); |
| 3743 | if (reduce == Reduce::Yes) { |
| 3744 | if (errorOnNegativeConstant(component, rexp, compileDesign, |
| 3745 | instance)) { |
| 3746 | bool replay = false; |
| 3747 | // GDB: p replay=true |