From b20f18e6c5308b3dbbf39a40699f06a7e93aaf42 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 11 Mar 2021 18:20:56 -0500 Subject: [PATCH] Properly handle mixed-up group buses Fixes https://gitlab.com/kicad/code/kicad/-/issues/7870 --- eeschema/sch_connection.cpp | 14 +- .../group_bus_matching.kicad_pro | 302 ++++++++++++++++++ .../group_bus_matching.kicad_sch | 77 +++++ .../group_bus_matching/group_bus_matching.net | 114 +++++++ .../group_bus_matching/subsheet1.kicad_sch | 196 ++++++++++++ .../group_bus_matching/subsheet2.kicad_sch | 196 ++++++++++++ qa/eeschema/test_netlists.cpp | 6 + 7 files changed, 903 insertions(+), 2 deletions(-) create mode 100644 qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_pro create mode 100644 qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_sch create mode 100644 qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.net create mode 100644 qa/eeschema/data/netlists/group_bus_matching/subsheet1.kicad_sch create mode 100644 qa/eeschema/data/netlists/group_bus_matching/subsheet2.kicad_sch diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 059a2e1ba4..773badd6bb 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -269,14 +269,24 @@ void SCH_CONNECTION::Clone( const SCH_CONNECTION& aOther ) } else if( m_type == CONNECTION_TYPE::BUS_GROUP && aOther.Type() == CONNECTION_TYPE::BUS_GROUP ) { - if( m_members.empty() || m_members.size() != otherMembers.size() ) + if( m_members.empty() ) { m_members = otherMembers; } else { + // TODO: refactor this once we support deep nesting for( size_t i = 0; i < m_members.size(); ++i ) - m_members[i]->Clone( *otherMembers[i] ); + { + auto it = std::find_if( otherMembers.begin(), otherMembers.end(), + [&]( const std::shared_ptr& aTest ) + { + return aTest->LocalName() == m_members[i]->LocalName(); + } ); + + if( it != otherMembers.end() ) + m_members[i]->Clone( **it ); + } } } diff --git a/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_pro b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_pro new file mode 100644 index 0000000000..dcee595430 --- /dev/null +++ b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_pro @@ -0,0 +1,302 @@ +{ + "board": { + "layer_presets": [] + }, + "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_label_syntax": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "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": "warning", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "group_bus_matching.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12.0, + "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.0 + } + ], + "meta": { + "version": 0 + }, + "net_colors": null + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "specctra_dsn": "", + "step": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "drawing": { + "default_bus_thickness": 12.0, + "default_junction_size": 40.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "default_wire_thickness": 6.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, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.3 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 0 + }, + "net_format_name": "KiCad", + "page_layout_descr_file": "", + "plot_directory": "", + "spice_adjust_passive_values": false, + "spice_external_command": "spice \"%I\"", + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "04eb80a5-3d22-464b-8fb7-e70e01da2cf4", + "" + ], + [ + "04eb80a5-3d22-464b-8fb7-e70e01da2cf4", + "Subsheet1" + ], + [ + "8903cf94-5bbd-4df7-9bc9-ca711b28d97a", + "Subsheet2" + ] + ], + "text_variables": {} +} diff --git a/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_sch b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_sch new file mode 100644 index 0000000000..707fbb0373 --- /dev/null +++ b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_sch @@ -0,0 +1,77 @@ +(kicad_sch (version 20210126) (generator eeschema) + + (paper "A4") + + (lib_symbols + ) + + + (bus (pts (xy 127 76.2) (xy 177.8 76.2)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 69193310-fadd-4f7b-8f7b-3fe960586b6e) + ) + + (label "{SCL SDA}" (at 156.21 76.2 180) + (effects (font (size 1.27 1.27)) (justify right bottom)) + (uuid 03c11db4-37f6-4fbf-9df1-7652ed8747c4) + ) + + (sheet (at 177.8 63.5) (size 38.1 25.4) + (stroke (width 0.001) (type solid) (color 132 0 132 1)) + (fill (color 255 255 255 0.0000)) + (uuid 04eb80a5-3d22-464b-8fb7-e70e01da2cf4) + (property "Sheet name" "Subsheet1" (id 0) (at 177.8 62.8641 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + ) + (property "Sheet file" "subsheet1.kicad_sch" (id 1) (at 177.8 89.4089 0) + (effects (font (size 1.27 1.27)) (justify left top)) + ) + (pin "{SCL SDA}" input (at 177.8 76.2 180) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid f9137936-7c5f-45bf-bcf5-e11d060fbbec) + ) + ) + + (sheet (at 88.9 63.5) (size 38.1 25.4) + (stroke (width 0.001) (type solid) (color 132 0 132 1)) + (fill (color 255 255 255 0.0000)) + (uuid 8903cf94-5bbd-4df7-9bc9-ca711b28d97a) + (property "Sheet name" "Subsheet2" (id 0) (at 88.9 62.8641 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + ) + (property "Sheet file" "subsheet2.kicad_sch" (id 1) (at 88.9 89.4089 0) + (effects (font (size 1.27 1.27)) (justify left top)) + ) + (pin "{SDA SCL}" input (at 127 76.2 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid 4cb5ad84-de98-4f52-87ea-8c568aef5858) + ) + ) + + (sheet_instances + (path "/" (page "1")) + (path "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/" (page "2")) + (path "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/" (page "3")) + ) + + (symbol_instances + (path "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/2d52877c-5f64-4e9b-8318-550f62b8b212" + (reference "#PWR01") (unit 1) (value "GND") (footprint "") + ) + (path "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/7e7dc5ce-6b00-48d2-9c9b-9cc678b3783a" + (reference "R1") (unit 1) (value "R") (footprint "") + ) + (path "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/04ecd82e-109a-4cfb-8016-ccfdc48c1549" + (reference "R2") (unit 1) (value "R") (footprint "") + ) + (path "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/1ab5160b-c46e-4dfc-97f9-e49d72bc401d" + (reference "#PWR02") (unit 1) (value "GND") (footprint "") + ) + (path "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/081a37f8-0ee2-4efb-9b8b-aa87b2ffa46b" + (reference "R3") (unit 1) (value "R") (footprint "") + ) + (path "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/788e5e39-7eb5-4dc0-9e5b-9eac30779d04" + (reference "R4") (unit 1) (value "R") (footprint "") + ) + ) +) diff --git a/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.net b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.net new file mode 100644 index 0000000000..2235047fe4 --- /dev/null +++ b/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.net @@ -0,0 +1,114 @@ +(export (version "E") + (design + (source "/home/jon/work/kicad/qa/eeschema/data/netlists/group_bus_matching/group_bus_matching.kicad_sch") + (date "Thu 11 Mar 2021 18:17:06 EST") + (tool "Eeschema (5.99.0-9737-g1d261e6107-dirty)") + (sheet (number "1") (name "/") (tstamps "/") + (title_block + (title) + (company) + (rev) + (date) + (source "group_bus_matching.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 "/Subsheet1/") (tstamps "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/") + (title_block + (title) + (company) + (rev) + (date) + (source "subsheet1.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 "/Subsheet2/") (tstamps "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/") + (title_block + (title) + (company) + (rev) + (date) + (source "subsheet2.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") + (datasheet "~") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Subsheet1")) + (property (name "Sheetfile") (value "subsheet1.kicad_sch")) + (sheetpath (names "/Subsheet1/") (tstamps "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/")) + (tstamps "7e7dc5ce-6b00-48d2-9c9b-9cc678b3783a")) + (comp (ref "R2") + (value "R") + (datasheet "~") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Subsheet1")) + (property (name "Sheetfile") (value "subsheet1.kicad_sch")) + (sheetpath (names "/Subsheet1/") (tstamps "/04eb80a5-3d22-464b-8fb7-e70e01da2cf4/")) + (tstamps "04ecd82e-109a-4cfb-8016-ccfdc48c1549")) + (comp (ref "R3") + (value "R") + (datasheet "~") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Subsheet2")) + (property (name "Sheetfile") (value "subsheet2.kicad_sch")) + (sheetpath (names "/Subsheet2/") (tstamps "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/")) + (tstamps "081a37f8-0ee2-4efb-9b8b-aa87b2ffa46b")) + (comp (ref "R4") + (value "R") + (datasheet "~") + (libsource (lib "Device") (part "R") (description "Resistor")) + (property (name "Sheetname") (value "Subsheet2")) + (property (name "Sheetfile") (value "subsheet2.kicad_sch")) + (sheetpath (names "/Subsheet2/") (tstamps "/8903cf94-5bbd-4df7-9bc9-ca711b28d97a/")) + (tstamps "788e5e39-7eb5-4dc0-9e5b-9eac30779d04"))) + (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 "/home/jon/kicad-library/kicad-symbols//Device.lib"))) + (nets + (net (code "1") (name "/SCL") + (node (ref "R1") (pin "1") (pintype "passive")) + (node (ref "R3") (pin "1") (pintype "passive"))) + (net (code "2") (name "/SDA") + (node (ref "R2") (pin "1") (pintype "passive")) + (node (ref "R4") (pin "1") (pintype "passive"))) + (net (code "4") (name "GND") + (node (ref "R1") (pin "2") (pintype "passive")) + (node (ref "R2") (pin "2") (pintype "passive")) + (node (ref "R3") (pin "2") (pintype "passive")) + (node (ref "R4") (pin "2") (pintype "passive"))))) \ No newline at end of file diff --git a/qa/eeschema/data/netlists/group_bus_matching/subsheet1.kicad_sch b/qa/eeschema/data/netlists/group_bus_matching/subsheet1.kicad_sch new file mode 100644 index 0000000000..4c0169d509 --- /dev/null +++ b/qa/eeschema/data/netlists/group_bus_matching/subsheet1.kicad_sch @@ -0,0 +1,196 @@ +(kicad_sch (version 20210126) (generator eeschema) + + (paper "A4") + + (lib_symbols + (symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "R" (id 0) (at 2.032 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R" (id 1) (at 0 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at -1.778 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "R res resistor" (id 4) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Resistor" (id 5) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_fp_filters" "R_*" (id 6) (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)) (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" (id 0) (at 0 -6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 0 -3.81 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "power-flag" (id 4) (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" (id 5) (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)) (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)))) + ) + ) + ) + ) + + (junction (at 177.8 88.9) (diameter 1.016) (color 0 0 0 0)) + + (bus_entry (at 152.4 81.28) (size 2.54 2.54) + (stroke (width 0.1524) (type solid) (color 0 0 0 0)) + (uuid 6b4beefd-3e5a-4ca6-95c1-8219045bdfff) + ) + (bus_entry (at 152.4 83.82) (size 2.54 2.54) + (stroke (width 0.1524) (type solid) (color 0 0 0 0)) + (uuid c3ae8971-bfb4-495b-a6c9-594f9369a4da) + ) + + (wire (pts (xy 154.94 83.82) (xy 165.1 83.82)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid a72228ec-e055-4d4c-8039-7fb93bbdef25) + ) + (wire (pts (xy 154.94 86.36) (xy 165.1 86.36)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid da85d117-a5fe-4287-9c2f-87702d498dc0) + ) + (wire (pts (xy 165.1 86.36) (xy 165.1 88.9)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 3e0326a1-ecde-4793-9d11-5c29a255b98a) + ) + (wire (pts (xy 172.72 83.82) (xy 177.8 83.82)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 0772d598-4a48-43df-860d-57d31fcc5f77) + ) + (wire (pts (xy 172.72 88.9) (xy 177.8 88.9)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid d9e8046c-f846-4443-95dd-9cdf1edabd94) + ) + (wire (pts (xy 177.8 83.82) (xy 177.8 88.9)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 0772d598-4a48-43df-860d-57d31fcc5f77) + ) + (wire (pts (xy 177.8 88.9) (xy 177.8 90.17)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid d9e8046c-f846-4443-95dd-9cdf1edabd94) + ) + (bus (pts (xy 139.7 76.2) (xy 152.4 76.2)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 558a1116-6988-4eb3-8b7f-3c4db99769e3) + ) + (bus (pts (xy 152.4 76.2) (xy 152.4 81.28)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 558a1116-6988-4eb3-8b7f-3c4db99769e3) + ) + (bus (pts (xy 152.4 81.28) (xy 152.4 83.82)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 558a1116-6988-4eb3-8b7f-3c4db99769e3) + ) + + (label "SCL" (at 158.75 83.82 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid b11c7c51-65e3-48f8-8127-1e673409cef6) + ) + (label "SDA" (at 158.75 86.36 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid 9adcddb0-5aaa-435e-af98-f534bde031bb) + ) + + (hierarchical_label "{SCL SDA}" (shape input) (at 139.7 76.2 180) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid e0f0c1c7-1081-40d1-ace2-11362ff0e83a) + ) + + (symbol (lib_id "power:GND") (at 177.8 90.17 0) (unit 1) + (in_bom yes) (on_board yes) + (uuid 2d52877c-5f64-4e9b-8318-550f62b8b212) + (property "Reference" "#PWR01" (id 0) (at 177.8 96.52 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 177.8 93.98 0)) + (property "Footprint" "" (id 2) (at 177.8 90.17 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 177.8 90.17 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 60f56d26-2d14-430a-b08d-29bd0a4dbff1)) + ) + + (symbol (lib_id "Device:R") (at 168.91 83.82 90) (unit 1) + (in_bom yes) (on_board yes) + (uuid 7e7dc5ce-6b00-48d2-9c9b-9cc678b3783a) + (property "Reference" "R1" (id 0) (at 168.91 81.788 90)) + (property "Value" "R" (id 1) (at 168.91 83.82 90)) + (property "Footprint" "" (id 2) (at 168.91 85.598 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 168.91 83.82 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid b2502765-843c-4d4e-aa3f-ebb36126a96a)) + (pin "2" (uuid 8652b132-b27a-4b96-8a30-b598fc0a4807)) + ) + + (symbol (lib_id "Device:R") (at 168.91 88.9 90) (unit 1) + (in_bom yes) (on_board yes) + (uuid 04ecd82e-109a-4cfb-8016-ccfdc48c1549) + (property "Reference" "R2" (id 0) (at 168.91 86.868 90)) + (property "Value" "R" (id 1) (at 168.91 88.9 90)) + (property "Footprint" "" (id 2) (at 168.91 90.678 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 168.91 88.9 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 07783d8b-9f87-45b7-ab8a-0aff18d20128)) + (pin "2" (uuid e652f913-bce5-4eb4-9fa9-a40f375396b4)) + ) +) diff --git a/qa/eeschema/data/netlists/group_bus_matching/subsheet2.kicad_sch b/qa/eeschema/data/netlists/group_bus_matching/subsheet2.kicad_sch new file mode 100644 index 0000000000..d64346c276 --- /dev/null +++ b/qa/eeschema/data/netlists/group_bus_matching/subsheet2.kicad_sch @@ -0,0 +1,196 @@ +(kicad_sch (version 20210126) (generator eeschema) + + (paper "A4") + + (lib_symbols + (symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) + (property "Reference" "R" (id 0) (at 2.032 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "R" (id 1) (at 0 0 90) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at -1.778 0 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "R res resistor" (id 4) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_description" "Resistor" (id 5) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_fp_filters" "R_*" (id 6) (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)) (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" (id 0) (at 0 -6.35 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 0 -3.81 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" (id 2) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "ki_keywords" "power-flag" (id 4) (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" (id 5) (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)) (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)))) + ) + ) + ) + ) + + (junction (at 151.13 96.52) (diameter 1.016) (color 0 0 0 0)) + + (bus_entry (at 125.73 88.9) (size 2.54 2.54) + (stroke (width 0.1524) (type solid) (color 0 0 0 0)) + (uuid 8f4ac32e-20e3-4c76-aa73-f2c7272a5be0) + ) + (bus_entry (at 125.73 91.44) (size 2.54 2.54) + (stroke (width 0.1524) (type solid) (color 0 0 0 0)) + (uuid 338b5ef9-c29c-4d8e-9ab1-3acdca680d29) + ) + + (wire (pts (xy 128.27 91.44) (xy 138.43 91.44)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 17163172-0db1-473a-8d6e-fec5da12fbf1) + ) + (wire (pts (xy 128.27 93.98) (xy 138.43 93.98)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 5354bfd5-ff19-46bb-8602-b2db63c17599) + ) + (wire (pts (xy 138.43 93.98) (xy 138.43 96.52)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 822cbe6d-7da8-4312-a631-98ef915ff2ed) + ) + (wire (pts (xy 146.05 91.44) (xy 151.13 91.44)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid cca808ae-c359-4a9e-afda-7179aba7091a) + ) + (wire (pts (xy 146.05 96.52) (xy 151.13 96.52)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 22d576d5-a796-4e6c-aff9-d278f907f793) + ) + (wire (pts (xy 151.13 91.44) (xy 151.13 96.52)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 9ca66318-6847-4953-854a-3757bec003dc) + ) + (wire (pts (xy 151.13 96.52) (xy 151.13 97.79)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 847cae69-28cb-4d15-bb2e-75469154639b) + ) + (bus (pts (xy 113.03 83.82) (xy 125.73 83.82)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid 2eb3f22d-ea2a-4c83-b95b-3a9ef8fdedc5) + ) + (bus (pts (xy 125.73 83.82) (xy 125.73 88.9)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid bfdb55a9-ed80-4167-ae10-31b819952918) + ) + (bus (pts (xy 125.73 88.9) (xy 125.73 91.44)) + (stroke (width 0) (type solid) (color 0 0 0 0)) + (uuid c693132e-78a1-4c33-a991-ba429b30657e) + ) + + (label "SCL" (at 132.08 91.44 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid c8b99fdd-af7b-4882-8c44-84b0fad50871) + ) + (label "SDA" (at 132.08 93.98 0) + (effects (font (size 1.27 1.27)) (justify left bottom)) + (uuid d9eb45bb-964c-40df-a6fb-535d85500bcd) + ) + + (hierarchical_label "{SDA SCL}" (shape input) (at 113.03 83.82 180) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid fbeadd3b-b76f-4648-b8cb-a9493a7b5c70) + ) + + (symbol (lib_id "power:GND") (at 151.13 97.79 0) (unit 1) + (in_bom yes) (on_board yes) + (uuid 1ab5160b-c46e-4dfc-97f9-e49d72bc401d) + (property "Reference" "#PWR02" (id 0) (at 151.13 104.14 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Value" "GND" (id 1) (at 151.13 101.6 0)) + (property "Footprint" "" (id 2) (at 151.13 97.79 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "" (id 3) (at 151.13 97.79 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 60f56d26-2d14-430a-b08d-29bd0a4dbff1)) + ) + + (symbol (lib_id "Device:R") (at 142.24 91.44 90) (unit 1) + (in_bom yes) (on_board yes) + (uuid 081a37f8-0ee2-4efb-9b8b-aa87b2ffa46b) + (property "Reference" "R3" (id 0) (at 142.24 89.408 90)) + (property "Value" "R" (id 1) (at 142.24 91.44 90)) + (property "Footprint" "" (id 2) (at 142.24 93.218 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 142.24 91.44 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid b2502765-843c-4d4e-aa3f-ebb36126a96a)) + (pin "2" (uuid 8652b132-b27a-4b96-8a30-b598fc0a4807)) + ) + + (symbol (lib_id "Device:R") (at 142.24 96.52 90) (unit 1) + (in_bom yes) (on_board yes) + (uuid 788e5e39-7eb5-4dc0-9e5b-9eac30779d04) + (property "Reference" "R4" (id 0) (at 142.24 94.488 90)) + (property "Value" "R" (id 1) (at 142.24 96.52 90)) + (property "Footprint" "" (id 2) (at 142.24 98.298 90) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" (id 3) (at 142.24 96.52 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" (uuid 07783d8b-9f87-45b7-ab8a-0aff18d20128)) + (pin "2" (uuid e652f913-bce5-4eb4-9fa9-a40f375396b4)) + ) +) diff --git a/qa/eeschema/test_netlists.cpp b/qa/eeschema/test_netlists.cpp index 006e68c7f0..bd0d79be62 100644 --- a/qa/eeschema/test_netlists.cpp +++ b/qa/eeschema/test_netlists.cpp @@ -284,4 +284,10 @@ BOOST_AUTO_TEST_CASE( PrefixBusAlias ) } +BOOST_AUTO_TEST_CASE( GroupBusMatching ) +{ + doNetlistTest( "group_bus_matching" ); +} + + BOOST_AUTO_TEST_SUITE_END()