From ffd578ef70076a88ece6680e65e614dca000d5dc Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 8 Nov 2022 17:34:29 +0100 Subject: [PATCH] Ibis parser: fix a collision name with a windows header (msys2 specific) This is recurrent conflict. (fixed by changing INPUT to INPUT_SDT). --- eeschema/sim/kibis/ibis_parser.cpp | 4 ++-- eeschema/sim/kibis/ibis_parser.h | 2 +- eeschema/sim/kibis/kibis.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/eeschema/sim/kibis/ibis_parser.cpp b/eeschema/sim/kibis/ibis_parser.cpp index 47891228c1..f4e1101581 100644 --- a/eeschema/sim/kibis/ibis_parser.cpp +++ b/eeschema/sim/kibis/ibis_parser.cpp @@ -536,7 +536,7 @@ bool IbisModel::Check() Report( _( "Invalid GND clamp." ), RPT_SEVERITY_ERROR ); status = false; } - if( m_type != IBIS_MODEL_TYPE::INPUT_ECL && m_type != IBIS_MODEL_TYPE::INPUT + if( m_type != IBIS_MODEL_TYPE::INPUT_ECL && m_type != IBIS_MODEL_TYPE::INPUT_STD && m_type != IBIS_MODEL_TYPE::TERMINATOR && m_type != IBIS_MODEL_TYPE::SERIES && m_type != IBIS_MODEL_TYPE::SERIES_SWITCH ) { @@ -1830,7 +1830,7 @@ bool IbisParser::readModel() if( readWord( subparam ) ) { if( !strcmp( subparam.c_str(), "Input" ) ) - m_currentModel->m_type = IBIS_MODEL_TYPE::INPUT; + m_currentModel->m_type = IBIS_MODEL_TYPE::INPUT_STD; else if( !strcmp( subparam.c_str(), "Output" ) ) m_currentModel->m_type = IBIS_MODEL_TYPE::OUTPUT; else if( !strcmp( subparam.c_str(), "I/O" ) ) diff --git a/eeschema/sim/kibis/ibis_parser.h b/eeschema/sim/kibis/ibis_parser.h index e4f410ebcc..1414886217 100644 --- a/eeschema/sim/kibis/ibis_parser.h +++ b/eeschema/sim/kibis/ibis_parser.h @@ -388,7 +388,7 @@ Series, and Series_switch. enum class IBIS_MODEL_TYPE { UNDEFINED, - INPUT, + INPUT_STD, // Do not use INPUT: it can conflict with a windows header on MSYS2 OUTPUT, IO, THREE_STATE, diff --git a/eeschema/sim/kibis/kibis.cpp b/eeschema/sim/kibis/kibis.cpp index e86cb03319..a39b798459 100644 --- a/eeschema/sim/kibis/kibis.cpp +++ b/eeschema/sim/kibis/kibis.cpp @@ -511,21 +511,21 @@ std::string KIBIS_MODEL::generateSquareWave( std::string aNode1, std::string aNo int i = 0; - int prevBit = 2; + int prevBit = 2; for( std::pair bit : aBits ) { IbisWaveform* WF; double timing = bit.second; - + if ( bit.first != prevBit ) { if( bit.first == 1 ) WF = &risingWF; else WF = &fallingWF; - + stimuliIndex.push_back( i ); simul += "Vstimuli"; @@ -1280,7 +1280,7 @@ bool KIBIS_PIN::writeSpiceDevice( std::string* aDest, std::string aName, KIBIS_M switch( aModel.m_type ) { - case IBIS_MODEL_TYPE::INPUT: + case IBIS_MODEL_TYPE::INPUT_STD: case IBIS_MODEL_TYPE::IO: case IBIS_MODEL_TYPE::IO_OPEN_DRAIN: case IBIS_MODEL_TYPE::IO_OPEN_SINK: @@ -1506,27 +1506,27 @@ std::vector> KIBIS_WAVEFORM_PRBS::GenerateBitSequence() //110 = x^3+x^2+1 uint8_t seed = 0x12; // Any non zero state uint8_t lfsr = seed; - + if ( m_bitrate == 0 ) return bitSequence; double period = 1/m_bitrate; double t = 0; m_bits = abs( m_bits ); // Just to be sure. - + int bits = 0; do { uint8_t lsb = lfsr & 0x01; bitSequence.emplace_back( ( inverted ^ lsb ? 1 : 0 ), t ); lfsr = lfsr >> 1; - + if ( lsb ) lfsr ^= polynomial; t += period; } while ( ++bits < m_bits ); - + return bitSequence; } \ No newline at end of file