diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 84e1db1c78..99053bf76c 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -1305,33 +1305,34 @@ void CONNECTION_GRAPH::generateBusAliasMembers() { std::vector new_subgraphs; - SCH_CONNECTION dummy( this ); - - for( auto&& subgraph : m_driver_subgraphs ) + for( CONNECTION_SUBGRAPH* subgraph : m_driver_subgraphs ) { - auto vec = subgraph->GetAllBusLabels(); + SCH_ITEM_SET vec = subgraph->GetAllBusLabels(); - for( auto& item : vec ) + for( SCH_ITEM* item : vec ) { SCH_LABEL_BASE* label = static_cast( item ); + SCH_CONNECTION dummy( item, subgraph->m_sheet ); + dummy.SetGraph( this ); dummy.ConfigureFromLabel( label->GetText() ); wxLogTrace( ConnTrace, wxS( "new bus label (%s)" ), label->GetText() ); - for( auto& conn : dummy.Members() ) + for( const auto& conn : dummy.Members() ) { wxString name = conn->FullLocalName(); CONNECTION_SUBGRAPH* new_sg = new CONNECTION_SUBGRAPH( this ); - SCH_CONNECTION* new_conn = new SCH_CONNECTION( this ); + SCH_CONNECTION* new_conn = new SCH_CONNECTION( item, subgraph->m_sheet ); + new_conn->SetGraph( this ); new_conn->SetName( name ); new_conn->SetType( CONNECTION_TYPE::NET ); int code = assignNewNetCode( *new_conn ); - wxLogTrace( ConnTrace, wxS( "SG(%ld), Adding full local name (%s) with sg (%d)" ), subgraph->m_code, - name, code ); + wxLogTrace( ConnTrace, wxS( "SG(%ld), Adding full local name (%s) with sg (%d) on subsheet %s" ), subgraph->m_code, + name, code, subgraph->m_sheet.PathHumanReadable() ); new_sg->m_driver_connection = new_conn; new_sg->m_code = m_last_subgraph_code++; @@ -2333,8 +2334,8 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo } else if( aSubgraph->m_hier_ports.empty() && aSubgraph->m_hier_pins.empty() ) { - wxLogTrace( ConnTrace, wxS( "%lu (%s) has no hier pins or ports; marking clean" ), - aSubgraph->m_code, conn->Name() ); + wxLogTrace( ConnTrace, wxS( "%lu (%s) has no hier pins or ports on sheet %s; marking clean" ), + aSubgraph->m_code, conn->Name(), aSubgraph->m_sheet.PathHumanReadable() ); aSubgraph->m_dirty = false; return; } diff --git a/qa/data/eeschema/netlists/bus_connection/bus_connection.net b/qa/data/eeschema/netlists/bus_connection/bus_connection.net index 18608711a4..6f61717da9 100644 --- a/qa/data/eeschema/netlists/bus_connection/bus_connection.net +++ b/qa/data/eeschema/netlists/bus_connection/bus_connection.net @@ -1,8 +1,8 @@ (export (version "E") (design (source "/tmp/bus_connection/bus_connection.kicad_sch") - (date "Tue 04 Apr 2023 03:12:09 PM PDT") - (tool "Eeschema 7.99.0-693-ge4714b9abf-dirty") + (date "Fri 02 Jun 2023 02:11:17 PM PDT") + (tool "Eeschema 7.0.5-1-g5c5f077a4a-dirty") (sheet (number "1") (name "/") (tstamps "/") (title_block (title) @@ -102,12 +102,12 @@ (pin (num "3") (name "Pin_3") (type "passive"))))) (libraries) (nets - (net (code "8") (name "/test.x") + (net (code "6") (name "/top.x") (node (ref "J1") (pin "1") (pinfunction "Pin_1") (pintype "passive")) (node (ref "J2") (pin "1") (pinfunction "Pin_1") (pintype "passive"))) - (net (code "9") (name "/test.z") - (node (ref "J1") (pin "3") (pinfunction "Pin_3") (pintype "passive")) - (node (ref "J2") (pin "3") (pinfunction "Pin_3") (pintype "passive"))) - (net (code "10") (name "/top.y") + (net (code "7") (name "/top.y") (node (ref "J1") (pin "2") (pinfunction "Pin_2") (pintype "passive")) - (node (ref "J2") (pin "2") (pinfunction "Pin_2") (pintype "passive"))))) \ No newline at end of file + (node (ref "J2") (pin "2") (pinfunction "Pin_2") (pintype "passive"))) + (net (code "8") (name "/top.z") + (node (ref "J1") (pin "3") (pinfunction "Pin_3") (pintype "passive")) + (node (ref "J2") (pin "3") (pinfunction "Pin_3") (pintype "passive"))))) \ No newline at end of file diff --git a/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_pro b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_pro new file mode 100644 index 0000000000..11861feb48 --- /dev/null +++ b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_pro @@ -0,0 +1,348 @@ +{ + "board": { + "3dviewports": [], + "design_settings": { + "defaults": { + "board_outline_line_width": 0.1, + "copper_line_width": 0.2, + "copper_text_size_h": 1.5, + "copper_text_size_v": 1.5, + "copper_text_thickness": 0.3, + "other_line_width": 0.15, + "silk_line_width": 0.15, + "silk_text_size_h": 1.0, + "silk_text_size_v": 1.0, + "silk_text_thickness": 0.15 + }, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "rules": { + "min_copper_edge_clearance": 0.0, + "solder_mask_clearance": 0.0, + "solder_mask_min_width": 0.0 + }, + "track_widths": [], + "via_dimensions": [] + }, + "layer_presets": [], + "viewports": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "erc": { + "erc_exclusions": [], + "meta": { + "version": 0 + }, + "pin_map": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 2 + ], + [ + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ], + [ + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 2, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ] + ], + "rule_severities": { + "bus_definition_conflict": "error", + "bus_entry_needed": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "conflicting_netclasses": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "endpoint_off_grid": "warning", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "warning", + "missing_bidi_pin": "warning", + "missing_input_pin": "warning", + "missing_power_pin": "error", + "missing_unit": "warning", + "multiple_net_names": "warning", + "net_not_bus_member": "warning", + "no_connect_connected": "warning", + "no_connect_dangling": "warning", + "pin_not_connected": "error", + "pin_not_driven": "error", + "pin_to_pin": "error", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "simulation_model_issue": "ignore", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "hierarchy_aliases.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12, + "clearance": 0.2, + "diff_pair_gap": 0.25, + "diff_pair_via_gap": 0.25, + "diff_pair_width": 0.2, + "line_style": 0, + "microvia_diameter": 0.3, + "microvia_drill": 0.1, + "name": "Default", + "pcb_color": "rgba(0, 0, 0, 0.000)", + "schematic_color": "rgba(0, 0, 0, 0.000)", + "track_width": 0.25, + "via_diameter": 0.8, + "via_drill": 0.4, + "wire_width": 6 + } + ], + "meta": { + "version": 3 + }, + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "specctra_dsn": "", + "step": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "KiCad", + "page_layout_descr_file": "", + "plot_directory": "", + "spice_current_sheet_as_root": false, + "spice_external_command": "spice \"%I\"", + "spice_model_current_sheet_as_root": true, + "spice_save_all_currents": false, + "spice_save_all_voltages": false, + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "5672ff1e-f039-4e2f-acbb-4f76696b12eb", + "" + ], + [ + "3a86a621-3e65-4c1c-be9d-3981f7bcf11c", + "First Subsheet" + ], + [ + "ec16d119-285d-4e27-ba80-c46f40ad7d3d", + "Second Subsheet" + ], + [ + "5d358b80-b2c6-4077-a589-f28265c82400", + "Sub2" + ], + [ + "5d358b80-b2c6-4077-a589-f28265c82400", + "Sub2" + ] + ], + "text_variables": {} +} diff --git a/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_sch b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_sch new file mode 100644 index 0000000000..77a9756b4c --- /dev/null +++ b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.kicad_sch @@ -0,0 +1,101 @@ +(kicad_sch (version 20230121) (generator eeschema) + + (uuid 5672ff1e-f039-4e2f-acbb-4f76696b12eb) + + (paper "A4") + + (lib_symbols + ) + + (bus_alias "ALIAS1" (members "BOOT.SDA" "BOOT.SCL")) + + (bus_entry (at 128.27 40.64) (size 2.54 -2.54) + (stroke (width 0) (type default)) + (uuid ab866415-3df1-41ff-b9c8-d041ed3ac5ba) + ) + (bus_entry (at 129.54 80.01) (size 2.54 2.54) + (stroke (width 0) (type default)) + (uuid f01c77a6-e6b3-4a99-8b28-4cbe1170910a) + ) + + (wire (pts (xy 130.81 38.1) (xy 146.05 38.1)) + (stroke (width 0) (type default)) + (uuid 0124ab9a-cdc9-4692-9539-6470130e0b62) + ) + (bus (pts (xy 107.95 40.64) (xy 128.27 40.64)) + (stroke (width 0) (type default)) + (uuid 2acb8dd4-ba69-4a43-85ab-a93545927ff5) + ) + (bus (pts (xy 107.95 80.01) (xy 129.54 80.01)) + (stroke (width 0) (type default)) + (uuid b2c83a14-7b49-47b9-97e4-6c79f86b749e) + ) + + (wire (pts (xy 132.08 82.55) (xy 146.05 82.55)) + (stroke (width 0) (type default)) + (uuid ccd87b5d-059d-42a7-89d6-c68642da861b) + ) + + (label "S0{ALIAS1}" (at 114.3 40.64 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 567196f2-eb45-4106-8bc3-f4d02c718631) + ) + (label "S0.BOOT.SDA" (at 146.05 38.1 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 6d41d209-62fd-4967-8238-8314aefa2934) + ) + (label "S1.BOOT.SDA" (at 146.05 82.55 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 9a2a61da-1e57-4e04-b799-525fb83cb56d) + ) + (label "S1{ALIAS1}" (at 115.57 80.01 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 9cbd3a1d-6552-46c4-a605-d1981cbac90a) + ) + + (sheet (at 83.82 36.83) (size 24.13 17.78) (fields_autoplaced) + (stroke (width 0.1524) (type solid)) + (fill (color 0 0 0 0.0000)) + (uuid 3a86a621-3e65-4c1c-be9d-3981f7bcf11c) + (property "Sheetname" "First Subsheet" (at 83.82 36.1184 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + ) + (property "Sheetfile" "sub1.kicad_sch" (at 83.82 55.1946 0) + (effects (font (size 1.27 1.27)) (justify left top)) + ) + (pin "{ALIAS1}" input (at 107.95 40.64 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid 37bcc2df-e57d-4bcb-9f91-75f2ff44300c) + ) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb" (page "2")) + ) + ) + ) + + (sheet (at 83.82 66.04) (size 24.13 17.78) (fields_autoplaced) + (stroke (width 0.1524) (type solid)) + (fill (color 0 0 0 0.0000)) + (uuid ec16d119-285d-4e27-ba80-c46f40ad7d3d) + (property "Sheetname" "Second Subsheet" (at 83.82 65.3284 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + ) + (property "Sheetfile" "sub1.kicad_sch" (at 83.82 84.4046 0) + (effects (font (size 1.27 1.27)) (justify left top)) + ) + (pin "{ALIAS1}" input (at 107.95 80.01 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid a65246ae-9c9b-45a0-a438-f5a87f84342c) + ) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb" (page "3")) + ) + ) + ) + + (sheet_instances + (path "/" (page "1")) + ) +) diff --git a/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.net b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.net new file mode 100644 index 0000000000..b1258cbe2e --- /dev/null +++ b/qa/data/eeschema/netlists/hierarchy_aliases/hierarchy_aliases.net @@ -0,0 +1,152 @@ +(export (version "E") + (design + (source "/tmp/hierarchy_aliases/hierarchy_aliases.kicad_sch") + (date "Fri 02 Jun 2023 02:20:51 PM PDT") + (tool "Eeschema 7.0.5-1-g5c5f077a4a-dirty") + (sheet (number "1") (name "/") (tstamps "/") + (title_block + (title) + (company) + (rev) + (date) + (source "hierarchy_aliases.kicad_sch") + (comment (number "1") (value "")) + (comment (number "2") (value "")) + (comment (number "3") (value "")) + (comment (number "4") (value "")) + (comment (number "5") (value "")) + (comment (number "6") (value "")) + (comment (number "7") (value "")) + (comment (number "8") (value "")) + (comment (number "9") (value "")))) + (sheet (number "2") (name "/First Subsheet/") (tstamps "/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/") + (title_block + (title) + (company) + (rev) + (date) + (source "sub1.kicad_sch") + (comment (number "1") (value "")) + (comment (number "2") (value "")) + (comment (number "3") (value "")) + (comment (number "4") (value "")) + (comment (number "5") (value "")) + (comment (number "6") (value "")) + (comment (number "7") (value "")) + (comment (number "8") (value "")) + (comment (number "9") (value "")))) + (sheet (number "3") (name "/Second Subsheet/") (tstamps "/ec16d119-285d-4e27-ba80-c46f40ad7d3d/") + (title_block + (title) + (company) + (rev) + (date) + (source "sub1.kicad_sch") + (comment (number "1") (value "")) + (comment (number "2") (value "")) + (comment (number "3") (value "")) + (comment (number "4") (value "")) + (comment (number "5") (value "")) + (comment (number "6") (value "")) + (comment (number "7") (value "")) + (comment (number "8") (value "")) + (comment (number "9") (value "")))) + (sheet (number "4") (name "/First Subsheet/Sub2/") (tstamps "/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400/") + (title_block + (title) + (company) + (rev) + (date) + (source "sub2.kicad_sch") + (comment (number "1") (value "")) + (comment (number "2") (value "")) + (comment (number "3") (value "")) + (comment (number "4") (value "")) + (comment (number "5") (value "")) + (comment (number "6") (value "")) + (comment (number "7") (value "")) + (comment (number "8") (value "")) + (comment (number "9") (value "")))) + (sheet (number "5") (name "/Second Subsheet/Sub2/") (tstamps "/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400/") + (title_block + (title) + (company) + (rev) + (date) + (source "sub2.kicad_sch") + (comment (number "1") (value "")) + (comment (number "2") (value "")) + (comment (number "3") (value "")) + (comment (number "4") (value "")) + (comment (number "5") (value "")) + (comment (number "6") (value "")) + (comment (number "7") (value "")) + (comment (number "8") (value "")) + (comment (number "9") (value ""))))) + (components + (comp (ref "R1") + (value "R") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Sub2")) + (property (name "Sheetfile") (value "sub2.kicad_sch")) + (property (name "ki_description") (value "Resistor")) + (property (name "ki_keywords") (value "R res resistor")) + (sheetpath (names "/First Subsheet/Sub2/") (tstamps "/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400/")) + (tstamps "6ecef390-54af-4762-b224-dc085a38636b")) + (comp (ref "R2") + (value "R") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Sub2")) + (property (name "Sheetfile") (value "sub2.kicad_sch")) + (property (name "ki_description") (value "Resistor")) + (property (name "ki_keywords") (value "R res resistor")) + (sheetpath (names "/First Subsheet/Sub2/") (tstamps "/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400/")) + (tstamps "f20a508d-5fd9-4ac7-a515-81c670b3db74")) + (comp (ref "R3") + (value "R") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Sub2")) + (property (name "Sheetfile") (value "sub2.kicad_sch")) + (property (name "ki_description") (value "Resistor")) + (property (name "ki_keywords") (value "R res resistor")) + (sheetpath (names "/Second Subsheet/Sub2/") (tstamps "/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400/")) + (tstamps "6ecef390-54af-4762-b224-dc085a38636b")) + (comp (ref "R4") + (value "R") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Sub2")) + (property (name "Sheetfile") (value "sub2.kicad_sch")) + (property (name "ki_description") (value "Resistor")) + (property (name "ki_keywords") (value "R res resistor")) + (sheetpath (names "/Second Subsheet/Sub2/") (tstamps "/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400/")) + (tstamps "f20a508d-5fd9-4ac7-a515-81c670b3db74"))) + (libparts + (libpart (lib "Device") (part "R") + (description "Resistor") + (docs "~") + (footprints + (fp "R_*")) + (fields + (field (name "Reference") "R") + (field (name "Value") "R") + (field (name "Datasheet") "~")) + (pins + (pin (num "1") (name "") (type "passive")) + (pin (num "2") (name "") (type "passive"))))) + (libraries + (library (logical "Device") + (uri "/usr/local/share/kicad/symbols//Device.kicad_sym"))) + (nets + (net (code "6") (name "/S0.BOOT.SCL") + (node (ref "R2") (pin "2") (pintype "passive"))) + (net (code "7") (name "/S0.BOOT.SDA") + (node (ref "R1") (pin "2") (pintype "passive"))) + (net (code "9") (name "/S1.BOOT.SCL") + (node (ref "R4") (pin "2") (pintype "passive"))) + (net (code "10") (name "/S1.BOOT.SDA") + (node (ref "R3") (pin "2") (pintype "passive"))) + (net (code "13") (name "GND") + (node (ref "R1") (pin "1") (pintype "passive")) + (node (ref "R2") (pin "1") (pintype "passive")) + (node (ref "R3") (pin "1") (pintype "passive")) + (node (ref "R4") (pin "1") (pintype "passive"))))) \ No newline at end of file diff --git a/qa/data/eeschema/netlists/hierarchy_aliases/sub1.kicad_sch b/qa/data/eeschema/netlists/hierarchy_aliases/sub1.kicad_sch new file mode 100644 index 0000000000..9f94d93e10 --- /dev/null +++ b/qa/data/eeschema/netlists/hierarchy_aliases/sub1.kicad_sch @@ -0,0 +1,46 @@ +(kicad_sch (version 20230121) (generator eeschema) + + (uuid 0fa37f06-195f-46d0-abab-0a61e03e8f7d) + + (paper "A4") + + (lib_symbols + ) + + (bus_alias "ALIAS2" (members "SDA" "SCL")) + + (bus (pts (xy 107.95 77.47) (xy 121.92 77.47)) + (stroke (width 0) (type default)) + (uuid 3a2be92f-6a0f-4c8e-a931-f9def41389df) + ) + (bus (pts (xy 124.46 74.93) (xy 146.05 74.93)) + (stroke (width 0) (type default)) + (uuid a271a4d3-7ff5-491a-832b-331c567ca0c2) + ) + + (label "BOOT{ALIAS2}" (at 128.27 74.93 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 5752ea1e-a688-41ac-9fbd-249709aaa6ba) + ) + + (hierarchical_label "{ALIAS1}" (shape input) (at 107.95 77.47 180) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid c7a2989c-ad88-42e7-8073-9aae4bdf938b) + ) + + (sheet (at 146.05 68.58) (size 25.4 15.24) (fields_autoplaced) + (stroke (width 0.1524) (type solid)) + (fill (color 0 0 0 0.0000)) + (uuid 5d358b80-b2c6-4077-a589-f28265c82400) + (property "Sheetname" "Sub2" (at 146.05 67.8684 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + ) + (property "Sheetfile" "sub2.kicad_sch" (at 146.05 84.4046 0) + (effects (font (size 1.27 1.27)) (justify left top)) + ) + (pin "{ALIAS2}" input (at 146.05 74.93 180) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid 326f835e-3272-4ddb-8393-0edf2828b89a) + ) + ) +) diff --git a/qa/data/eeschema/netlists/hierarchy_aliases/sub2.kicad_sch b/qa/data/eeschema/netlists/hierarchy_aliases/sub2.kicad_sch new file mode 100644 index 0000000000..a821c67772 --- /dev/null +++ b/qa/data/eeschema/netlists/hierarchy_aliases/sub2.kicad_sch @@ -0,0 +1,253 @@ +(kicad_sch (version 20230121) (generator eeschema) + + (uuid a7b3b286-b728-491e-aed0-894d55ae08c8) + + (paper "A4") + + (lib_symbols + (symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "R" (at 2.032 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R" (at 0 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at -1.778 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "R res resistor" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Resistor" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_fp_filters" "R_*" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "R_0_1" + (rectangle (start -1.016 -2.54) (end 1.016 2.54) + (stroke (width 0.254) (type default)) + (fill (type none)) + ) + ) + (symbol "R_1_1" + (pin passive line (at 0 3.81 270) (length 1.27) + (name "~" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + (pin passive line (at 0 -3.81 90) (length 1.27) + (name "~" (effects (font (size 1.27 1.27)))) + (number "2" (effects (font (size 1.27 1.27)))) + ) + ) + ) + (symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "#PWR" (at 0 -6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 0 -3.81 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "global power" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "GND_0_1" + (polyline + (pts + (xy 0 0) + (xy 0 -1.27) + (xy 1.27 -1.27) + (xy 0 -2.54) + (xy -1.27 -1.27) + (xy 0 -1.27) + ) + (stroke (width 0) (type default)) + (fill (type none)) + ) + ) + (symbol "GND_1_1" + (pin power_in line (at 0 0 270) (length 0) hide + (name "GND" (effects (font (size 1.27 1.27)))) + (number "1" (effects (font (size 1.27 1.27)))) + ) + ) + ) + ) + + + (bus_entry (at 182.88 107.95) (size -2.54 2.54) + (stroke (width 0) (type default)) + (uuid 5c3d2d94-de4f-4f92-ae19-0c6f71ac5969) + ) + (bus_entry (at 182.88 116.84) (size -2.54 2.54) + (stroke (width 0) (type default)) + (uuid 700be89b-6cb0-4405-a7f4-901352643ac7) + ) + + (bus (pts (xy 182.88 107.95) (xy 182.88 116.84)) + (stroke (width 0) (type default)) + (uuid 04abbd32-a77c-4a11-ad58-70e3ef68abff) + ) + (bus (pts (xy 182.88 116.84) (xy 182.88 119.38)) + (stroke (width 0) (type default)) + (uuid 2e425e94-7ec7-4251-8273-da09796b6647) + ) + + (wire (pts (xy 156.21 110.49) (xy 180.34 110.49)) + (stroke (width 0) (type default)) + (uuid 4befb219-ea3a-4e03-b1c6-df3a6ad44548) + ) + (bus (pts (xy 182.88 82.55) (xy 182.88 107.95)) + (stroke (width 0) (type default)) + (uuid 4dc1a694-49d8-46b5-973d-fd8471be1e9e) + ) + (bus (pts (xy 102.87 82.55) (xy 182.88 82.55)) + (stroke (width 0) (type default)) + (uuid 88187d16-8353-4a63-9574-f8031800cf1b) + ) + + (wire (pts (xy 156.21 119.38) (xy 180.34 119.38)) + (stroke (width 0) (type default)) + (uuid f3b457b7-505d-4a0e-a911-7fd738a4eb67) + ) + + (label "SDA" (at 171.45 110.49 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 5d0ec16a-814f-4e24-86ff-1f6d6123c082) + ) + (label "SCL" (at 171.45 119.38 0) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid d4c629f7-ca26-40b6-996b-efe52c8ca0ab) + ) + + (hierarchical_label "{ALIAS2}" (shape input) (at 102.87 82.55 180) (fields_autoplaced) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid 18cd2c5e-4dca-462d-b3ed-ec8f6634b91a) + ) + + (symbol (lib_id "power:GND") (at 148.59 110.49 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 6a3fd0d0-1d18-4245-a931-afea155036eb) + (property "Reference" "#PWR0101" (at 148.59 116.84 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 148.59 115.57 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 148.59 110.49 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 148.59 110.49 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid d0c0b4c6-a855-4ffc-8dff-292d4908ad69)) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "#PWR0101") (unit 1) + ) + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "#PWR0103") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Device:R") (at 152.4 110.49 90) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid 6ecef390-54af-4762-b224-dc085a38636b) + (property "Reference" "R1" (at 152.4 104.14 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R" (at 152.4 106.68 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 152.4 112.268 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (at 152.4 110.49 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 3cdca600-8b37-4fc4-8cd2-c1502ce8568c)) + (pin "2" (uuid dac1850c-837f-43b6-bd24-a599e12405e3)) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "R1") (unit 1) + ) + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "R3") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "power:GND") (at 148.59 119.38 0) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid b7dd3b79-f169-48d3-976e-d24a43584181) + (property "Reference" "#PWR0102" (at 148.59 125.73 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (at 148.59 124.46 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 148.59 119.38 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (at 148.59 119.38 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid f272d123-7ae0-4e3b-b22a-5f91597471bd)) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "#PWR0102") (unit 1) + ) + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "#PWR0104") (unit 1) + ) + ) + ) + ) + + (symbol (lib_id "Device:R") (at 152.4 119.38 90) (unit 1) + (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) + (uuid f20a508d-5fd9-4ac7-a515-81c670b3db74) + (property "Reference" "R2" (at 152.4 113.03 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R" (at 152.4 115.57 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (at 152.4 121.158 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (at 152.4 119.38 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 2f239bcb-73e2-4c9e-b9bd-4355063f11f6)) + (pin "2" (uuid 9f57cc78-adf1-4e9d-8682-ca44d1a41d72)) + (instances + (project "hierarchy_aliases" + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/3a86a621-3e65-4c1c-be9d-3981f7bcf11c/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "R2") (unit 1) + ) + (path "/5672ff1e-f039-4e2f-acbb-4f76696b12eb/ec16d119-285d-4e27-ba80-c46f40ad7d3d/5d358b80-b2c6-4077-a589-f28265c82400" + (reference "R4") (unit 1) + ) + ) + ) + ) +) diff --git a/qa/tests/eeschema/test_netlist_exporter_kicad.cpp b/qa/tests/eeschema/test_netlist_exporter_kicad.cpp index 6279436e95..a5ae342fff 100644 --- a/qa/tests/eeschema/test_netlist_exporter_kicad.cpp +++ b/qa/tests/eeschema/test_netlist_exporter_kicad.cpp @@ -189,5 +189,10 @@ BOOST_AUTO_TEST_CASE( Issue14657 ) TestNetlist( "issue14657" ); } +BOOST_AUTO_TEST_CASE( HierarchyAliases ) +{ + TestNetlist( "hierarchy_aliases" ); +} + BOOST_AUTO_TEST_SUITE_END()