diff --git a/src/faebryk/core/cpp/src/pathfinder/bfs.cpp b/src/faebryk/core/cpp/src/pathfinder/bfs.cpp index 46c3b488..80bdd55f 100644 --- a/src/faebryk/core/cpp/src/pathfinder/bfs.cpp +++ b/src/faebryk/core/cpp/src/pathfinder/bfs.cpp @@ -120,6 +120,8 @@ void bfs_visit(/*const*/ GI_ref_weak root, std::function visito if (!it->get()->hibernated) { open_path_queue.push_back(std::move(*it)); it = hibernated_paths.erase(it); + } else if (!it->get()->filtered) { + hibernated_paths.erase(it); } else { ++it; } diff --git a/src/faebryk/core/cpp/src/pathfinder/pathfinder.cpp b/src/faebryk/core/cpp/src/pathfinder/pathfinder.cpp index de4e013c..a00cebf8 100644 --- a/src/faebryk/core/cpp/src/pathfinder/pathfinder.cpp +++ b/src/faebryk/core/cpp/src/pathfinder/pathfinder.cpp @@ -17,7 +17,7 @@ GI_refs_weak get_split_children(GI_ref_weak split_point) { true, {{Node::Type::get_moduleinterface_type()}}, false); GI_refs_weak out; for (auto &c : children) { - out.push_back(c->get_self_gif().get()); + out.push_back(c->get_parent_gif().get()); } return out; } @@ -54,10 +54,11 @@ std::optional _extend_path_hierarchy_stack(Edge &edge) { void _extend_fold_stack(PathStackElement &elem, UnresolvedStack &unresolved_stack, PathStack &split_stack) { if (!unresolved_stack.empty() && unresolved_stack.back().match(elem)) { - auto split = unresolved_stack.back().split; - if (split) { - split_stack.push_back(elem); - } + // TODO why was this here? + // auto split = unresolved_stack.back().split; + // if (split) { + // split_stack.push_back(elem); + // } unresolved_stack.pop_back(); } else { bool multi_child = get_split_children(elem.parent_gif).size() > 1; @@ -325,6 +326,8 @@ bool PathFinder::_build_path_stack_and_handle_splits(BFSPath &p) { return true; } + assert(!elem->up); + // handle split data.not_complete = true; @@ -342,7 +345,10 @@ bool PathFinder::_build_path_stack_and_handle_splits(BFSPath &p) { assert(false); return false; } - p.hibernated = !split_state.waiting; + if (!split_state.waiting) { + p.hibernated = true; + split_state.wait_paths[elem->child_gif].push_back(p.shared_from_this()); + } return true; } diff --git a/src/faebryk/library/SignalElectrical.py b/src/faebryk/library/SignalElectrical.py index 07d242c7..b585877d 100644 --- a/src/faebryk/library/SignalElectrical.py +++ b/src/faebryk/library/SignalElectrical.py @@ -21,7 +21,7 @@ def __init__(self) -> None: lambda path: LinkDirectConditionalFilterResult.FILTER_PASS if all(self.test(dst.node) for dst in path) else LinkDirectConditionalFilterResult.FILTER_FAIL_UNRECOVERABLE, - needs_only_first_in_path=False, + needs_only_first_in_path=True, ) # ---------------------------------------- diff --git a/test/core/test_hierarchy_connect.py b/test/core/test_hierarchy_connect.py index 08152522..617206ff 100644 --- a/test/core/test_hierarchy_connect.py +++ b/test/core/test_hierarchy_connect.py @@ -313,7 +313,10 @@ def test_specialize_link(): # test special link class _Link(LinkDirectConditional): def __init__(self): - super().__init__(lambda path: LinkDirectConditionalFilterResult.FILTER_PASS) + super().__init__( + lambda path: LinkDirectConditionalFilterResult.FILTER_PASS, + needs_only_first_in_path=True, + ) mifs = times(3, ModuleInterface) mifs_special = times(3, Specialized)