[lib] new api for lowest level clock connections

This commit is contained in:
tangxifan 2023-02-27 15:16:23 -08:00
parent b3dec93eb9
commit 7d0c23c675
2 changed files with 7 additions and 0 deletions

View File

@ -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]);

View File

@ -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(