@ -47,12 +47,13 @@
# endif
std : : vector < std : : pair < int , double > > SimplifyBitSequence ( std : : vector < std : : pair < int , double > > bits )
std : : vector < std : : pair < int , double > >
SimplifyBitSequence ( const std : : vector < std : : pair < int , double > > & bits )
{
std : : vector < std : : pair < int , double > > result ;
int prevbit = - 1 ;
for ( std : : pair < int , double > bit : bits )
for ( const std : : pair < int , double > & bit : bits )
{
if ( prevbit ! = bit . first )
result . push_back ( bit ) ;
@ -89,8 +90,8 @@ IBIS_CORNER ReverseLogic( IBIS_CORNER aIn )
return out ;
}
KIBIS : : KIBIS ( std : : string aFileName , REPORTER * aReporter ) :
KIBIS_ANY ( this , aReporter ) , m_file ( this )
KIBIS : : KIBIS ( const std : : string & aFileName , REPORTER * aReporter ) :
KIBIS_ANY ( this , aReporter ) , m_file ( * this )
{
IbisParser parser ( m_reporter ) ;
bool status = true ;
@ -98,32 +99,28 @@ KIBIS::KIBIS( std::string aFileName, REPORTER* aReporter ) :
parser . m_parrot = false ;
status & = parser . ParseFile ( aFileName ) ;
status & = m_file . Init ( parser ) ;
for ( IbisModel & iModel : parser . m_ibisFile . m_models )
for ( const IbisModel & iModel : parser . m_ibisFile . m_models )
{
KIBIS_MODEL kModel ( this , iModel , parser ) ;
KIBIS_MODEL & kModel = m_models . emplace_back ( * this , iModel , parser ) ;
status & = kModel . m_valid ;
m_models . push_back ( kModel ) ;
}
for ( IbisComponent & iComponent : parser . m_ibisFile . m_components )
for ( const IbisComponent & iComponent : parser . m_ibisFile . m_components )
{
KIBIS_COMPONENT kComponent ( this , iComponent , parser ) ;
KIBIS_COMPONENT & kComponent = m_components . emplace_back ( * this , iComponent , parser ) ;
status & = kComponent . m_valid ;
m_components . push_back ( kComponent ) ;
for ( KIBIS_PIN & pin : m_components . back ( ) . m_pins )
for ( KIBIS_PIN & pin : kComponent . m_pins )
{
pin . m_parent = & ( m_components . back ( ) ) ;
pin . m_parent = & kComponent ;
}
for ( IbisDiffPinEntry dpEntry : iComponent . m_diffPin . m_entries )
for ( const IbisDiffPinEntry & dpEntry : iComponent . m_diffPin . m_entries )
{
KIBIS_PIN * pinA = m_components . back ( ) . GetPin ( dpEntry . pinA ) ;
KIBIS_PIN * pinB = m_components . back ( ) . GetPin ( dpEntry . pinB ) ;
KIBIS_PIN * pinA = kComponent . GetPin ( dpEntry . pinA ) ;
KIBIS_PIN * pinB = kComponent . GetPin ( dpEntry . pinB ) ;
if ( pinA & & pinB )
{
@ -137,14 +134,14 @@ KIBIS::KIBIS( std::string aFileName, REPORTER* aReporter ) :
}
KIBIS_FILE : : KIBIS_FILE ( KIBIS * aTopLevel ) : KIBIS_ANY ( aTopLevel )
KIBIS_FILE : : KIBIS_FILE ( KIBIS & aTopLevel ) : KIBIS_ANY ( & aTopLevel )
{
m_fileRev = - 1 ;
m_ibisVersion = - 1 ;
}
bool KIBIS_FILE : : Init ( IbisParser & aParser )
bool KIBIS_FILE : : Init ( const IbisParser & aParser )
{
bool status = true ;
m_fileName = aParser . m_ibisFile . m_header . m_fileName ;
@ -161,12 +158,11 @@ bool KIBIS_FILE::Init( IbisParser& aParser )
}
KIBIS_PIN : : KIBIS_PIN ( KIBIS * aTopLevel , IbisComponentPin & aPin , IbisComponentPackage & aPackage ,
IbisParser & aParser , KIBIS_COMPONENT * aParent ,
std : : vector < KIBIS_MODEL > & aModels ) :
KIBIS_ANY ( aTopLevel ) ,
m_Rpin ( aTopLevel - > m_reporter ) , m_Lpin ( aTopLevel - > m_reporter ) ,
m_Cpin ( aTopLevel - > m_reporter )
KIBIS_PIN : : KIBIS_PIN ( KIBIS & aTopLevel , const IbisComponentPin & aPin ,
const IbisComponentPackage & aPackage , IbisParser & aParser ,
KIBIS_COMPONENT * aParent , std : : vector < KIBIS_MODEL > & aModels ) :
KIBIS_ANY ( & aTopLevel ) , m_Rpin ( aTopLevel . m_reporter ) , m_Lpin ( aTopLevel . m_reporter ) ,
m_Cpin ( aTopLevel . m_reporter )
{
m_signalName = aPin . m_signalName ;
m_pinNumber = aPin . m_pinName ;
@ -206,11 +202,11 @@ KIBIS_PIN::KIBIS_PIN( KIBIS* aTopLevel, IbisComponentPin& aPin, IbisComponentPac
bool modelSelected = false ;
std : : vector < std : : string > listOfModels ;
for ( IbisModelSelector modelSelector : aParser . m_ibisFile . m_modelSelectors )
for ( const IbisModelSelector & modelSelector : aParser . m_ibisFile . m_modelSelectors )
{
if ( ! strcmp ( modelSelector . m_name . c_str ( ) , aPin . m_modelName . c_str ( ) ) )
{
for ( IbisModelSelectorEntry model : modelSelector . m_models )
for ( const IbisModelSelectorEntry & model : modelSelector . m_models )
{
listOfModels . push_back ( model . m_modelName ) ;
}
@ -224,7 +220,7 @@ KIBIS_PIN::KIBIS_PIN( KIBIS* aTopLevel, IbisComponentPin& aPin, IbisComponentPac
listOfModels . push_back ( aPin . m_modelName ) ;
}
for ( std : : string modelName : listOfModels )
for ( const std : : string & modelName : listOfModels )
{
for ( KIBIS_MODEL & model : aModels )
{
@ -239,16 +235,16 @@ KIBIS_PIN::KIBIS_PIN( KIBIS* aTopLevel, IbisComponentPin& aPin, IbisComponentPac
}
KIBIS_MODEL : : KIBIS_MODEL ( KIBIS * aTopLevel , IbisModel & aSource , IbisParser & aParser ) :
KIBIS_ANY ( aTopLevel ) , m_C_comp ( aTopLevel - > m_reporter ) ,
m_voltageRange ( aTopLevel - > m_reporter ) , m_temperatureRange ( aTopLevel - > m_reporter ) ,
m_pullupReference ( aTopLevel - > m_reporter ) , m_pulldownReference ( aTopLevel - > m_reporter ) ,
m_GNDClampReference ( aTopLevel - > m_reporter ) ,
m_POWERClampReference ( aTopLevel - > m_reporter ) , m_Rgnd ( aTopLevel - > m_reporter ) ,
m_Rpower ( aTopLevel - > m_reporter ) , m_Rac ( aTopLevel - > m_reporter ) ,
m_Cac ( aTopLevel - > m_reporter ) , m_GNDClamp ( aTopLevel - > m_reporter ) ,
m_POWERClamp ( aTopLevel - > m_reporter ) , m_pullup ( aTopLevel - > m_reporter ) ,
m_pulldown ( aTopLevel - > m_reporter ) , m_ ramp ( aTopLevel - > m_reporter )
KIBIS_MODEL : : KIBIS_MODEL ( KIBIS & aTopLevel , const IbisModel & aSource , IbisParser & aParser ) :
KIBIS_ANY ( & aTopLevel ) , m_C_comp ( aTopLevel . m_reporter ) ,
m_voltageRange ( aTopLevel . m_reporter ) , m_temperatureRange ( aTopLevel . m_reporter ) ,
m_pullupReference ( aTopLevel . m_reporter ) , m_pulldownReference ( aTopLevel . m_reporter ) ,
m_GNDClampReference ( aTopLevel . m_reporter ) , m_POWERClampReference ( aTopLevel . m_reporter ) ,
m_Rgnd ( aTopLevel . m_reporter ) , m_Rpower ( aTopLevel . m_reporter ) ,
m_Rac ( aTopLevel . m_reporter ) , m_Cac ( aTopLevel . m_reporter ) ,
m_GNDClamp ( aTopLevel . m_reporter ) , m_POWERClamp ( aTopLevel . m_reporter ) ,
m_pullup ( aTopLevel . m_reporter ) , m_pulldown ( aTopLevel . m_reporter ) ,
m_ramp ( aTopLevel . m_reporter )
{
bool status = true ;
@ -257,9 +253,9 @@ KIBIS_MODEL::KIBIS_MODEL( KIBIS* aTopLevel, IbisModel& aSource, IbisParser& aPar
m_description = std : : string ( " No description available. " ) ;
for ( IbisModelSelector modelSelector : aParser . m_ibisFile . m_modelSelectors )
for ( const IbisModelSelector & modelSelector : aParser . m_ibisFile . m_modelSelectors )
{
for ( IbisModelSelectorEntry entry : modelSelector . m_models )
for ( const IbisModelSelectorEntry & entry : modelSelector . m_models )
{
if ( ! strcmp ( entry . m_modelName . c_str ( ) , m_name . c_str ( ) ) )
{
@ -303,16 +299,15 @@ KIBIS_MODEL::KIBIS_MODEL( KIBIS* aTopLevel, IbisModel& aSource, IbisParser& aPar
}
KIBIS_COMPONENT : : KIBIS_COMPONENT ( KIBIS * aTopLevel , IbisComponent & aSource , IbisParser & aParser ) :
KIBIS_ANY ( aTopLevel )
KIBIS_COMPONENT : : KIBIS_COMPONENT ( KIBIS & aTopLevel , const IbisComponent & aSource ,
IbisParser & aParser ) : KIBIS_ANY ( & aTopLevel )
{
bool status = true ;
m_name = aSource . m_name ;
m_manufacturer = aSource . m_manufacturer ;
m_topLevel = aTopLevel ;
for ( IbisComponentPin & iPin : aSource . m_pins )
for ( const IbisComponentPin & iPin : aSource . m_pins )
{
if ( iPin . m_dummy )
{
@ -329,7 +324,7 @@ KIBIS_COMPONENT::KIBIS_COMPONENT( KIBIS* aTopLevel, IbisComponent& aSource, Ibis
}
KIBIS_PIN * KIBIS_COMPONENT : : GetPin ( std : : string aPinNumber )
KIBIS_PIN * KIBIS_COMPONENT : : GetPin ( const std : : string & aPinNumber )
{
for ( KIBIS_PIN & pin : m_pins )
{
@ -360,10 +355,7 @@ std::vector<std::pair<IbisWaveform*, IbisWaveform*>> KIBIS_MODEL::waveformPairs(
& & wf1 - > m_V_fixture_min = = wf2 - > m_V_fixture_min
& & wf1 - > m_V_fixture_max = = wf2 - > m_V_fixture_max )
{
std : : pair < IbisWaveform * , IbisWaveform * > p ;
p . first = wf1 ;
p . second = wf2 ;
pairs . push_back ( p ) ;
pairs . emplace_back ( wf1 , wf2 ) ;
}
}
}
@ -372,7 +364,7 @@ std::vector<std::pair<IbisWaveform*, IbisWaveform*>> KIBIS_MODEL::waveformPairs(
}
std : : string KIBIS_MODEL : : SpiceDie ( KIBIS_PARAMETER & aParam , int aIndex )
std : : string KIBIS_MODEL : : SpiceDie ( const KIBIS_PARAMETER & aParam , int aIndex ) const
{
std : : string result ;
@ -445,11 +437,11 @@ std::string KIBIS_MODEL::SpiceDie( KIBIS_PARAMETER& aParam, int aIndex )
}
IbisWaveform KIBIS_MODEL : : TrimWaveform ( IbisWaveform & aIn )
IbisWaveform KIBIS_MODEL : : TrimWaveform ( const IbisWaveform & aIn ) const
{
IbisWaveform out ( aIn . m_reporter ) ;
int nbPoints = aIn . m_table . m_entries . size ( ) ;
const int nbPoints = aIn . m_table . m_entries . size ( ) ;
if ( nbPoints < 2 )
{
@ -457,9 +449,9 @@ IbisWaveform KIBIS_MODEL::TrimWaveform( IbisWaveform& aIn )
return out ;
}
double DCtyp = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : TYP ] ;
double DCmin = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : MIN ] ;
double DCmax = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : MAX ] ;
const double DCtyp = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : TYP ] ;
const double DCmin = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : MIN ] ;
const double DCmax = aIn . m_table . m_entries [ 0 ] . V . value [ IBIS_CORNER : : MAX ] ;
if ( nbPoints = = 2 )
{
@ -470,54 +462,51 @@ IbisWaveform KIBIS_MODEL::TrimWaveform( IbisWaveform& aIn )
for ( int i = 0 ; i < nbPoints ; i + + )
{
VTtableEntry entry ( out . m_reporter ) ;
const VTtableEntry & inEntry = aIn . m_table . m_entries . at ( i ) ;
VTtableEntry & outEntry = out . m_table . m_entries . emplace_back ( out . m_reporter ) ;
entry . t = aIn . m_table . m_entries . at ( i ) . t ;
entry . V . value [ IBIS_CORNER : : TYP ] = aIn . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : TYP ] ;
entry . V . value [ IBIS_CORNER : : MIN ] = aIn . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : MIN ] ;
entry . V . value [ IBIS_CORNER : : MAX ] = aIn . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : MAX ] ;
out . m_table . m_entries . push_back ( entry ) ;
out . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : TYP ] - = DCtyp ;
out . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : MIN ] - = DCmin ;
out . m_table . m_entries . at ( i ) . V . value [ IBIS_CORNER : : MAX ] - = DCmax ;
outEntry . t = inEntry . t ;
outEntry . V . value [ IBIS_CORNER : : TYP ] = inEntry . V . value [ IBIS_CORNER : : TYP ] - DCtyp ;
outEntry . V . value [ IBIS_CORNER : : MIN ] = inEntry . V . value [ IBIS_CORNER : : MIN ] - DCmin ;
outEntry . V . value [ IBIS_CORNER : : MAX ] = inEntry . V . value [ IBIS_CORNER : : MAX ] - DCmax ;
}
return out ;
}
bool KIBIS_MODEL : : HasPulldown ( )
bool KIBIS_MODEL : : HasPulldown ( ) const
{
return m_pulldown . m_entries . size ( ) > 0 ;
}
bool KIBIS_MODEL : : HasPullup ( )
bool KIBIS_MODEL : : HasPullup ( ) const
{
return m_pullup . m_entries . size ( ) > 0 ;
}
bool KIBIS_MODEL : : HasGNDClamp ( )
bool KIBIS_MODEL : : HasGNDClamp ( ) const
{
return m_GNDClamp . m_entries . size ( ) > 0 ;
}
bool KIBIS_MODEL : : HasPOWERClamp ( )
bool KIBIS_MODEL : : HasPOWERClamp ( ) const
{
return m_POWERClamp . m_entries . size ( ) > 0 ;
}
std : : string KIBIS_MODEL : : generateSquareWave ( std : : string aNode1 , std : : string aNode2 ,
std : : vector < std : : pair < int , double > > aBits ,
std : : pair < IbisWaveform * , IbisWaveform * > aPair ,
KIBIS_PARAMETER & aParam )
std : : string KIBIS_MODEL : : generateSquareWave ( const std : : string & aNode1 , const std : : string & aNode2 ,
const std : : vector < std : : pair < int , double > > & aBits ,
const std : : pair < IbisWaveform * , IbisWaveform * > & aPair ,
const KIBIS_PARAMETER & aParam )
{
IBIS_CORNER supply = aParam . m_supply ;
std : : string simul ;
std : : vector < int > stimuliIndex ;
const IBIS_CORNER supply = aParam . m_supply ;
std : : string simul ;
std : : vector < int > stimuliIndex ;
IbisWaveform risingWF = TrimWaveform ( * ( aPair . first ) ) ;
IbisWaveform fallingWF = TrimWaveform ( * ( aPair . second ) ) ;
@ -535,7 +524,7 @@ std::string KIBIS_MODEL::generateSquareWave( std::string aNode1, std::string aNo
int prevBit = 2 ;
for ( std : : pair < int , double > bit : aBits )
for ( const std : : pair < int , double > & bit : aBits )
{
IbisWaveform * WF ;
double timing = bit . second ;
@ -571,7 +560,7 @@ std::string KIBIS_MODEL::generateSquareWave( std::string aNode1, std::string aNo
simul + = " \n + " ;
}
for ( VTtableEntry & entry : WF - > m_table . m_entries )
for ( const VTtableEntry & entry : WF - > m_table . m_entries )
{
simul + = doubleToString ( entry . t + timing ) ;
simul + = " " ;
@ -614,9 +603,9 @@ std::string KIBIS_MODEL::generateSquareWave( std::string aNode1, std::string aNo
}
std : : string KIBIS_PIN : : addDie ( KIBIS_MODEL & aModel , KIBIS_PARAMETER & aParam , int aIndex )
std : : string KIBIS_PIN : : addDie ( KIBIS_MODEL & aModel , const KIBIS_PARAMETER & aParam , int aIndex )
{
IBIS_CORNER supply = aParam . m_supply ;
const IBIS_CORNER supply = aParam . m_supply ;
std : : string simul ;
std : : string GC_GND = " GC_GND " ;
@ -666,9 +655,9 @@ std::string KIBIS_PIN::addDie( KIBIS_MODEL& aModel, KIBIS_PARAMETER& aParam, int
}
void KIBIS_PIN : : getKuKdFromFile ( std : : string * aSimul )
void KIBIS_PIN : : getKuKdFromFile ( const std : : string & aSimul )
{
std : : string outputFileName = m_topLevel - > m_cacheDir + " temp_output.spice " ;
const std : : string outputFileName = m_topLevel - > m_cacheDir + " temp_output.spice " ;
if ( std : : remove ( outputFileName . c_str ( ) ) )
{
@ -683,7 +672,7 @@ void KIBIS_PIN::getKuKdFromFile( std::string* aSimul )
return ;
}
ng - > Init ( ) ;
ng - > LoadNetlist ( * aSimul ) ;
ng - > LoadNetlist ( aSimul ) ;
std : : ifstream KuKdfile ;
KuKdfile . open ( outputFileName ) ;
@ -746,9 +735,9 @@ void KIBIS_PIN::getKuKdFromFile( std::string* aSimul )
}
std : : string KIBIS_PIN : : KuKdDriver ( KIBIS_MODEL & aModel ,
std : : pair < IbisWaveform * , IbisWaveform * > aPair ,
KIBIS_PARAMETER & aParam , int aIndex )
std : : string KIBIS_PIN : : KuKdDriver ( KIBIS_MODEL & aModel ,
const std : : pair < IbisWaveform * , IbisWaveform * > & aPair ,
const KIBIS_PARAMETER & aParam , int aIndex )
{
IBIS_CORNER supply = aParam . m_supply ;
IBIS_CORNER ccomp = aParam . m_Ccomp ;
@ -779,8 +768,8 @@ std::string KIBIS_PIN::KuKdDriver( KIBIS_MODEL& aMode
simul + = doubleToString ( aModel . m_C_comp . value [ ccomp ] ) ; //@TODO: Check the corner ?
simul + = " \n " ;
IbisWaveform * risingWF = aPair . first ;
IbisWaveform * fallingWF = aPair . second ;
const IbisWaveform * risingWF = aPair . first ;
const IbisWaveform * fallingWF = aPair . second ;
switch ( wave - > GetType ( ) )
{
@ -795,7 +784,7 @@ std::string KIBIS_PIN::KuKdDriver( KIBIS_MODEL& aMode
}
case KIBIS_WAVEFORM_TYPE : : STUCK_HIGH :
{
IbisWaveform * waveform = wave - > inverted ? risingWF : fallingWF ;
const IbisWaveform * waveform = wave - > inverted ? risingWF : fallingWF ;
simul + = " Vsig DIE0 GND " ;
simul + = doubleToString ( waveform - > m_table . m_entries . at ( 0 ) . V . value [ supply ] ) ;
simul + = " \n " ;
@ -803,7 +792,7 @@ std::string KIBIS_PIN::KuKdDriver( KIBIS_MODEL& aMode
}
case KIBIS_WAVEFORM_TYPE : : STUCK_LOW :
{
IbisWaveform * waveform = wave - > inverted ? fallingWF : risingWF ;
const IbisWaveform * waveform = wave - > inverted ? fallingWF : risingWF ;
simul + = " Vsig DIE0 GND " ;
simul + = doubleToString ( waveform - > m_table . m_entries . at ( 0 ) . V . value [ supply ] ) ;
simul + = " \n " ;
@ -820,12 +809,12 @@ std::string KIBIS_PIN::KuKdDriver( KIBIS_MODEL& aMode
}
void KIBIS_PIN : : getKuKdOneWaveform ( KIBIS_MODEL & aModel ,
std : : pair < IbisWaveform * , IbisWaveform * > aPair ,
KIBIS_PARAMETER & aParam )
void KIBIS_PIN : : getKuKdOneWaveform ( KIBIS_MODEL & aModel ,
const std : : pair < IbisWaveform * , IbisWaveform * > & aPair ,
const KIBIS_PARAMETER & aParam )
{
IBIS_CORNER supply = aParam . m_supply ;
KIBIS_WAVEFORM * wave = aParam . m_waveform ;
IBIS_CORNER supply = aParam . m_supply ;
const KIBIS_WAVEFORM * wave = aParam . m_waveform ;
std : : string simul = " " ;
@ -924,16 +913,16 @@ void KIBIS_PIN::getKuKdOneWaveform( KIBIS_MODEL& aMod
simul + = " .endc \n " ;
simul + = " .end \n " ;
getKuKdFromFile ( & simul ) ;
getKuKdFromFile ( simul ) ;
}
}
void KIBIS_PIN : : getKuKdNoWaveform ( KIBIS_MODEL & aModel , KIBIS_PARAMETER & aParam )
void KIBIS_PIN : : getKuKdNoWaveform ( KIBIS_MODEL & aModel , const KIBIS_PARAMETER & aParam )
{
std : : vector < double > ku , kd , t ;
KIBIS_WAVEFORM * wave = aParam . m_waveform ;
IBIS_CORNER & supply = aParam . m_supply ;
std : : vector < double > ku , kd , t ;
const KIBIS_WAVEFORM * wave = aParam . m_waveform ;
const IBIS_CORNER & supply = aParam . m_supply ;
if ( ! wave )
{
@ -949,7 +938,7 @@ void KIBIS_PIN::getKuKdNoWaveform( KIBIS_MODEL& aModel, KIBIS_PARAMETER& aParam
std : : vector < std : : pair < int , double > > bits = wave - > GenerateBitSequence ( ) ;
bits = SimplifyBitSequence ( bits ) ;
for ( std : : pair < int , double > bit : bits )
for ( const std : : pair < int , double > & bit : bits )
{
ku . push_back ( bit . first ? 0 : 1 ) ;
kd . push_back ( bit . first ? 1 : 0 ) ;
@ -991,14 +980,14 @@ void KIBIS_PIN::getKuKdNoWaveform( KIBIS_MODEL& aModel, KIBIS_PARAMETER& aParam
}
void KIBIS_PIN : : getKuKdTwoWaveforms ( KIBIS_MODEL & aModel ,
std : : pair < IbisWaveform * , IbisWaveform * > aPair1 ,
std : : pair < IbisWaveform * , IbisWaveform * > aPair2 ,
KIBIS_PARAMETER & aParam )
void KIBIS_PIN : : getKuKdTwoWaveforms ( KIBIS_MODEL & aModel ,
const std : : pair < IbisWaveform * , IbisWaveform * > & aPair1 ,
const std : : pair < IbisWaveform * , IbisWaveform * > & aPair2 ,
const KIBIS_PARAMETER & aParam )
{
std : : string simul = " " ;
IBIS_CORNER supply = aParam . m_supply ;
KIBIS_WAVEFORM * wave = aParam . m_waveform ;
std : : string simul = " " ;
const IBIS_CORNER supply = aParam . m_supply ;
const KIBIS_WAVEFORM * wave = aParam . m_waveform ;
if ( ! wave )
return ;
@ -1128,13 +1117,13 @@ void KIBIS_PIN::getKuKdTwoWaveforms( KIBIS_MODEL& aMo
simul + = " .endc \n " ;
simul + = " .end \n " ;
getKuKdFromFile ( & simul ) ;
getKuKdFromFile ( simul ) ;
}
}
bool KIBIS_PIN : : writeSpiceDriver ( std : : string * aDest , std : : string aName , KIBIS_MODEL & aModel ,
KIBIS_PARAMETER & aParam )
bool KIBIS_PIN : : writeSpiceDriver ( std : : string & aDest , const std : : string & aName , KIBIS_MODEL & aModel ,
const KIBIS_PARAMETER & aParam )
{
bool status = true ;
@ -1245,7 +1234,7 @@ bool KIBIS_PIN::writeSpiceDriver( std::string* aDest, std::string aName, KIBIS_M
result + = " \n .ENDS DRIVER \n \n " ;
* aDest + = result ;
aDest + = result ;
break ;
}
default : Report ( _ ( " Invalid model type for a driver. " ) , RPT_SEVERITY_ERROR ) ; status = false ;
@ -1255,8 +1244,8 @@ bool KIBIS_PIN::writeSpiceDriver( std::string* aDest, std::string aName, KIBIS_M
}
bool KIBIS_PIN : : writeSpiceDevice ( std : : string * aDest , std : : string aName , KIBIS_MODEL & aModel ,
KIBIS_PARAMETER & aParam )
bool KIBIS_PIN : : writeSpiceDevice ( std : : string & aDest , const std : : string & aName , KIBIS_MODEL & aModel ,
const KIBIS_PARAMETER & aParam )
{
bool status = true ;
@ -1270,7 +1259,6 @@ bool KIBIS_PIN::writeSpiceDevice( std::string* aDest, std::string aName, KIBIS_M
case IBIS_MODEL_TYPE : : IO_ECL :
{
std : : string result ;
std : : string tmp ;
result + = " \n " ;
result = " *Device model generated by Kicad using Ibis data. " ;
@ -1297,7 +1285,7 @@ bool KIBIS_PIN::writeSpiceDevice( std::string* aDest, std::string aName, KIBIS_M
result + = " \n .ENDS DRIVER \n \n " ;
* aDest = result ;
aDest = std : : move ( result ) ;
break ;
}
default : Report ( _ ( " Invalid model type for a device " ) , RPT_SEVERITY_ERROR ) ; status = false ;
@ -1307,8 +1295,8 @@ bool KIBIS_PIN::writeSpiceDevice( std::string* aDest, std::string aName, KIBIS_M
}
bool KIBIS_PIN : : writeSpiceDiffDriver ( std : : string * aDest , std : : string aName , KIBIS_MODEL & aModel ,
KIBIS_PARAMETER & aParam )
bool KIBIS_PIN : : writeSpiceDiffDriver ( std : : string & aDest , const std : : string & aName ,
KIBIS_MODEL & aModel , const KIBIS_ PARAMETER & aParam )
{
bool status = true ;
KIBIS_WAVEFORM * wave = aParam . m_waveform ;
@ -1336,9 +1324,9 @@ bool KIBIS_PIN::writeSpiceDiffDriver( std::string* aDest, std::string aName, KIB
result + = " GND PIN_P PIN_N \n " ;
result + = " \n " ;
status & = writeSpiceDriver ( & result , aName + " _P " , aModel , aParam ) ;
status & = writeSpiceDriver ( result , aName + " _P " , aModel , aParam ) ;
wave - > inverted = ! wave - > inverted ;
status & = writeSpiceDriver ( & result , aName + " _N " , aModel , aParam ) ;
status & = writeSpiceDriver ( result , aName + " _N " , aModel , aParam ) ;
wave - > inverted = ! wave - > inverted ;
@ -1351,15 +1339,15 @@ bool KIBIS_PIN::writeSpiceDiffDriver( std::string* aDest, std::string aName, KIB
if ( status )
{
* aDest + = result ;
aDest + = result ;
}
return status ;
}
bool KIBIS_PIN : : writeSpiceDiffDevice ( std : : string * aDest , std : : string aName , KIBIS_MODEL & aModel ,
KIBIS_PARAMETER & aParam )
bool KIBIS_PIN : : writeSpiceDiffDevice ( std : : string & aDest , const std : : string & aName ,
KIBIS_MODEL & aModel , const KIBIS_ PARAMETER & aParam )
{
bool status = true ;
@ -1383,8 +1371,8 @@ bool KIBIS_PIN::writeSpiceDiffDevice( std::string* aDest, std::string aName, KIB
result + = " GND PIN_P PIN_N \n " ;
result + = " \n " ;
status & = writeSpiceDevice ( & result , aName + " _P " , aModel , aParam ) ;
status & = writeSpiceDevice ( & result , aName + " _N " , aModel , aParam ) ;
status & = writeSpiceDevice ( result , aName + " _P " , aModel , aParam ) ;
status & = writeSpiceDevice ( result , aName + " _N " , aModel , aParam ) ;
result + = " \n " ;
result + = " x1 GND PIN_P " + aName + " _P \n " ;
@ -1395,14 +1383,14 @@ bool KIBIS_PIN::writeSpiceDiffDevice( std::string* aDest, std::string aName, KIB
if ( status )
{
* aDest + = result ;
aDest + = result ;
}
return status ;
}
KIBIS_MODEL * KIBIS : : GetModel ( std : : string aName )
KIBIS_MODEL * KIBIS : : GetModel ( const std : : string & aName )
{
for ( KIBIS_MODEL & model : m_models )
{
@ -1413,7 +1401,7 @@ KIBIS_MODEL* KIBIS::GetModel( std::string aName )
}
KIBIS_COMPONENT * KIBIS : : GetComponent ( std : : string aName )
KIBIS_COMPONENT * KIBIS : : GetComponent ( const std : : string & aName )
{
for ( KIBIS_COMPONENT & cmp : m_components )
{
@ -1424,7 +1412,7 @@ KIBIS_COMPONENT* KIBIS::GetComponent( std::string aName )
}
void KIBIS_PARAMETER : : SetCornerFromString ( IBIS_CORNER & aCorner , std : : string aString )
void KIBIS_PARAMETER : : SetCornerFromString ( IBIS_CORNER & aCorner , const std : : string & aString )
{
if ( aString = = " MIN " )
aCorner = IBIS_CORNER : : MIN ;
@ -1435,7 +1423,7 @@ void KIBIS_PARAMETER::SetCornerFromString( IBIS_CORNER& aCorner, std::string aSt
}
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_STUCK_HIGH : : GenerateBitSequence ( )
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_STUCK_HIGH : : GenerateBitSequence ( ) const
{
std : : vector < std : : pair < int , double > > bits ;
std : : pair < int , double > bit ;
@ -1445,7 +1433,7 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_STUCK_HIGH::GenerateBitSequen
}
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_STUCK_LOW : : GenerateBitSequence ( )
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_STUCK_LOW : : GenerateBitSequence ( ) const
{
std : : vector < std : : pair < int , double > > bits ;
std : : pair < int , double > bit ;
@ -1454,13 +1442,13 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_STUCK_LOW::GenerateBitSequenc
return bits ;
}
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_HIGH_Z : : GenerateBitSequence ( )
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_HIGH_Z : : GenerateBitSequence ( ) const
{
std : : vector < std : : pair < int , double > > bits ;
return bits ;
}
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_RECTANGULAR : : GenerateBitSequence ( )
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_RECTANGULAR : : GenerateBitSequence ( ) const
{
std : : vector < std : : pair < int , double > > bits ;
@ -1479,7 +1467,7 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_RECTANGULAR::GenerateBitSeque
}
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_PRBS : : GenerateBitSequence ( )
std : : vector < std : : pair < int , double > > KIBIS_WAVEFORM_PRBS : : GenerateBitSequence ( ) const
{
std : : vector < std : : pair < int , double > > bitSequence ;
uint8_t polynomial = 0b1100000 ;
@ -1494,7 +1482,8 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_PRBS::GenerateBitSequence()
double period = 1 / m_bitrate ;
double t = 0 ;
m_bits = abs ( m_bits ) ; // Just to be sure.
wxASSERT ( m_bits > 0 ) ;
int bits = 0 ;
do
@ -1513,7 +1502,8 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_PRBS::GenerateBitSequence()
return bitSequence ;
}
bool KIBIS_WAVEFORM_RECTANGULAR : : Check ( IbisWaveform * aRisingWf , IbisWaveform * aFallingWf )
bool KIBIS_WAVEFORM_RECTANGULAR : : Check ( const IbisWaveform * aRisingWf ,
const IbisWaveform * aFallingWf ) const
{
bool status = true ;
@ -1559,7 +1549,8 @@ bool KIBIS_WAVEFORM_RECTANGULAR::Check( IbisWaveform* aRisingWf, IbisWaveform* a
}
bool KIBIS_WAVEFORM_RECTANGULAR : : Check ( dvdtTypMinMax aRisingRp , dvdtTypMinMax aFallingRp )
bool KIBIS_WAVEFORM_RECTANGULAR : : Check ( const dvdtTypMinMax & aRisingRp ,
const dvdtTypMinMax & aFallingRp ) const
{
bool status = true ;
@ -1601,7 +1592,8 @@ bool KIBIS_WAVEFORM_RECTANGULAR::Check( dvdtTypMinMax aRisingRp, dvdtTypMinMax a
}
bool KIBIS_WAVEFORM_PRBS : : Check ( dvdtTypMinMax aRisingRp , dvdtTypMinMax aFallingRp )
bool KIBIS_WAVEFORM_PRBS : : Check ( const dvdtTypMinMax & aRisingRp ,
const dvdtTypMinMax & aFallingRp ) const
{
bool status = true ;
@ -1632,7 +1624,8 @@ bool KIBIS_WAVEFORM_PRBS::Check( dvdtTypMinMax aRisingRp, dvdtTypMinMax aFalling
return status ;
}
bool KIBIS_WAVEFORM_PRBS : : Check ( IbisWaveform * aRisingWf , IbisWaveform * aFallingWf )
bool KIBIS_WAVEFORM_PRBS : : Check ( const IbisWaveform * aRisingWf ,
const IbisWaveform * aFallingWf ) const
{
bool status = true ;