|
61 | 61 | ) |
62 | 62 | from core.log import print_green, print_red, print_yellow |
63 | 63 | from verilator_runner import ( |
64 | | - compile_with_dependency_resolution as verilator_compile, |
65 | | - auto_orchestrate as verilator_auto, |
66 | | -) |
67 | | -from verilator_runner_incremental import ( |
68 | 64 | compile_incremental as verilator_incremental, |
69 | 65 | ) |
70 | 66 | from ghdl_runner import ( |
71 | | - analyze_with_dependency_resolution as ghdl_analyze, |
72 | | - auto_orchestrate as ghdl_auto, |
73 | | -) |
74 | | -from ghdl_runner_incremental import ( |
75 | 67 | try_incremental_compilation as ghdl_incremental, |
76 | 68 | ) |
77 | 69 |
|
@@ -541,16 +533,12 @@ def rank_top_candidates(module_graph, module_graph_inverse, repo_name=None, modu |
541 | 533 | valid_modules = [] |
542 | 534 | verilog_keywords = {"if", "else", "always", "initial", "begin", "end", "case", "default", "for", "while", "assign"} |
543 | 535 |
|
544 | | - print_green(f"[DEBUG] All found modules: {sorted(nodes)}") |
545 | | - |
546 | 536 | for module in nodes: |
547 | 537 | if (module not in verilog_keywords and |
548 | 538 | len(module) > 1 and |
549 | 539 | (module.replace('_', '').isalnum())): |
550 | 540 | valid_modules.append(module) |
551 | 541 |
|
552 | | - print_green(f"[DEBUG] Valid modules after filtering: {sorted(valid_modules)}") |
553 | | - |
554 | 542 | # Find candidates: modules with few parents are preferred |
555 | 543 | zero_parent_modules = [m for m in valid_modules if not parents_of.get(m, [])] |
556 | 544 | low_parent_modules = [m for m in valid_modules if len(parents_of.get(m, [])) <= 2] |
@@ -612,19 +600,12 @@ def rank_top_candidates(module_graph, module_graph_inverse, repo_name=None, modu |
612 | 600 |
|
613 | 601 | if is_cpu_core and module not in repo_name_matches: |
614 | 602 | cpu_core_matches.append(module) |
615 | | - print_green(f"[DEBUG] Added likely CPU core: {module}") |
616 | 603 |
|
617 | 604 | candidates = list(set(zero_parent_modules + low_parent_modules + repo_name_matches + cpu_core_matches)) |
618 | 605 |
|
619 | 606 | if not candidates: |
620 | 607 | candidates = valid_modules |
621 | 608 |
|
622 | | - # Debug output |
623 | | - print_green(f"[DEBUG] valid_modules count: {len(valid_modules)}") |
624 | | - print_green(f"[DEBUG] zero_parent_modules count: {len(zero_parent_modules)}") |
625 | | - print_green(f"[DEBUG] low_parent_modules count: {len(low_parent_modules)}") |
626 | | - print_green(f"[DEBUG] final candidates count: {len(candidates)}") |
627 | | - |
628 | 609 | repo_lower = (repo_name or "").lower() |
629 | 610 | scored = [] |
630 | 611 |
|
@@ -858,11 +839,6 @@ def rank_top_candidates(module_graph, module_graph_inverse, repo_name=None, modu |
858 | 839 | # Sort by score (descending), then by reach (descending), then by name |
859 | 840 | scored.sort(reverse=True, key=lambda t: (t[0], t[1], t[2])) |
860 | 841 |
|
861 | | - # Debug: Print top 20 scored candidates |
862 | | - print_green("[DEBUG] Top 20 scored candidates:") |
863 | | - for i, (s, r, c) in enumerate(scored[:20]): |
864 | | - print_green(f" {i+1}. {c}: score={s}, reach={r}") |
865 | | - |
866 | 842 | ranked = [c for score, _, c in scored if score > -5000] |
867 | 843 | # If the top few are micro-stage or interface modules, try to skip them in favor of a core-like one |
868 | 844 | filtered_ranked = [c for c in ranked if not _is_micro_stage_name(c.lower()) and not _is_interface_module_name(c.lower())] |
|
0 commit comments