#include "PlacedIpCore.h"

namespace cosi {

namespace environment {

namespace onchipcommunication {

using namespace std ;

PlacedIpCore::PlacedIpCore( ) : IpCore( )
{
    mXbl = mYbl = mXtr = mYtr = 0.0 ;
}

PlacedIpCore::PlacedIpCore( string Name ) : IpCore( Name )
{
    mXbl = mYbl = mXtr = mYtr = 0.0 ;
}

PlacedIpCore::PlacedIpCore( string Name , double Xbl , double Ybl ,double Xtr , double Ytr) : IpCore( Name , (Xtr - Xbl) * (Ytr - Ybl) )
{
    mXbl = Xbl ;
    mXtr = Xtr ;
    mYbl = Ybl ;
    mYtr = Ytr ;


}

double PlacedIpCore::GetBottomLeftX( )
{
    return mXbl ;
}
void PlacedIpCore::SetBottomLeftX( double X )
{
    mXbl = 	X ;
    SetArea( (mXtr - mXbl) * (mYtr - mYbl) );
}

double PlacedIpCore::GetTopRightX( )
{
    return mXtr ;
}

void PlacedIpCore::SetTopRightX( double X )
{
    mXtr = X ;
    SetArea( (mXtr - mXbl) * (mYtr - mYbl) );
}

double PlacedIpCore::GetBottomLeftY( )
{
    return mYbl ;
}
void PlacedIpCore::SetBottomLeftY( double Y )
{
    mYbl = 	Y ;
    SetArea( (mXtr - mXbl) * (mYtr - mYbl) );
}

double PlacedIpCore::GetTopRightY( )
{
    return mYtr ;
}

void PlacedIpCore::SetTopRightY( double Y )
{
    mYtr = Y ;
    SetArea( (mXtr - mXbl) * (mYtr - mYbl) );
}
}
}
}

