drc: report from-to paths for length matched signals

This commit is contained in:
Tomasz Wlostowski 2020-09-26 22:42:56 +02:00
parent adf7d3260d
commit 9b4504e73f
1 changed files with 31 additions and 17 deletions

View File

@ -3,22 +3,18 @@
* *
* Copyright (C) 2004-2020 KiCad Developers. * Copyright (C) 2004-2020 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software: you can redistribute it and/or modify it
* modify it under the terms of the GNU General Public License * under the terms of the GNU General Public License as published by the
* as published by the Free Software Foundation; either version 2 * Free Software Foundation, either version 3 of the License, or (at your
* of the License, or (at your option) any later version. * option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful, but
* but WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, you may find one here: * with this program. If not, see <http://www.gnu.org/licenses/>.
* 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
*/ */
#include <common.h> #include <common.h>
@ -44,6 +40,7 @@
- DRCE_LENGTH_OUT_OF_RANGE - DRCE_LENGTH_OUT_OF_RANGE
- DRCE_SKEW_OUT_OF_RANGE - DRCE_SKEW_OUT_OF_RANGE
- DRCE_TOO_MANY_VIAS - DRCE_TOO_MANY_VIAS
Todo: arc support
*/ */
namespace test { namespace test {
@ -266,7 +263,9 @@ bool test::DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode
return true; return true;
}; };
m_board->GetConnectivity()->GetFromToCache()->Rebuild( m_board ); auto ftCache = m_board->GetConnectivity()->GetFromToCache();
ftCache->Rebuild( m_board );
forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T }, forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T },
LSET::AllCuMask(), evaluateLengthConstraints ); LSET::AllCuMask(), evaluateLengthConstraints );
@ -315,6 +314,19 @@ bool test::DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode
ent.total = ent.totalRoute + ent.totalVia + ent.totalPadToDie; ent.total = ent.totalRoute + ent.totalVia + ent.totalPadToDie;
ent.matchingRule = it.first; ent.matchingRule = it.first;
// fixme: doesn't seem to work ;-)
auto ftPath = ftCache->QueryFromToPath( ent.items );
if( ftPath )
{
ent.from = ftPath->fromName;
ent.to = ftPath->toName;
}
else
{
ent.from = ent.to = _("<unconstrained>");
}
m_report.Add( ent ); m_report.Add( ent );
matches[ it.first ].push_back(ent); matches[ it.first ].push_back(ent);
} }
@ -336,11 +348,13 @@ bool test::DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode
reportAux( wxString::Format( _("Length-constrained traces for rule '%s':"), it.first->m_Name ) ); reportAux( wxString::Format( _("Length-constrained traces for rule '%s':"), it.first->m_Name ) );
for( const auto& ent : matchedConnections ) for( auto& ent : matchedConnections )
{ {
reportAux(wxString::Format( reportAux(wxString::Format(
" - net %s: %d matching items, total: %s (tracks: %s, vias: %s, pad-to-die: %s), vias: %d", " - net: %s, from: %s, to: %s, %d matching items, total: %s (tracks: %s, vias: %s, pad-to-die: %s), vias: %d",
ent.netname, ent.netname,
ent.from,
ent.to,
(int) ent.items.size(), (int) ent.items.size(),
MessageTextFromValue( userUnits(), ent.total, true ), MessageTextFromValue( userUnits(), ent.total, true ),
MessageTextFromValue( userUnits(), ent.totalRoute, true ), MessageTextFromValue( userUnits(), ent.totalRoute, true ),