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

Method collectUdpObjects_

src/DesignCompile/CompileModule.cpp:242–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242bool CompileModule::collectUdpObjects_() {
243 UHDM::Serializer& s = m_compileDesign->getSerializer();
244 const FileContent* const fC = m_module->m_fileContents[0];
245 NodeId id = m_module->m_nodeIds[0];
246 VObject current = fC->Object(id);
247 std::stack<NodeId> stack;
248 stack.push(id);
249 m_module->m_udpDefn = s.MakeUdp_defn();
250 UHDM::udp_defn* defn = m_module->m_udpDefn;
251 while (!stack.empty()) {
252 id = stack.top();
253 stack.pop();
254 current = fC->Object(id);
255 VObjectType type = fC->Type(id);
256 switch (type) {
257 case VObjectType::paUdp_declaration:
258 case VObjectType::paUdp_nonansi_declaration:
259 case VObjectType::paUdp_ansi_declaration: {
260 NodeId Attributes = fC->Child(id);
261 if (fC->Type(Attributes) == VObjectType::paAttribute_instance) {
262 if (UHDM::VectorOfattribute* attributes = m_helper.compileAttributes(
263 m_module, fC, Attributes, m_compileDesign, defn)) {
264 defn->Attributes(attributes);
265 }
266 }
267 break;
268 }
269 case VObjectType::paUdp_port_list: {
270 std::vector<UHDM::io_decl*>* ios = defn->Io_decls();
271 if (ios == nullptr) {
272 defn->Io_decls(s.MakeIo_declVec());
273 ios = defn->Io_decls();
274 }
275 NodeId port = fC->Child(id);
276 while (port) {
277 UHDM::io_decl* io = s.MakeIo_decl();
278 const std::string_view name = fC->SymName(port);
279 fC->populateCoreMembers(port, port, io);
280 io->VpiName(name);
281 io->VpiParent(defn);
282 ios->push_back(io);
283 port = fC->Sibling(port);
284 }
285 break;
286 }
287 case VObjectType::paUdp_output_declaration:
288 case VObjectType::paUdp_reg_declaration: {
289 NodeId Output = fC->Child(id);
290 UHDM::logic_net* net = s.MakeLogic_net();
291 if (fC->Type(Output) == VObjectType::paAttribute_instance) {
292 if (UHDM::VectorOfattribute* attributes = m_helper.compileAttributes(
293 m_module, fC, Output, m_compileDesign, net)) {
294 net->Attributes(attributes);
295 }
296 while (fC->Type(Output) == VObjectType::paAttribute_instance)
297 Output = fC->Sibling(Output);
298 }
299

Callers

nothing calls this directly

Calls 10

StrCatFunction · 0.85
ObjectMethod · 0.80
compileAttributesMethod · 0.80
populateCoreMembersMethod · 0.80
ExprMethod · 0.80
TypeMethod · 0.45
ChildMethod · 0.45
AttributesMethod · 0.45
SymNameMethod · 0.45
SiblingMethod · 0.45

Tested by

no test coverage detected