.. _program_listing_file_src_sta_HSCutNetFlow.h: Program Listing for File HSCutNetFlow.h ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/sta/HSCutNetFlow.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include "HSCutOnlyFlow.h" namespace HSFullTiming { class HSTimingLocalData; // Cut net 定义为同一个原始 net 在同一对 FPGA(part) 之间的所有普通割边。 // 该 flow 中每个 HSOuterEdge 表示一个 cut net,而不是一条普通割边。 class HSCutNetFlow : public HSPartitionFlow { public: struct CutNetInfo { int originalNetId = -1; int fromNode = -1; int toNode = -1; int fromPart = -1; int toPart = -1; std::vector cutEdgeIds; std::vector originalEdgeIds; }; struct cut_net { std::vector fpga_nodes; int net_id = -1; }; struct CutNetTimingPath { int clkId = -1; std::string clockName; float slack = 0.0f; int level = 0; std::vector cutNetIds; std::vector cutNetInfos; }; HSCutNetFlow() = default; ~HSCutNetFlow() override = default; // 基于已有的 cut-edge flow 合并生成 cut-net flow。 int buildFrom(const HSPartitionFlow &srcFlow, const HSCutOnlyFlow &cutEdgeFlow); // 便捷接口:内部先构建 HSCutOnlyFlow,再合并成 cut-net flow。 int buildFrom(const HSPartitionFlow &srcFlow, const HSTimingLocalData *localData); int buildFrom(const HSPartitionFlow &srcFlow, const std::vector &partInfo); const std::vector &getCutNetInfos() const { return m_cutNetInfos; } const std::vector &getCutEdge2CutNetIds() const { return m_cutEdge2CutNetIds; } void getCutNetTimingPaths(std::vector &paths) const; json getCutNetTimingPathsJson() const; int dumpCutNetTimingPaths(const std::string &filepath) const; vector getCutNetTimingPathsInfo() const; std::vector getCutNets() const; private: struct CutNetKey { int originalNetId = -1; int fromPart = -1; int toPart = -1; bool operator<(const CutNetKey &rhs) const { if (originalNetId != rhs.originalNetId) { return originalNetId < rhs.originalNetId; } if (fromPart != rhs.fromPart) { return fromPart < rhs.fromPart; } return toPart < rhs.toPart; } }; void clearCutNetData(); void cloneClocksFrom(const HSPartitionFlow &srcFlow); int buildCutNetEdgesFrom(const HSPartitionFlow &srcFlow, const HSCutOnlyFlow &cutEdgeFlow); void buildCutNetNets(); void buildCompressedCutNetAdjacency(const HSCutOnlyFlow &cutEdgeFlow); void buildCompressedClockAdjacency(const HSCutOnlyFlow &cutEdgeFlow); void rebuildNode2EdgeIds(); std::vector m_cutNetInfos; std::vector m_cutEdge2CutNetIds; }; } // namespace HSFullTiming