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

Method writeDataTypes

src/DesignCompile/UhdmWriter.cpp:775–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775void UhdmWriter::writeDataTypes(const DesignComponent::DataTypeMap& datatypeMap,
776 BaseClass* parent,
777 VectorOftypespec* dest_typespecs, Serializer& s,
778 bool setParent) {
779 std::set<uint64_t> ids;
780 for (const auto& entry : datatypeMap) {
781 const DataType* dtype = entry.second;
782 if (dtype->getCategory() == DataType::Category::REF) {
783 dtype = dtype->getDefinition();
784 }
785 if (dtype->getCategory() == DataType::Category::TYPEDEF) {
786 if (dtype->getTypespec() == nullptr) dtype = dtype->getDefinition();
787 }
788 typespec* tps = dtype->getTypespec();
789 tps = replace(tps, m_compileDesign->getSwapedObjects());
790 if (parent->UhdmType() == uhdmpackage) {
791 if (tps && (tps->VpiName().find("::") == std::string::npos)) {
792 const std::string newName =
793 StrCat(parent->VpiName(), "::", tps->VpiName());
794 tps->VpiName(newName);
795 }
796 }
797
798 if (tps) {
799 if (!tps->Instance()) {
800 if (parent->UhdmType() != uhdmclass_defn)
801 tps->Instance((instance*)parent);
802 }
803 if (setParent) tps->VpiParent(parent);
804 if (ids.find(tps->UhdmId()) == ids.end()) {
805 dest_typespecs->push_back(tps);
806 ids.insert(tps->UhdmId());
807 }
808 }
809 }
810}
811
812void UhdmWriter::writeNets(DesignComponent* mod,
813 std::vector<Signal*>& orig_nets, BaseClass* parent,

Callers

nothing calls this directly

Calls 7

StrCatFunction · 0.85
InstanceMethod · 0.80
insertMethod · 0.80
replaceFunction · 0.70
getCategoryMethod · 0.45
getDefinitionMethod · 0.45
getTypespecMethod · 0.45

Tested by

no test coverage detected