Do not merge buses of distinct types

Previously, this code would merge a vector bus
with a group bus containing the vector as a member.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16439
This commit is contained in:
Jon Evans 2023-12-30 10:54:17 -05:00
parent 1ae5bc7c0d
commit ea0673e7a0
5 changed files with 1630 additions and 1 deletions

View File

@ -1782,7 +1782,7 @@ void CONNECTION_GRAPH::processSubGraphs()
subgraph->m_bus_neighbors[member].insert( candidate );
candidate->m_bus_parents[member].insert( subgraph );
}
else
else if( connection->Type() == candidate->m_driver_connection->Type() )
{
wxLogTrace( ConnTrace, wxS( "%lu (%s) absorbs neighbor %lu (%s)" ),
subgraph->m_code, connection->Name(),

View File

@ -0,0 +1,406 @@
{
"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": []
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"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": "warning",
"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": "issue16439.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": "",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.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,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"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_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"010744f2-9f0e-4dbc-8f2a-30c04f561e63",
"Root"
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,165 @@
(export (version "E")
(design
(source "/home/jon/work/kicad/qa/data/eeschema/netlists/issue16439/issue16439.kicad_sch")
(date "2023-12-30T10:51:29-0500")
(tool "Eeschema 7.99.0-4122-g2ecf1ac23f-dirty")
(sheet (number "1") (name "/") (tstamps "/")
(title_block
(title)
(company)
(rev)
(date)
(source "issue16439.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 "TP1")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "d9c88d01-d1e7-4826-af61-75398396f4c0"))
(comp (ref "TP2")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "3b7f5c58-4f10-4191-baac-35e1103379be"))
(comp (ref "TP3")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "6b3cfa96-91c4-4e66-bdde-45ccf39d8e73"))
(comp (ref "TP4")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "c1ca0707-68dd-4ad1-9f82-bfcf8e993e07"))
(comp (ref "TP5")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "14c4399a-ebdd-4981-90af-83d7f164e8a6"))
(comp (ref "TP6")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "1eda2f02-eb82-4ef1-8d5b-b2c8ec178ee0"))
(comp (ref "TP7")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "ef1253e1-680c-4ae8-af9d-df3335e9d564"))
(comp (ref "TP8")
(value "TestPoint")
(description "test point")
(fields
(field (name "Footprint"))
(field (name "Datasheet"))
(field (name "Description") "test point"))
(libsource (lib "Connector") (part "TestPoint") (description "test point"))
(property (name "Sheetname") (value "Root"))
(property (name "Sheetfile") (value "issue16439.kicad_sch"))
(property (name "ki_keywords") (value "test point tp"))
(property (name "ki_fp_filters") (value "Pin* Test*"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "ad20a64d-3eb5-409e-9ad0-0893125e985f")))
(libparts
(libpart (lib "Connector") (part "TestPoint")
(description "test point")
(docs "~")
(footprints
(fp "Pin*")
(fp "Test*"))
(fields
(field (name "Reference") "TP")
(field (name "Value") "TestPoint")
(field (name "Footprint"))
(field (name "Datasheet") "~")
(field (name "Description") "test point"))
(pins
(pin (num "1") (name "1") (type "passive")))))
(libraries
(library (logical "Connector")
(uri "/usr/share/kicad/symbols//Connector.kicad_sym")))
(nets
(net (code "1") (name "/demo_bus.A0")
(node (ref "TP1") (pin "1") (pinfunction "1") (pintype "passive"))
(node (ref "TP5") (pin "1") (pinfunction "1") (pintype "passive")))
(net (code "2") (name "/demo_bus.A1")
(node (ref "TP2") (pin "1") (pinfunction "1") (pintype "passive"))
(node (ref "TP6") (pin "1") (pinfunction "1") (pintype "passive")))
(net (code "4") (name "/demo_bus.B0")
(node (ref "TP3") (pin "1") (pinfunction "1") (pintype "passive"))
(node (ref "TP7") (pin "1") (pinfunction "1") (pintype "passive")))
(net (code "5") (name "/demo_bus.B1")
(node (ref "TP4") (pin "1") (pinfunction "1") (pintype "passive"))
(node (ref "TP8") (pin "1") (pinfunction "1") (pintype "passive")))))

View File

@ -204,5 +204,10 @@ BOOST_AUTO_TEST_CASE( Issue16003 )
TestNetlist( "issue16003" );
}
BOOST_AUTO_TEST_CASE( Issue16439 )
{
TestNetlist( "issue16439" );
}
BOOST_AUTO_TEST_SUITE_END()