mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
ibis: board description
This commit is contained in:
parent
0269851994
commit
47a8701a01
@ -1302,6 +1302,7 @@ bool IbisParser::changeContext( std::string& aKeyword )
|
|||||||
case IBIS_PARSER_CONTEXT::MODEL: status &= m_currentModel->Check(); break;
|
case IBIS_PARSER_CONTEXT::MODEL: status &= m_currentModel->Check(); break;
|
||||||
case IBIS_PARSER_CONTEXT::MODELSELECTOR: status &= m_currentModelSelector->Check(); break;
|
case IBIS_PARSER_CONTEXT::MODELSELECTOR: status &= m_currentModelSelector->Check(); break;
|
||||||
case IBIS_PARSER_CONTEXT::PACKAGEMODEL: status &= m_currentPackageModel->Check(); break;
|
case IBIS_PARSER_CONTEXT::PACKAGEMODEL: status &= m_currentPackageModel->Check(); break;
|
||||||
|
case IBIS_PARSER_CONTEXT::BOARD_DESCRIPTION: status &= m_currentBoardDescription->Check(); break;
|
||||||
case IBIS_PARSER_CONTEXT::END:
|
case IBIS_PARSER_CONTEXT::END:
|
||||||
Report( "Cannot change context after [END]" );
|
Report( "Cannot change context after [END]" );
|
||||||
status = false;
|
status = false;
|
||||||
@ -1376,6 +1377,28 @@ bool IbisParser::changeContext( std::string& aKeyword )
|
|||||||
m_continue = IBIS_PARSER_CONTINUE::NONE;
|
m_continue = IBIS_PARSER_CONTINUE::NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Begin_Board_Description" ) )
|
||||||
|
{
|
||||||
|
IbisBoardDescription BD( m_reporter );
|
||||||
|
status &= storeString( BD.m_name, false );
|
||||||
|
|
||||||
|
m_ibisFile.m_boardDescriptions.push_back( BD );
|
||||||
|
m_currentBoardDescription = &( m_ibisFile.m_boardDescriptions.back() );
|
||||||
|
m_context = IBIS_PARSER_CONTEXT::BOARD_DESCRIPTION;
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "End_Board_Description" ) )
|
||||||
|
{
|
||||||
|
if( m_currentBoardDescription != nullptr )
|
||||||
|
{
|
||||||
|
m_context = IBIS_PARSER_CONTEXT::BOARD_DESCRIPTION;
|
||||||
|
m_continue = IBIS_PARSER_CONTINUE::NONE;
|
||||||
|
}
|
||||||
|
else // .ebd file, we just go back to header, to get the [END] keyword
|
||||||
|
{ // This will cause the header to be checked twice.
|
||||||
|
m_context = IBIS_PARSER_CONTEXT::HEADER;
|
||||||
|
m_continue = IBIS_PARSER_CONTINUE::NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
status = false;
|
status = false;
|
||||||
@ -1388,7 +1411,8 @@ bool IbisParser::changeContext( std::string& aKeyword )
|
|||||||
case IBIS_PARSER_CONTEXT::MODELSELECTOR: context_string += "MODEL_SELECTOR"; break;
|
case IBIS_PARSER_CONTEXT::MODELSELECTOR: context_string += "MODEL_SELECTOR"; break;
|
||||||
case IBIS_PARSER_CONTEXT::MODEL: context_string += "MODEL"; break;
|
case IBIS_PARSER_CONTEXT::MODEL: context_string += "MODEL"; break;
|
||||||
case IBIS_PARSER_CONTEXT::PACKAGEMODEL: context_string += "PACKAGE_MODEL"; break;
|
case IBIS_PARSER_CONTEXT::PACKAGEMODEL: context_string += "PACKAGE_MODEL"; break;
|
||||||
case IBIS_PARSER_CONTEXT::PACKAGEMODEL_MODELDATA: context_string += "PACKAGE_MODEL_MODEL_DATA"; break;
|
case IBIS_PARSER_CONTEXT::BOARD_DESCRIPTION: context_string += "BOARD_DESCRIPTION"; break;
|
||||||
|
case IBIS_PARSER_CONTEXT::PACKAGEMODEL_MODELDATA: context_string += "PACKAGE_MODEL_MODEL_DATA"; break;
|
||||||
default: context_string += "???"; break;
|
default: context_string += "???"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2233,6 +2257,43 @@ bool IbisParser::parseComponent( std::string& aKeyword )
|
|||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IbisParser::parseBoardDescription( std::string& aKeyword )
|
||||||
|
{
|
||||||
|
bool status = true;
|
||||||
|
if( compareIbisWord( aKeyword.c_str(), "Manufacturer" ) )
|
||||||
|
{
|
||||||
|
status &= storeString( m_currentBoardDescription->m_manufacturer, true );
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Number_Of_Pins" ) )
|
||||||
|
{
|
||||||
|
status &= readInt( m_currentBoardDescription->m_numberOfPins );
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Pin_List" ) )
|
||||||
|
{
|
||||||
|
Report( _( "The [Pin List] keyword is not implemented" ), RPT_SEVERITY_ERROR );
|
||||||
|
status = false;
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Path_Description" ) )
|
||||||
|
{
|
||||||
|
Report( _( "The [Path Description] keyword is not implemented" ), RPT_SEVERITY_ERROR );
|
||||||
|
status = false;
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Reference_Designator_Map" ) )
|
||||||
|
{
|
||||||
|
Report( _( "The [Path Description] keyword is not implemented" ), RPT_SEVERITY_ERROR );
|
||||||
|
status = false;
|
||||||
|
}
|
||||||
|
else if( compareIbisWord( aKeyword.c_str(), "Diff_Pin" ) )
|
||||||
|
{
|
||||||
|
status &= readDiffPin();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( !changeContext( aKeyword ) )
|
||||||
|
{
|
||||||
|
status = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2628,6 +2689,9 @@ bool IbisParser::onNewLine()
|
|||||||
break;
|
break;
|
||||||
case IBIS_PARSER_CONTEXT::PACKAGEMODEL:
|
case IBIS_PARSER_CONTEXT::PACKAGEMODEL:
|
||||||
status &= parsePackageModel( keyword );
|
status &= parsePackageModel( keyword );
|
||||||
|
break;
|
||||||
|
case IBIS_PARSER_CONTEXT::BOARD_DESCRIPTION:
|
||||||
|
status &= parseBoardDescription( keyword );
|
||||||
break;
|
break;
|
||||||
case IBIS_PARSER_CONTEXT::PACKAGEMODEL_MODELDATA:
|
case IBIS_PARSER_CONTEXT::PACKAGEMODEL_MODELDATA:
|
||||||
status &= parsePackageModelModelData( keyword );
|
status &= parsePackageModelModelData( keyword );
|
||||||
|
@ -264,6 +264,19 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class IbisBoardPin : public IBIS_INPUT
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IbisBoardPin( REPORTER* aReporter ) : IBIS_INPUT( aReporter ){};
|
||||||
|
|
||||||
|
virtual ~IbisBoardPin(){};
|
||||||
|
|
||||||
|
std::string m_name;
|
||||||
|
std::string m_signalName;
|
||||||
|
bool Check() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class IbisComponentPinMapping : public IBIS_INPUT
|
class IbisComponentPinMapping : public IBIS_INPUT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -337,6 +350,22 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class IbisBoardDescription : public IBIS_INPUT
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IbisComponent( REPORTER* aReporter ) : IBIS_INPUT( aReporter ){};
|
||||||
|
|
||||||
|
virtual ~IbisBoardDescription(){};
|
||||||
|
|
||||||
|
std::string m_name = "";
|
||||||
|
std::string m_manufacturer = "";
|
||||||
|
int m_numberofPins;
|
||||||
|
std::vector<IbisBoardPin> m_pins;
|
||||||
|
|
||||||
|
bool Check() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class IbisModelSelectorEntry
|
class IbisModelSelectorEntry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -705,6 +734,7 @@ enum class IBIS_PARSER_CONTEXT
|
|||||||
MODEL,
|
MODEL,
|
||||||
PACKAGEMODEL,
|
PACKAGEMODEL,
|
||||||
PACKAGEMODEL_MODELDATA,
|
PACKAGEMODEL_MODELDATA,
|
||||||
|
BOARD_DESCRIPTION,
|
||||||
END
|
END
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -727,11 +757,12 @@ public:
|
|||||||
int m_lineIndex = 0;
|
int m_lineIndex = 0;
|
||||||
int m_lineLength = 0;
|
int m_lineLength = 0;
|
||||||
|
|
||||||
IbisFile m_ibisFile;
|
IbisFile m_ibisFile;
|
||||||
IbisComponent* m_currentComponent = nullptr;
|
IbisComponent* m_currentComponent = nullptr;
|
||||||
IbisModelSelector* m_currentModelSelector = nullptr;
|
IbisBoardDescription* m_currentBoardDescription = nullptr;
|
||||||
IbisModel* m_currentModel = nullptr;
|
IbisModelSelector* m_currentModelSelector = nullptr;
|
||||||
IbisPackageModel* m_currentPackageModel = nullptr;
|
IbisModel* m_currentModel = nullptr;
|
||||||
|
IbisPackageModel* m_currentPackageModel = nullptr;
|
||||||
std::shared_ptr<IBIS_MATRIX> m_currentMatrix = nullptr;
|
std::shared_ptr<IBIS_MATRIX> m_currentMatrix = nullptr;
|
||||||
int m_currentMatrixRow = 0;
|
int m_currentMatrixRow = 0;
|
||||||
int m_currentMatrixRowIndex = 0;
|
int m_currentMatrixRowIndex = 0;
|
||||||
@ -774,35 +805,36 @@ private:
|
|||||||
* @return True in case of success
|
* @return True in case of success
|
||||||
*/
|
*/
|
||||||
bool parseComponent( std::string& aKeyword );
|
bool parseComponent( std::string& aKeyword );
|
||||||
|
|
||||||
/** @brief Parse a single keyword in the component context
|
|
||||||
*
|
|
||||||
* @param aKeyword Keyword
|
|
||||||
* @return True in case of success
|
|
||||||
*/
|
|
||||||
bool parseModelSelector( std::string& aKeyword );
|
|
||||||
|
|
||||||
/** @brief Parse a single keyword in the model selector context
|
/** @brief Parse a single keyword in the model selector context
|
||||||
*
|
*
|
||||||
* @param aKeyword Keyword
|
* @param aKeyword Keyword
|
||||||
* @return True in case of success
|
* @return True in case of success
|
||||||
*/
|
*/
|
||||||
bool parseModel( std::string& aKeyword );
|
bool parseModelSelector( std::string& aKeyword );
|
||||||
|
|
||||||
/** @brief Parse a single keyword in the model context
|
/** @brief Parse a single keyword in the model context
|
||||||
*
|
*
|
||||||
* @param aKeyword Keyword
|
* @param aKeyword Keyword
|
||||||
* @return True in case of success
|
* @return True in case of success
|
||||||
*/
|
*/
|
||||||
bool parsePackageModel( std::string& aKeyword );
|
bool parseModel( std::string& aKeyword );
|
||||||
|
|
||||||
/** @brief Parse a single keyword in the package model context
|
/** @brief Parse a single keyword in the package model context
|
||||||
*
|
*
|
||||||
* @param aKeyword Keyword
|
* @param aKeyword Keyword
|
||||||
* @return True in case of success
|
* @return True in case of success
|
||||||
*/
|
*/
|
||||||
|
bool parsePackageModel( std::string& aKeyword );
|
||||||
|
/** @brief Parse a single keyword in the package model model data context
|
||||||
|
*
|
||||||
|
* @param aKeyword Keyword
|
||||||
|
* @return True in case of success
|
||||||
|
*/
|
||||||
bool parsePackageModelModelData( std::string& );
|
bool parsePackageModelModelData( std::string& );
|
||||||
|
/** @brief Parse a single keyword in the board description context
|
||||||
|
*
|
||||||
|
* @param aKeyword Keyword
|
||||||
|
* @return True in case of success
|
||||||
|
*/
|
||||||
|
bool parseBoardDescription( std::string& aKeyword );
|
||||||
/** @brief Parse a double according to the ibis standard
|
/** @brief Parse a double according to the ibis standard
|
||||||
*
|
*
|
||||||
* @param aDest Where the double should be stored
|
* @param aDest Where the double should be stored
|
||||||
|
Loading…
x
Reference in New Issue
Block a user