KiCad PCB EDA Suite
erc.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2009-2015 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #ifndef _ERC_H
31 #define _ERC_H
32 
33 
34 class NETLIST_OBJECT;
36 class SCH_SHEET_LIST;
37 
38 /* For ERC markers: error types (used in diags, and to set the color):
39 */
41 {
42  OK = 0,
43  WAR, // Error: severity = warning
44  ERR, // Error: severity = error
45  UNC // Error: unconnected pin
46 };
47 
48 extern const wxString CommentERC_H[];
49 extern const wxString CommentERC_V[];
50 
52 #define ERCE_UNSPECIFIED 0
53 #define ERCE_DUPLICATE_SHEET_NAME 1 // duplicate sheet names within a given sheet
54 #define ERCE_PIN_NOT_CONNECTED 2 // pin not connected and not no connect symbol
55 #define ERCE_PIN_NOT_DRIVEN 3 // pin connected to some others pins but no pin to drive it
56 #define ERCE_PIN_TO_PIN_WARNING 4 // pin connected to another pin: warning level
57 #define ERCE_PIN_TO_PIN_ERROR 5 // pin connected to another pin: error level
58 #define ERCE_HIERACHICAL_LABEL 6 // mismatch between hierarchical labels and pins sheets
59 #define ERCE_NOCONNECT_CONNECTED 7 // a no connect symbol is connected to more than 1 pin
60 #define ERCE_GLOBLABEL 8 // global label not connected to any other global label
61 #define ERCE_SIMILAR_LABELS 9 // 2 labels are equal fir case insensitive comparisons
62 #define ERCE_SIMILAR_GLBL_LABELS 10 // 2 labels are equal fir case insensitive comparisons
63 #define ERCE_DIFFERENT_UNIT_FP 11 // different units of the same component have different
64  // footprints assigned
65 #define ERCE_DIFFERENT_UNIT_NET 12 // a shared pin in a multi-unit component is connected
66  // to more than one net
67 
68 /* Minimal connection table */
69 #define NPI 4 // Net with Pin isolated, this pin has type Not Connected and must be left N.C.
70 #define DRV 3 // Net driven by a signal (a pin output for instance)
71 #define NET_NC 2 // Net "connected" to a "NoConnect symbol"
72 #define NOD 1 // Net not driven ( Such as 2 or more connected inputs )
73 #define NOC 0 // initial state of a net: no connection
74 
75 
82 bool WriteDiagnosticERC( EDA_UNITS_T aUnits, const wxString& aFullFileName );
83 
89 void Diagnose( NETLIST_OBJECT* NetItemRef, NETLIST_OBJECT* NetItemTst,
90  int MinConnexion, int Diag );
91 
102  unsigned aNetItemRef, unsigned aNetStart,
103  int* aMinConnexion );
104 
113 int TestDuplicateSheetNames( bool aCreateMarker );
114 
120 int TestMultiunitFootprints( SCH_SHEET_LIST& aSheetList );
121 
122 
123 #endif // _ERC_H
Class SCH_SHEET_LIST.
Definition: erc.h:43
const wxString CommentERC_H[]
Definition: erc.cpp:87
void TestOthersItems(NETLIST_OBJECT_LIST *aList, unsigned aNetItemRef, unsigned aNetStart, int *aMinConnexion)
Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the s...
Definition: erc.cpp:430
Class NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected item...
Definition: erc.h:42
Definition: erc.h:44
int TestMultiunitFootprints(SCH_SHEET_LIST &aSheetList)
Test if all units of each multiunit component have the same footprint assigned.
Definition: erc.cpp:228
bool WriteDiagnosticERC(EDA_UNITS_T aUnits, const wxString &aFullFileName)
Function WriteDiagnosticERC save the ERC errors to aFullFileName.
Definition: erc.cpp:583
Definition: erc.h:45
const wxString CommentERC_V[]
Definition: erc.cpp:103
int TestDuplicateSheetNames(bool aCreateMarker)
Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names...
Definition: erc.cpp:177
errortype
Definition: erc.h:40
void Diagnose(NETLIST_OBJECT *NetItemRef, NETLIST_OBJECT *NetItemTst, int MinConnexion, int Diag)
Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNe...
Definition: erc.cpp:294
EDA_UNITS_T
Definition: common.h:159