KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_net_chain_bridging_delay_tuning_profiles.cpp
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#include <boost/test/unit_test.hpp>
22
24#include <board.h>
26#include <net_chain_bridging.h>
28
29
30BOOST_AUTO_TEST_SUITE( NetChainBridgingDelayTuningProfiles );
31
32BOOST_AUTO_TEST_CASE( ZeroBridgingDelay )
33{
34 SETTINGS_MANAGER settingsManager;
35 std::unique_ptr<BOARD> board;
36 KI_TEST::LoadBoard( settingsManager, "net_chain_bridging_tuning_profiles", board );
37
38 auto [len_1, delay_1] = BoardChainBridging( board.get(), wxS( "CHAIN_1" ) );
39 BOOST_CHECK_CLOSE( len_1, 3300000.0, 0.01 );
40 BOOST_CHECK_CLOSE( delay_1, 0.0, 0.01 );
41
42 auto [len_2, delay_2] = BoardChainBridging( board.get(), wxS( "CHAIN_2" ) );
43 BOOST_CHECK_CLOSE( len_2, 3300000.0, 0.01 );
44 BOOST_CHECK_CLOSE( delay_2, 3300000.0, 0.01 );
45}
46
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
std::tuple< double, double > BoardChainBridging(const BOARD *aBoard, const wxString &aNetChain, const double aDefaultBridgeUnitDelay)
Compute both the chain bridging length and its associated propagation delay (in internal delay IU,...
BOOST_AUTO_TEST_CASE(ZeroBridgingDelay)
BOOST_AUTO_TEST_SUITE(NetChainBridgingDelayTuningProfiles)
BOOST_AUTO_TEST_SUITE_END()