| 2117 | } |
| 2118 | |
| 2119 | UHDM::typespec* CompileHelper::elabTypespec(DesignComponent* component, |
| 2120 | UHDM::typespec* spec, |
| 2121 | CompileDesign* compileDesign, |
| 2122 | UHDM::any* pexpr, |
| 2123 | ValuedComponentI* instance) { |
| 2124 | FileSystem* const fileSystem = FileSystem::getInstance(); |
| 2125 | Serializer& s = compileDesign->getSerializer(); |
| 2126 | typespec* result = spec; |
| 2127 | UHDM_OBJECT_TYPE type = spec->UhdmType(); |
| 2128 | VectorOfrange* ranges = nullptr; |
| 2129 | switch (type) { |
| 2130 | case uhdmbit_typespec: { |
| 2131 | bit_typespec* tps = (bit_typespec*)spec; |
| 2132 | ranges = tps->Ranges(); |
| 2133 | if (ranges) { |
| 2134 | ElaboratorContext elaboratorContext(&s, false, true); |
| 2135 | bit_typespec* res = any_cast<bit_typespec*>( |
| 2136 | UHDM::clone_tree((any*)spec, &elaboratorContext)); |
| 2137 | ranges = res->Ranges(); |
| 2138 | result = res; |
| 2139 | } |
| 2140 | break; |
| 2141 | } |
| 2142 | case uhdmlogic_typespec: { |
| 2143 | logic_typespec* tps = (logic_typespec*)spec; |
| 2144 | ranges = tps->Ranges(); |
| 2145 | if (ranges) { |
| 2146 | ElaboratorContext elaboratorContext(&s, false, true); |
| 2147 | logic_typespec* res = any_cast<logic_typespec*>( |
| 2148 | UHDM::clone_tree((any*)spec, &elaboratorContext)); |
| 2149 | ranges = res->Ranges(); |
| 2150 | result = res; |
| 2151 | } |
| 2152 | break; |
| 2153 | } |
| 2154 | case uhdmarray_typespec: { |
| 2155 | array_typespec* tps = (array_typespec*)spec; |
| 2156 | ranges = tps->Ranges(); |
| 2157 | if (ranges) { |
| 2158 | ElaboratorContext elaboratorContext(&s, false, true); |
| 2159 | array_typespec* res = any_cast<array_typespec*>( |
| 2160 | UHDM::clone_tree((any*)spec, &elaboratorContext)); |
| 2161 | ranges = res->Ranges(); |
| 2162 | result = res; |
| 2163 | } |
| 2164 | break; |
| 2165 | } |
| 2166 | case uhdmpacked_array_typespec: { |
| 2167 | packed_array_typespec* tps = (packed_array_typespec*)spec; |
| 2168 | ranges = tps->Ranges(); |
| 2169 | if (ranges) { |
| 2170 | ElaboratorContext elaboratorContext(&s, false, true); |
| 2171 | packed_array_typespec* res = any_cast<packed_array_typespec*>( |
| 2172 | UHDM::clone_tree((any*)spec, &elaboratorContext)); |
| 2173 | ranges = res->Ranges(); |
| 2174 | result = res; |
| 2175 | } |
| 2176 | break; |
no test coverage detected