Browse Source
Fixed: Fewer ERC items for pin connection conflicts in larger set of conflicting pins
pcb_db
Fixed: Fewer ERC items for pin connection conflicts in larger set of conflicting pins
pcb_db
committed by
Wayne Stambaugh
8 changed files with 2436 additions and 19 deletions
-
122eeschema/erc/erc.cpp
-
16eeschema/erc/erc_settings.cpp
-
38eeschema/erc/erc_settings.h
-
384qa/data/eeschema/erc_multiple_pin_to_pin.kicad_pro
-
1811qa/data/eeschema/erc_multiple_pin_to_pin.kicad_sch
-
1qa/tests/eeschema/CMakeLists.txt
-
78qa/tests/eeschema/erc/test_erc_multiple_pin_to_pin.cpp
-
5qa/tests/eeschema/erc/test_erc_stacking_pins.cpp
@ -0,0 +1,384 @@ |
|||
{ |
|||
"board": { |
|||
"3dviewports": [], |
|||
"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, |
|||
2, |
|||
2, |
|||
1, |
|||
1, |
|||
2 |
|||
], |
|||
[ |
|||
0, |
|||
0, |
|||
0, |
|||
1, |
|||
0, |
|||
0, |
|||
2, |
|||
0, |
|||
0, |
|||
0, |
|||
0, |
|||
2 |
|||
], |
|||
[ |
|||
0, |
|||
2, |
|||
1, |
|||
2, |
|||
0, |
|||
0, |
|||
2, |
|||
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": "erc_multiple_pin_to_pin.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.2, |
|||
"via_diameter": 0.6, |
|||
"via_drill": 0.3, |
|||
"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_export_filename": "", |
|||
"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": "", |
|||
"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": [ |
|||
[ |
|||
"c9b0dfd9-0180-4a78-8afb-2260035ff793", |
|||
"" |
|||
] |
|||
], |
|||
"text_variables": {} |
|||
} |
|||
1811
qa/data/eeschema/erc_multiple_pin_to_pin.kicad_sch
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,78 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 3 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one at |
|||
* http://www.gnu.org/licenses/
|
|||
*/ |
|||
|
|||
#include <qa_utils/wx_utils/unit_test_utils.h>
|
|||
#include <schematic_utils/schematic_file_util.h>
|
|||
|
|||
#include <connection_graph.h>
|
|||
#include <schematic.h>
|
|||
#include <erc/erc_settings.h>
|
|||
#include <erc/erc.h>
|
|||
#include <erc/erc_report.h>
|
|||
#include <settings/settings_manager.h>
|
|||
#include <locale_io.h>
|
|||
|
|||
|
|||
struct ERC_REGRESSION_TEST_FIXTURE |
|||
{ |
|||
ERC_REGRESSION_TEST_FIXTURE() : m_settingsManager( true /* headless */ ) {} |
|||
|
|||
SETTINGS_MANAGER m_settingsManager; |
|||
std::unique_ptr<SCHEMATIC> m_schematic; |
|||
}; |
|||
|
|||
|
|||
BOOST_FIXTURE_TEST_CASE( ERCMultiplePinToPin, ERC_REGRESSION_TEST_FIXTURE ) |
|||
{ |
|||
LOCALE_IO dummy; |
|||
|
|||
std::vector<std::pair<wxString, int>> tests = { { "erc_multiple_pin_to_pin", 2 } }; |
|||
|
|||
for( const std::pair<wxString, int>& test : tests ) |
|||
{ |
|||
KI_TEST::LoadSchematic( m_settingsManager, test.first, m_schematic ); |
|||
|
|||
ERC_SETTINGS& settings = m_schematic->ErcSettings(); |
|||
SHEETLIST_ERC_ITEMS_PROVIDER errors( m_schematic.get() ); |
|||
|
|||
// Skip the "Modified symbol" warning
|
|||
settings.m_ERCSeverities[ERCE_LIB_SYMBOL_ISSUES] = RPT_SEVERITY_IGNORE; |
|||
settings.m_ERCSeverities[ERCE_LIB_SYMBOL_MISMATCH] = RPT_SEVERITY_IGNORE; |
|||
|
|||
m_schematic->ConnectionGraph()->RunERC(); |
|||
|
|||
ERC_TESTER tester( m_schematic.get() ); |
|||
tester.TestConflictingBusAliases(); |
|||
tester.TestMultUnitPinConflicts(); |
|||
tester.TestMultiunitFootprints(); |
|||
tester.TestNoConnectPins(); |
|||
tester.TestPinToPin(); |
|||
tester.TestSimilarLabels(); |
|||
|
|||
errors.SetSeverities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ); |
|||
|
|||
ERC_REPORT reportWriter( m_schematic.get(), EDA_UNITS::MILLIMETRES ); |
|||
|
|||
BOOST_CHECK_MESSAGE( errors.GetCount() == test.second, |
|||
"Expected " << test.second << " errors in " << test.first.ToStdString() |
|||
<< " but got " << errors.GetCount() << "\n" |
|||
<< reportWriter.GetTextReport() ); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue