Eeschema netlist output: Propagate NC across hierarchical schematics

Fixes #12580

Additionally does not export no_connect netlist annotation on pins
which are both connected to another pin and a NC item, unless all
connected pins are stacked at the symbol level.

Adds testing of pin types to netlist QA unit tests.

(cherry picked from commit 9dca70a773)
This commit is contained in:
JamesJCode 2023-01-27 22:07:17 +00:00 committed by Seth Hillbrand
parent b62a8fe65a
commit b82020722b
10 changed files with 1190 additions and 10 deletions

View File

@ -647,24 +647,19 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
struct NET_NODE
{
NET_NODE( SCH_PIN* aPin, const SCH_SHEET_PATH& aSheet, bool aNoConnect ) :
m_Pin( aPin ),
m_Sheet( aSheet ),
m_NoConnect( aNoConnect )
NET_NODE( SCH_PIN* aPin, const SCH_SHEET_PATH& aSheet ) : m_Pin( aPin ), m_Sheet( aSheet )
{}
SCH_PIN* m_Pin;
SCH_SHEET_PATH m_Sheet;
bool m_NoConnect;
};
struct NET_RECORD
{
NET_RECORD( const wxString& aName ) :
m_Name( aName )
{};
NET_RECORD( const wxString& aName ) : m_Name( aName ), m_HasNoConnect( false ){};
wxString m_Name;
bool m_HasNoConnect;
std::vector<NET_NODE> m_Nodes;
};
@ -686,6 +681,9 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
bool nc = subgraph->m_no_connect && subgraph->m_no_connect->Type() == SCH_NO_CONNECT_T;
const SCH_SHEET_PATH& sheet = subgraph->m_sheet;
if( nc )
net_record->m_HasNoConnect = true;
for( SCH_ITEM* item : subgraph->m_items )
{
if( item->Type() == SCH_PIN_T )
@ -700,7 +698,7 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
continue;
}
net_record->m_Nodes.emplace_back( pin, sheet, nc );
net_record->m_Nodes.emplace_back( pin, sheet );
}
}
}
@ -744,6 +742,23 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
return refA == refB && a.m_Pin->GetShownNumber() == b.m_Pin->GetShownNumber();
} );
// Determine if all pins in the net are stacked (nets with only one pin are implicitly
// taken to be stacked)
bool allNetPinsStacked = true;
if( net_record->m_Nodes.size() > 1 )
{
SCH_PIN* firstPin = net_record->m_Nodes.begin()->m_Pin;
allNetPinsStacked =
std::all_of( net_record->m_Nodes.begin() + 1, net_record->m_Nodes.end(),
[=]( auto& node )
{
return firstPin->GetParent() == node.m_Pin->GetParent()
&& firstPin->GetPosition() == node.m_Pin->GetPosition()
&& firstPin->GetName() == node.m_Pin->GetName();
} );
}
for( const NET_NODE& netNode : net_record->m_Nodes )
{
wxString refText = netNode.m_Pin->GetParentSymbol()->GetRef( &netNode.m_Sheet );
@ -774,7 +789,8 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
if( !pinName.IsEmpty() )
xnode->AddAttribute( wxT( "pinfunction" ), pinName );
if( netNode.m_NoConnect )
if( net_record->m_HasNoConnect
&& ( net_record->m_Nodes.size() == 1 || allNetPinsStacked ) )
pinType += wxT( "+no_connect" );
xnode->AddAttribute( wxT( "pintype" ), pinType );

View File

@ -0,0 +1,92 @@
(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
(symbol "TEST_DOUBLE" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_DOUBLE_0_1"
(rectangle (start -1.27 -1.27) (end 8.89 -10.16)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_DOUBLE_1_1"
(pin input line (at -3.81 -3.81 0) (length 2.54)
(name "PIN1" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin input line (at -3.81 -7.62 0) (length 2.54)
(name "PIN2" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "TEST_SINGLE" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_SINGLE_0_1"
(rectangle (start 2.54 -1.27) (end 7.62 -6.35)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_SINGLE_1_1"
(pin input line (at 0 -3.81 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "TEST_STACKED" (in_bom yes) (on_board yes)
(property "Reference" "U" (at -1.27 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_STACKED_0_1"
(rectangle (start -2.54 1.27) (end 3.81 -3.81)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_STACKED_1_1"
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin no_connect line (at 6.35 -2.54 180) (length 2.54)
(name "NC" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
)
)
)

View File

@ -0,0 +1,90 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid 2f1f9429-5006-47c0-a1ec-500287ccb183)
(paper "A4")
(lib_symbols
(symbol "TEST_LIB:TEST_STACKED" (in_bom yes) (on_board yes)
(property "Reference" "U2" (at 0.635 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "~" (at 0 0 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)
)
(symbol "TEST_STACKED_0_1"
(rectangle (start -2.54 1.27) (end 3.81 -3.81)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_STACKED_1_1"
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin no_connect line (at 6.35 -2.54 180) (length 2.54)
(name "NC" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
)
)
)
(wire (pts (xy 125.73 64.77) (xy 129.54 64.77))
(stroke (width 0) (type default))
(uuid 54910a96-ab2d-4a37-9633-84e2bb9a9641)
)
(text "PINS 1 AND 2 SHOULD HAVE no_connect ANNOTATION\nAS THEY ARE A STACKED PAIR CONNECTED TO A NC\nSYMBOL"
(at 107.95 78.74 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid af27b845-a15e-48fe-880d-fd13c0a5898a)
)
(hierarchical_label "PIN" (shape input) (at 125.73 64.77 180) (fields_autoplaced)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 7a4e704b-fc28-4fb2-90a8-2f72f1e311c0)
)
(symbol (lib_id "TEST_LIB:TEST_STACKED") (at 134.62 63.5 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid a7ece548-fdfc-4869-9739-000253755521)
(property "Reference" "U2" (at 135.255 60.96 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "~" (at 134.62 63.5 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 134.62 63.5 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 134.62 63.5 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 4932eb83-7147-4373-8d14-7b38089ff74e))
(pin "2" (uuid 55bcad32-d793-47e3-b05d-0a9352a28b5e))
(pin "3" (uuid 889ccec7-1cd4-4394-b131-622af6736ab2))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4"
(reference "U2") (unit 1)
)
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4/fa05dc48-d19c-4e83-a3cd-8e95fa1e59b1"
(reference "U3") (unit 1)
)
)
)
)
)

View File

@ -0,0 +1,80 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid 5c9be1c7-6a4a-4df0-812c-39a920083d04)
(paper "A4")
(lib_symbols
(symbol "TEST_LIB:TEST_SINGLE" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_SINGLE_0_1"
(rectangle (start 2.54 -1.27) (end 7.62 -6.35)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_SINGLE_1_1"
(pin input line (at 0 -3.81 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
)
(wire (pts (xy 127 67.31) (xy 130.81 67.31))
(stroke (width 0) (type default))
(uuid e6aaf3b9-093d-4471-96bd-fed5b98141f6)
)
(text "PIN 1 SHOULD HAVE no_connect ANNOTATION AS IT\nIS CONNECTED TO NC IN PARENT SHEET"
(at 115.57 82.55 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 2887b945-22f5-4a24-bff1-edcbe3d8773d)
)
(hierarchical_label "PIN" (shape input) (at 127 67.31 180) (fields_autoplaced)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 5d1eea2c-2dae-4a71-9b12-abef5a05334a)
)
(symbol (lib_id "TEST_LIB:TEST_SINGLE") (at 130.81 63.5 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 4de6e629-b0b3-4928-9859-b3e6bfe3cfc6)
(property "Reference" "U1" (at 139.7 67.945 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "~" (at 130.81 63.5 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 130.81 63.5 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 130.81 63.5 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 53113259-0a12-4b72-8ad5-4f1195c2f58d))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4/ac073b00-33b3-4c40-9adc-0d2ac39cf8ef"
(reference "U1") (unit 1)
)
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4/701adb8c-f139-4a93-a927-02c9f06ca5b2"
(reference "U4") (unit 1)
)
)
)
)
)

View File

@ -0,0 +1,101 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid 5c9be1c7-6a4a-4df0-812c-39a920083d04)
(paper "A4")
(lib_symbols
(symbol "TEST_LIB:TEST_DOUBLE" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_DOUBLE_0_1"
(rectangle (start -1.27 -1.27) (end 8.89 -10.16)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_DOUBLE_1_1"
(pin input line (at -3.81 -3.81 0) (length 2.54)
(name "PIN1" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin input line (at -3.81 -7.62 0) (length 2.54)
(name "PIN2" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
)
(junction (at 130.81 67.31) (diameter 0) (color 0 0 0 0)
(uuid a64c6b68-3e7a-41c0-a3e8-98d7ecb75f93)
)
(wire (pts (xy 130.81 69.85) (xy 135.89 69.85))
(stroke (width 0) (type default))
(uuid 0b4aa95f-3d2f-46f7-9fc5-84258154b336)
)
(wire (pts (xy 130.81 67.31) (xy 130.81 69.85))
(stroke (width 0) (type default))
(uuid 51d2d3cf-eab2-4036-976b-1edf7cc9f202)
)
(wire (pts (xy 130.81 66.04) (xy 130.81 67.31))
(stroke (width 0) (type default))
(uuid 53afc7df-a4ed-4f4b-889e-14dd46cbe782)
)
(wire (pts (xy 135.89 66.04) (xy 130.81 66.04))
(stroke (width 0) (type default))
(uuid c04c1bed-85b3-4826-b71d-f35244dea845)
)
(wire (pts (xy 127 67.31) (xy 130.81 67.31))
(stroke (width 0) (type default))
(uuid e6aaf3b9-093d-4471-96bd-fed5b98141f6)
)
(text "PINS 1 AND 2 SHOULD NOT HAVE no_connect ANNOTATION DESPITE\nBEING CONNECTED TO NO NC IN PARENT SHEET AS THEY ARE NOT A STACKED\nPAIR. HOWEVER THIS IS AN ERC VIOLATION."
(at 114.3 80.01 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 79f29f27-46fe-4415-8338-c860507f42b5)
)
(hierarchical_label "PIN" (shape input) (at 127 67.31 180) (fields_autoplaced)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 5d1eea2c-2dae-4a71-9b12-abef5a05334a)
)
(symbol (lib_id "TEST_LIB:TEST_DOUBLE") (at 139.7 62.23 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid e7a02164-c941-4fff-917a-609c220ed064)
(property "Reference" "U4" (at 149.86 68.58 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "~" (at 139.7 62.23 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 139.7 62.23 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 139.7 62.23 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid d93c5276-1b1a-46e5-bb63-1b9ba52ccc2b))
(pin "2" (uuid 20b2e85c-44da-4f9c-be54-f0782dc97f83))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4/701adb8c-f139-4a93-a927-02c9f06ca5b2"
(reference "U4") (unit 1)
)
)
)
)
)

View File

@ -0,0 +1,4 @@
(sym_lib_table
(version 7)
(lib (name "TEST_LIB")(type "KiCad")(uri "${KIPRJMOD}/TEST_LIB.kicad_sym")(options "")(descr ""))
)

View File

@ -0,0 +1,344 @@
{
"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": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "error",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "test_hier_no_connect.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": [
[
"a68fb8f1-2acf-4e52-8498-fd8a9cae28e4",
""
],
[
"fa05dc48-d19c-4e83-a3cd-8e95fa1e59b1",
"sub1"
],
[
"ac073b00-33b3-4c40-9adc-0d2ac39cf8ef",
"sub2"
],
[
"701adb8c-f139-4a93-a927-02c9f06ca5b2",
"sub3"
]
],
"text_variables": {}
}

View File

@ -0,0 +1,287 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid a68fb8f1-2acf-4e52-8498-fd8a9cae28e4)
(paper "A4")
(lib_symbols
(symbol "TEST_LIB:TEST_DOUBLE" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 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)
)
(symbol "TEST_DOUBLE_0_1"
(rectangle (start -1.27 -1.27) (end 8.89 -10.16)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_DOUBLE_1_1"
(pin input line (at -3.81 -3.81 0) (length 2.54)
(name "PIN1" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin input line (at -3.81 -7.62 0) (length 2.54)
(name "PIN2" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "TEST_LIB:TEST_STACKED" (in_bom yes) (on_board yes)
(property "Reference" "U2" (at 0.635 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "~" (at 0 0 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)
)
(symbol "TEST_STACKED_0_1"
(rectangle (start -2.54 1.27) (end 3.81 -3.81)
(stroke (width 0) (type default))
(fill (type background))
)
)
(symbol "TEST_STACKED_1_1"
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at -5.08 -1.27 0) (length 2.54)
(name "PIN" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin no_connect line (at 6.35 -2.54 180) (length 2.54)
(name "NC" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
)
)
)
(junction (at 113.03 86.36) (diameter 0) (color 0 0 0 0)
(uuid 455f723c-4e5b-4f2f-af3c-0245fc2a3847)
)
(no_connect (at 146.05 114.3) (uuid 1e1c0ae4-c91c-4390-a345-2610badfde5b))
(no_connect (at 146.05 86.36) (uuid 2e5406ca-872d-4add-81be-9ef8e2f31a61))
(no_connect (at 110.49 71.12) (uuid b4d52b8b-c085-4dbc-8375-e40119dd9185))
(no_connect (at 146.05 57.15) (uuid c7202bf1-4382-40b0-9b9d-301830b33e2d))
(no_connect (at 107.95 86.36) (uuid c9de5403-845f-4338-86fc-8422c97cb788))
(no_connect (at 114.3 60.96) (uuid cfeb9cb5-268c-45a7-bb3d-d050238af62a))
(wire (pts (xy 113.03 88.9) (xy 118.11 88.9))
(stroke (width 0) (type default))
(uuid 2da5ba6e-ddea-4393-a3bb-c73491ac581e)
)
(wire (pts (xy 153.67 57.15) (xy 146.05 57.15))
(stroke (width 0) (type default))
(uuid 2f6f16b0-9f80-4121-8fc4-2dd2dd26adc4)
)
(wire (pts (xy 107.95 86.36) (xy 113.03 86.36))
(stroke (width 0) (type default))
(uuid 4074c980-f115-4e3b-8704-c3b364445f9e)
)
(wire (pts (xy 113.03 86.36) (xy 113.03 88.9))
(stroke (width 0) (type default))
(uuid 4fdb1798-53b3-4c40-a5bf-a2eedf60826a)
)
(wire (pts (xy 110.49 71.12) (xy 114.3 71.12))
(stroke (width 0) (type default))
(uuid 6050e983-4873-410e-bd8f-d0f582ef243a)
)
(wire (pts (xy 118.11 85.09) (xy 113.03 85.09))
(stroke (width 0) (type default))
(uuid 70804936-0e13-4317-8458-ed029b676ec9)
)
(wire (pts (xy 153.67 86.36) (xy 146.05 86.36))
(stroke (width 0) (type default))
(uuid a534eeec-4b5d-4ea7-a047-d5bb16fbe088)
)
(wire (pts (xy 113.03 85.09) (xy 113.03 86.36))
(stroke (width 0) (type default))
(uuid dcdad6a3-6b78-4fcc-9a0b-f93df91b2218)
)
(wire (pts (xy 153.67 114.3) (xy 146.05 114.3))
(stroke (width 0) (type default))
(uuid e6b320a0-220e-4490-90f1-e6b62c534a67)
)
(text "PINS 1 AND 2 SHOULD HAVE no_connect ANNOTATION\nAS THEY ARE A STACKED PAIR CONNECTED TO A NC\nSYMBOL"
(at 58.42 73.66 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 74e9af8c-4887-453b-9208-9c685c0d9667)
)
(text "PINS 1 AND 2 SHOULD HAVE no_connect ANNOTATION\nAS THEY ARE A STACKED PAIR CONNECTED TO A NC\nSYMBOL"
(at 58.42 64.77 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 7cf47243-0440-4f36-87aa-0e8caa797c12)
)
(text "PINS 1 AND 2 SHOULD NOT HAVE no_connect ANNOTATION DESPITE\nBEING CONNECTED TO NO NC IN PARENT SHEET AS THEY ARE NOT A STACKED\nPAIR. HOWEVER THIS IS AN ERC VIOLATION."
(at 49.53 99.06 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid cd8b755b-19e0-43ef-a9ec-3649f666f1d4)
)
(symbol (lib_id "TEST_LIB:TEST_DOUBLE") (at 121.92 81.28 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 9aac22d0-4d93-4d78-b01c-00c820843aee)
(property "Reference" "U4" (at 132.08 87.63 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "~" (at 121.92 81.28 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 121.92 81.28 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 121.92 81.28 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid bcd88e52-04ee-41a2-9028-d88421468758))
(pin "2" (uuid ab340800-9429-4192-9d41-061da2e17579))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4/701adb8c-f139-4a93-a927-02c9f06ca5b2"
(reference "U4") (unit 1)
)
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4"
(reference "U5") (unit 1)
)
)
)
)
(symbol (lib_id "TEST_LIB:TEST_STACKED") (at 119.38 69.85 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid c27d8823-b16a-4039-8b30-60b56b1d2929)
(property "Reference" "U6" (at 120.015 67.31 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "~" (at 119.38 69.85 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 119.38 69.85 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 119.38 69.85 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 6d55bf37-5dc3-4eb8-805f-ee2e5b5def6f))
(pin "2" (uuid bea015f1-354e-46e7-9d96-4f04f5d7d84a))
(pin "3" (uuid 38f6dcd3-ffaf-4480-b6cf-cfbb7d9aba9d))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4"
(reference "U6") (unit 1)
)
)
)
)
(symbol (lib_id "TEST_LIB:TEST_STACKED") (at 119.38 59.69 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid e925c8ad-ec08-437c-834b-98d5bc471e84)
(property "Reference" "U2" (at 120.015 57.15 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "~" (at 119.38 59.69 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 119.38 59.69 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 119.38 59.69 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 0e7a9c4e-e979-44b2-b904-65e21afb5779))
(pin "2" (uuid 0f12dc80-1acd-4d1e-9883-22ce48b9eb6b))
(pin "3" (uuid 7204e611-7050-455c-8d27-6a186da1d837))
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4"
(reference "U2") (unit 1)
)
)
)
)
(sheet (at 153.67 105.41) (size 22.86 16.51) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid 701adb8c-f139-4a93-a927-02c9f06ca5b2)
(property "Sheetname" "sub3" (at 153.67 104.6984 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "sub3.kicad_sch" (at 153.67 122.5046 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(pin "PIN" input (at 153.67 114.3 180)
(effects (font (size 1.27 1.27)) (justify left))
(uuid 4db36034-f9ea-414f-a718-0402802bbcc3)
)
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4" (page "4"))
)
)
)
(sheet (at 153.67 77.47) (size 22.86 16.51) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid ac073b00-33b3-4c40-9adc-0d2ac39cf8ef)
(property "Sheetname" "sub2" (at 153.67 76.7584 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "sub2.kicad_sch" (at 153.67 94.5646 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(pin "PIN" input (at 153.67 86.36 180)
(effects (font (size 1.27 1.27)) (justify left))
(uuid e35bc939-d9f6-4831-8f7d-d7cc2b568d2d)
)
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4" (page "3"))
)
)
)
(sheet (at 153.67 45.72) (size 22.86 21.59) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid fa05dc48-d19c-4e83-a3cd-8e95fa1e59b1)
(property "Sheetname" "sub1" (at 153.67 45.0084 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "sub1.kicad_sch" (at 153.67 67.8946 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(pin "PIN" input (at 153.67 57.15 180)
(effects (font (size 1.27 1.27)) (justify left))
(uuid 5a59ad3b-e59e-43b0-9ab5-562a58f92215)
)
(instances
(project "test_hier_no_connect"
(path "/a68fb8f1-2acf-4e52-8498-fd8a9cae28e4" (page "2"))
)
)
)
(sheet_instances
(path "/" (page "1"))
)
)

View File

@ -0,0 +1,159 @@
(export (version "E")
(design
(source "kicad/qa/data/eeschema/netlists/test_hier_no_connect/test_hier_no_connect.kicad_sch")
(date "Wednesday, 01 February 2023 at 18:05:03")
(tool "Eeschema (7.0.0-rc2-161-g66f99598d1)")
(sheet (number "1") (name "/") (tstamps "/")
(title_block
(title)
(company)
(rev)
(date)
(source "test_hier_no_connect.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 "/sub1/") (tstamps "/fa05dc48-d19c-4e83-a3cd-8e95fa1e59b1/")
(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 "/sub2/") (tstamps "/ac073b00-33b3-4c40-9adc-0d2ac39cf8ef/")
(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 "4") (name "/sub3/") (tstamps "/701adb8c-f139-4a93-a927-02c9f06ca5b2/")
(title_block
(title)
(company)
(rev)
(date)
(source "sub3.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 "U2")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_STACKED") (description ""))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "test_hier_no_connect.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "e925c8ad-ec08-437c-834b-98d5bc471e84"))
(comp (ref "U5")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_DOUBLE") (description ""))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "test_hier_no_connect.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "9aac22d0-4d93-4d78-b01c-00c820843aee"))
(comp (ref "U6")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_STACKED") (description ""))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "test_hier_no_connect.kicad_sch"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "c27d8823-b16a-4039-8b30-60b56b1d2929"))
(comp (ref "U3")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_STACKED") (description ""))
(property (name "Sheetname") (value "sub1"))
(property (name "Sheetfile") (value "sub1.kicad_sch"))
(sheetpath (names "/sub1/") (tstamps "/fa05dc48-d19c-4e83-a3cd-8e95fa1e59b1/"))
(tstamps "a7ece548-fdfc-4869-9739-000253755521"))
(comp (ref "U1")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_SINGLE") (description ""))
(property (name "Sheetname") (value "sub2"))
(property (name "Sheetfile") (value "sub2.kicad_sch"))
(sheetpath (names "/sub2/") (tstamps "/ac073b00-33b3-4c40-9adc-0d2ac39cf8ef/"))
(tstamps "4de6e629-b0b3-4928-9859-b3e6bfe3cfc6"))
(comp (ref "U4")
(value "~")
(libsource (lib "TEST_LIB") (part "TEST_DOUBLE") (description ""))
(property (name "Sheetname") (value "sub3"))
(property (name "Sheetfile") (value "sub3.kicad_sch"))
(sheetpath (names "/sub3/") (tstamps "/701adb8c-f139-4a93-a927-02c9f06ca5b2/"))
(tstamps "e7a02164-c941-4fff-917a-609c220ed064")))
(libparts
(libpart (lib "TEST_LIB") (part "TEST_DOUBLE")
(fields
(field (name "Reference") "U"))
(pins
(pin (num "1") (name "PIN1") (type "input"))
(pin (num "2") (name "PIN2") (type "input"))))
(libpart (lib "TEST_LIB") (part "TEST_SINGLE")
(fields
(field (name "Reference") "U"))
(pins
(pin (num "1") (name "PIN") (type "input"))))
(libpart (lib "TEST_LIB") (part "TEST_STACKED")
(fields
(field (name "Reference") "U2")
(field (name "Value") "~"))
(pins
(pin (num "1") (name "PIN") (type "passive"))
(pin (num "2") (name "PIN") (type "passive"))
(pin (num "3") (name "NC") (type "no_connect")))))
(libraries
(library (logical "TEST_LIB")
(uri "kicad/qa/data/eeschema/netlists/test_hier_no_connect/TEST_LIB.kicad_sym")))
(nets
(net (code "1") (name "/sub1/PIN")
(node (ref "U3") (pin "1") (pinfunction "PIN") (pintype "passive+no_connect"))
(node (ref "U3") (pin "2") (pinfunction "PIN") (pintype "passive+no_connect")))
(net (code "2") (name "/sub2/PIN")
(node (ref "U1") (pin "1") (pinfunction "PIN") (pintype "input+no_connect")))
(net (code "3") (name "/sub3/PIN")
(node (ref "U4") (pin "1") (pinfunction "PIN1") (pintype "input"))
(node (ref "U4") (pin "2") (pinfunction "PIN2") (pintype "input")))
(net (code "4") (name "unconnected-(U2-NC-Pad3)")
(node (ref "U2") (pin "3") (pinfunction "NC") (pintype "no_connect")))
(net (code "5") (name "unconnected-(U2-PIN-Pad1)")
(node (ref "U2") (pin "1") (pinfunction "PIN") (pintype "passive+no_connect"))
(node (ref "U2") (pin "2") (pinfunction "PIN") (pintype "passive+no_connect")))
(net (code "6") (name "unconnected-(U3-NC-Pad3)")
(node (ref "U3") (pin "3") (pinfunction "NC") (pintype "no_connect")))
(net (code "7") (name "unconnected-(U5-PIN1-Pad1)")
(node (ref "U5") (pin "1") (pinfunction "PIN1") (pintype "input"))
(node (ref "U5") (pin "2") (pinfunction "PIN2") (pintype "input")))
(net (code "8") (name "unconnected-(U6-NC-Pad3)")
(node (ref "U6") (pin "3") (pinfunction "NC") (pintype "no_connect")))
(net (code "9") (name "unconnected-(U6-PIN-Pad1)")
(node (ref "U6") (pin "1") (pinfunction "PIN") (pintype "passive+no_connect"))
(node (ref "U6") (pin "2") (pinfunction "PIN") (pintype "passive+no_connect")))))

View File

@ -85,6 +85,7 @@ public:
// The two nets at the same index should be identical
BOOST_REQUIRE_EQUAL( goldenNet.GetNetName(), testNet.GetNetName() );
BOOST_REQUIRE_EQUAL( goldenNet.GetPinName(), testNet.GetPinName() );
BOOST_REQUIRE_EQUAL( goldenNet.GetPinType(), testNet.GetPinType() );
}
}
}
@ -172,4 +173,10 @@ BOOST_AUTO_TEST_CASE( BusEntries )
}
BOOST_AUTO_TEST_CASE( HierNoConnect )
{
TestNetlist( "test_hier_no_connect" );
}
BOOST_AUTO_TEST_SUITE_END()