Seabreeze : new class Delay for the result

This commit is contained in:
HoangAnhP 2022-07-21 12:03:52 +02:00
parent 555f6ea6a4
commit bf181787cb
2 changed files with 59 additions and 8 deletions

51
Seabreeze/src/Delay.cpp Normal file
View File

@ -0,0 +1,51 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) SU 2022-2022, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | S e a b r e e z e - Timing Analysis |
// | |
// | Author : Vu Hoang Anh PHAM |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./seabreeze/Delay.h" |
// +-----------------------------------------------------------------+
#pragma once
#include <map>
#include <iostream>
#include "hurricane/RoutingPad.h"
#include "seabreeze/Delay.h"
using namespace std;
namespace Seabreeze {
using Hurricane::RoutingPad;
//---------------------------------------------------------
// Class : Seabreeze::Delay
Delay::Delay()
: _values()
{}
Delay::~Delay()
{}
void Delay::addPair ( RoutingPad* driver, RoutingPad* sink, double delay)
{
if ( _values.count(driver) > 0 ) {
cerr << "Driver already exist." << endl
<< "If you want to add value, please use the function addValue( RoutingPad*, RoutingPad*, double)" << endl
<< "Example : addValue(driver, sink, delay)" << endl;
}
else {
map<RoutingPad*, double> val { {sink, delay}, };
_values.insert(driver, val);
}
}
}

View File

@ -17,9 +17,7 @@
#pragma once
#include <map>
#include <iostream>
#include "hurricane/Contact.h"
#include "hurricane/RoutingPad.h"
#include "hurricane/Component.h"
using namespace std;
@ -32,14 +30,16 @@ namespace Seabreeze {
class Delay {
public:
Delay ();
~Delay ();
inline const void getValue ( RoutingPad* );
inline void addPair ( RoutingPad*, RoutingPad*, double );
inline void addValue ( RoutingPad*, RoutingPad*, double );
inline void printDelays ();
Delay ();
~Delay ();
inline const map<RoutingPad*, map<RoutingPad*, double>>& getValues () const ;
void addPair ( RoutingPad*, RoutingPad*, double );
void addValue ( RoutingPad*, RoutingPad*, double );
void printDelays ();
private:
map<RoutingPad*, map<RoutingPad*, double>> _values;
};
inline const map<RoutingPad*, map<RoutingPad*, double>>& Delay::getValues () const { return _values; }
}