| 2822 | } |
| 2823 | |
| 2824 | void CompileHelper::compileGateInstantiation(ModuleDefinition* mod, |
| 2825 | const FileContent* fC, |
| 2826 | CompileDesign* compileDesign, |
| 2827 | NodeId id, |
| 2828 | ValuedComponentI* instance) { |
| 2829 | UHDM::Serializer& s = compileDesign->getSerializer(); |
| 2830 | UHDM::primitive* gate = nullptr; |
| 2831 | UHDM::primitive_array* gate_array = nullptr; |
| 2832 | NodeId gatenode = fC->Child(fC->Parent(id)); |
| 2833 | VObjectType gatetype = fC->Type(gatenode); |
| 2834 | int32_t vpiGateType = getBuiltinType(gatetype); |
| 2835 | NodeId Name_of_instance = fC->Child(id); |
| 2836 | NodeId Name = fC->Child(Name_of_instance); |
| 2837 | NodeId Unpacked_dimension = fC->Sibling(Name); |
| 2838 | if (vpiGateType == vpiPmosPrim || vpiGateType == vpiRpmosPrim || |
| 2839 | vpiGateType == vpiNmosPrim || vpiGateType == vpiRnmosPrim || |
| 2840 | vpiGateType == vpiCmosPrim || vpiGateType == vpiRcmosPrim || |
| 2841 | vpiGateType == vpiTranif1Prim || vpiGateType == vpiTranif0Prim || |
| 2842 | vpiGateType == vpiRtranif1Prim || vpiGateType == vpiRtranif0Prim || |
| 2843 | vpiGateType == vpiTranPrim || vpiGateType == vpiRtranPrim) { |
| 2844 | gate = s.MakeSwitch_tran(); |
| 2845 | if (fC->Type(Unpacked_dimension) == VObjectType::paUnpacked_dimension) { |
| 2846 | gate_array = s.MakeSwitch_array(); |
| 2847 | VectorOfprimitive* prims = s.MakePrimitiveVec(); |
| 2848 | int32_t size; |
| 2849 | VectorOfrange* ranges = |
| 2850 | compileRanges(mod, fC, Unpacked_dimension, compileDesign, Reduce::No, |
| 2851 | nullptr, instance, size, false); |
| 2852 | gate_array->Primitives(prims); |
| 2853 | gate_array->Ranges(ranges); |
| 2854 | prims->push_back(gate); |
| 2855 | if (mod->getPrimitiveArrays() == nullptr) { |
| 2856 | mod->setPrimitiveArrays(s.MakePrimitive_arrayVec()); |
| 2857 | } |
| 2858 | mod->getPrimitiveArrays()->push_back(gate_array); |
| 2859 | } else { |
| 2860 | if (mod->getPrimitives() == nullptr) { |
| 2861 | mod->setPrimitives(s.MakePrimitiveVec()); |
| 2862 | } |
| 2863 | mod->getPrimitives()->push_back(gate); |
| 2864 | } |
| 2865 | gate->VpiPrimType(vpiGateType); |
| 2866 | } else { |
| 2867 | gate = s.MakeGate(); |
| 2868 | if (fC->Type(Unpacked_dimension) == VObjectType::paUnpacked_dimension) { |
| 2869 | gate_array = s.MakeGate_array(); |
| 2870 | gate_array->VpiName(fC->SymName(Name)); |
| 2871 | fC->populateCoreMembers(id, id, gate_array); |
| 2872 | VectorOfprimitive* prims = s.MakePrimitiveVec(); |
| 2873 | gate_array->Primitives(prims); |
| 2874 | int32_t size; |
| 2875 | if (VectorOfrange* ranges = |
| 2876 | compileRanges(mod, fC, Unpacked_dimension, compileDesign, |
| 2877 | Reduce::No, gate_array, instance, size, false)) { |
| 2878 | gate_array->Ranges(ranges); |
| 2879 | } |
| 2880 | gate->VpiParent(gate_array); |
| 2881 | prims->push_back(gate); |
no test coverage detected