diff --git a/libs/libclkarchopenfpga/src/base/clock_network.cpp b/libs/libclkarchopenfpga/src/base/clock_network.cpp index 4c102acec..3dfbe64bc 100644 --- a/libs/libclkarchopenfpga/src/base/clock_network.cpp +++ b/libs/libclkarchopenfpga/src/base/clock_network.cpp @@ -508,6 +508,11 @@ bool ClockNetwork::valid_level_id(const ClockTreeId& tree_id, return valid_tree_id(tree_id) && (size_t(lvl_id) < tree_depth(tree_id)); } +bool ClockNetwork::is_last_level(const ClockTreeId& tree_id, + const ClockLevelId& lvl_id) const { + return valid_tree_id(tree_id) && (size_t(lvl_id) == tree_depth(tree_id) - 1); +} + bool ClockNetwork::valid_spine_id(const ClockSpineId& spine_id) const { return (size_t(spine_id) < spine_ids_.size()) && (spine_id == spine_ids_[spine_id]); diff --git a/libs/libclkarchopenfpga/src/base/clock_network.h b/libs/libclkarchopenfpga/src/base/clock_network.h index be55b67c4..7687273e9 100644 --- a/libs/libclkarchopenfpga/src/base/clock_network.h +++ b/libs/libclkarchopenfpga/src/base/clock_network.h @@ -157,6 +157,8 @@ class ClockNetwork { /* Show if the level id is a valid for a given tree */ bool valid_level_id(const ClockTreeId& tree_id, const ClockLevelId& lvl_id) const; + /* Identify if the level is the last level of the given tree */ + bool is_last_level(const ClockTreeId& tree_id, const ClockLevelId& lvl) const; /* Show if the tree id is a valid for data queries */ bool valid_spine_id(const ClockSpineId& spine_id) const; bool valid_spine_switch_point_id(