2009-07-07 17:50:02 +00:00
|
|
|
/*
|
2011-09-30 18:15:37 +00:00
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
2009-07-07 17:50:02 +00:00
|
|
|
*
|
2015-08-31 11:09:47 +00:00
|
|
|
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2020-10-07 13:15:31 +00:00
|
|
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
2020-03-16 11:05:01 +00:00
|
|
|
* Copyright (C) 2009-2020 KiCad Developers, see change_log.txt for contributors.
|
2009-07-07 17:50:02 +00:00
|
|
|
*
|
|
|
|
* 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 2
|
|
|
|
* 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 here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file erc.h
|
|
|
|
*/
|
|
|
|
|
2009-07-07 17:50:02 +00:00
|
|
|
#ifndef _ERC_H
|
|
|
|
#define _ERC_H
|
|
|
|
|
2020-07-03 21:08:17 +00:00
|
|
|
#include <erc_settings.h>
|
|
|
|
|
2010-11-11 21:10:27 +00:00
|
|
|
|
|
|
|
class NETLIST_OBJECT;
|
2013-09-27 12:30:35 +00:00
|
|
|
class NETLIST_OBJECT_LIST;
|
2018-01-19 15:12:36 +00:00
|
|
|
class SCH_SHEET_LIST;
|
2020-05-13 02:00:37 +00:00
|
|
|
class SCHEMATIC;
|
2021-02-22 23:47:17 +00:00
|
|
|
class DS_PROXY_VIEW_ITEM;
|
2020-05-28 13:36:54 +00:00
|
|
|
|
2009-07-07 17:50:02 +00:00
|
|
|
|
2014-01-18 09:07:05 +00:00
|
|
|
extern const wxString CommentERC_H[];
|
|
|
|
extern const wxString CommentERC_V[];
|
2009-07-07 17:50:02 +00:00
|
|
|
|
2020-07-03 21:08:17 +00:00
|
|
|
|
|
|
|
class ERC_TESTER
|
2019-03-11 21:32:05 +00:00
|
|
|
{
|
2020-07-03 21:08:17 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
ERC_TESTER( SCHEMATIC* aSchematic ) :
|
|
|
|
m_schematic( aSchematic )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Perform ERC testing for electrical conflicts between \a NetItemRef and other items
|
|
|
|
* (mainly pin) on the same net.
|
2020-10-07 13:15:31 +00:00
|
|
|
*
|
2020-07-03 21:08:17 +00:00
|
|
|
* @param aList = a reference to the list of connected objects
|
|
|
|
* @param aNetItemRef = index in list of the current object
|
|
|
|
* @param aNetStart = index in list of net objects of the first item
|
|
|
|
* @param aMinConnexion = a pointer to a variable to store the minimal connection
|
|
|
|
* found( NOD, DRV, NPI, NET_NC)
|
|
|
|
*/
|
|
|
|
void TestOthersItems( NETLIST_OBJECT_LIST* aList, unsigned aNetItemRef, unsigned aNetStart,
|
|
|
|
int* aMinConnexion );
|
|
|
|
|
|
|
|
/**
|
2020-10-07 13:15:31 +00:00
|
|
|
* Inside a given sheet, one cannot have sheets with duplicate names (file
|
2020-07-03 21:08:17 +00:00
|
|
|
* names can be duplicated).
|
2020-10-07 13:15:31 +00:00
|
|
|
*
|
2020-07-03 21:08:17 +00:00
|
|
|
* @return the error count
|
|
|
|
* @param aCreateMarker: true = create error markers in schematic,
|
|
|
|
* false = calculate error count only
|
|
|
|
*/
|
|
|
|
int TestDuplicateSheetNames( bool aCreateMarker );
|
|
|
|
|
|
|
|
/**
|
2020-10-07 13:15:31 +00:00
|
|
|
* Check for any unresolved text variable references.
|
2020-07-03 21:08:17 +00:00
|
|
|
*/
|
2021-02-22 23:47:17 +00:00
|
|
|
void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
|
2020-07-03 21:08:17 +00:00
|
|
|
|
|
|
|
/**
|
2020-10-07 13:15:31 +00:00
|
|
|
* Check that there are no conflicting bus alias definitions in the schematic.
|
2020-07-03 21:08:17 +00:00
|
|
|
*
|
|
|
|
* (for example, two hierarchical sub-sheets contain different definitions for
|
|
|
|
* the same bus alias)
|
|
|
|
*
|
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestConflictingBusAliases();
|
|
|
|
|
|
|
|
/**
|
2021-05-05 21:41:51 +00:00
|
|
|
* Test if all units of each multiunit symbol have the same footprint assigned.
|
2020-07-03 21:08:17 +00:00
|
|
|
* @return The error count.
|
|
|
|
*/
|
|
|
|
int TestMultiunitFootprints();
|
|
|
|
|
2020-07-07 00:10:08 +00:00
|
|
|
/**
|
|
|
|
* In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
|
|
|
|
* In KiCad 6, this no longer results in those pins joining the net, so we need to warn about it
|
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestNoConnectPins();
|
|
|
|
|
2020-08-30 19:25:31 +00:00
|
|
|
/**
|
|
|
|
* Checks the full netlist against the pin-to-pin connectivity requirements
|
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestPinToPin();
|
|
|
|
|
|
|
|
/**
|
2021-05-05 21:41:51 +00:00
|
|
|
* Checks if shared pins on multi-unit symbols have been connected to different nets
|
2020-08-30 19:25:31 +00:00
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestMultUnitPinConflicts();
|
|
|
|
|
2020-08-30 19:42:46 +00:00
|
|
|
/**
|
|
|
|
* Checks for labels that differ only in capitalization
|
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestSimilarLabels();
|
|
|
|
|
2020-10-07 13:15:31 +00:00
|
|
|
/**
|
|
|
|
* Test symbols for changed library symbols and broken symbol library links.
|
|
|
|
* @return the number of issues found
|
|
|
|
*/
|
|
|
|
int TestLibSymbolIssues();
|
|
|
|
|
2022-03-17 20:23:14 +00:00
|
|
|
/**
|
|
|
|
* Test pins and wire ends for being off grid.
|
|
|
|
* @return the error count
|
|
|
|
*/
|
|
|
|
int TestOffGridEndpoints( int aGridSize );
|
|
|
|
|
2022-11-07 12:27:58 +00:00
|
|
|
/**
|
|
|
|
* Test SPICE models for various issues.
|
|
|
|
*/
|
|
|
|
int TestSimModelIssues();
|
|
|
|
|
2020-07-03 21:08:17 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
SCHEMATIC* m_schematic;
|
2019-03-11 21:32:05 +00:00
|
|
|
};
|
2009-07-07 17:50:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif // _ERC_H
|