diff --git a/Seabreeze/src/CMakeLists.txt b/Seabreeze/src/CMakeLists.txt index e75357dc..7865963c 100644 --- a/Seabreeze/src/CMakeLists.txt +++ b/Seabreeze/src/CMakeLists.txt @@ -21,6 +21,7 @@ Tree.cpp Elmore.cpp SeabreezeEngine.cpp + Delay.cpp #GraphicSeabreezeEngine.cpp ) set( pyCpps PySeabreeze.cpp diff --git a/Seabreeze/src/Delay.cpp b/Seabreeze/src/Delay.cpp index 6c9cb254..8434ea40 100644 --- a/Seabreeze/src/Delay.cpp +++ b/Seabreeze/src/Delay.cpp @@ -14,7 +14,6 @@ // +-----------------------------------------------------------------+ -#pragma once #include #include #include "hurricane/RoutingPad.h" @@ -39,13 +38,34 @@ namespace Seabreeze { void Delay::addPair ( RoutingPad* driver, RoutingPad* sink, double delay) { if ( _values.count(driver) > 0 ) { - cerr << "Driver already exist." << endl + cerr << "Driver " << driver << " already exists." << endl << "If you want to add value, please use the function addValue( RoutingPad*, RoutingPad*, double)" << endl << "Example : addValue(driver, sink, delay)" << endl; } else { map val { {sink, delay}, }; - _values.insert(driver, val); + _values.insert({driver, val}); + } + } + + void Delay::addValue ( RoutingPad* driver, RoutingPad* sink, double delay ) + { + if ( _values[driver].count(sink) > 0 ) { + cerr << "Delay from " << driver << " to " << sink << " is already computed" << endl; + } + else { + _values[driver].insert({sink, delay}); + } + } + + void Delay::printDelays () + { + for ( auto dmap : _values ) { + cerr << "Delay from : " << dmap.first << " to :" << endl; + map& val = dmap.second; + for ( auto smap : val ) { + cerr << smap.first << " : " << smap.second << endl; + } } } }