Skip to content

Commit

Permalink
[ADDITIVE] Update memory map and address space interface bindings in …
Browse files Browse the repository at this point in the history
…editors to support new std.
  • Loading branch information
hagantsa committed Nov 20, 2023
1 parent 95abe1c commit 72dfc59
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 26 deletions.
3 changes: 2 additions & 1 deletion IPXACTmodels/Component/BusInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ QString BusInterface::getMemoryMapRef() const
//-----------------------------------------------------------------------------
QString BusInterface::getAddressSpaceRef() const
{
if (interfaceMode_ == General::MASTER || interfaceMode_ == General::MIRRORED_MASTER)
if (interfaceMode_ == General::MASTER || interfaceMode_ == General::MIRRORED_MASTER ||
interfaceMode_ == General::INITIATOR || interfaceMode_ == General::MIRRORED_INITIATOR)
{
if (!initiator_)
{
Expand Down
23 changes: 18 additions & 5 deletions IPXACTmodels/Component/Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ QStringList Component::getTargetInterfaces( const QString& memoryMap ) const

for (const QSharedPointer<BusInterface> busif : *busInterfaces_)
{
if (busif->getInterfaceMode() == General::SLAVE && busif->getMemoryMapRef() == memoryMap)
if ((busif->getInterfaceMode() == interfaceModeName) && busif->getMemoryMapRef() == memoryMap)
{
names.append(busif->name());
}
Expand All @@ -1226,13 +1226,19 @@ QStringList Component::getTargetInterfaces( const QString& memoryMap ) const
//-----------------------------------------------------------------------------
// Function: Component::getMasterInterfaces()
//-----------------------------------------------------------------------------
QStringList Component::getMasterInterfaces( const QString& addressSpace ) const
QStringList Component::getInitiatorInterfaces( const QString& addressSpace ) const
{
QStringList names;

General::InterfaceMode initiatorModeName = getRevision() == Document::Revision::Std22
? General::INITIATOR : General::MASTER;

General::InterfaceMode mirroredInitiatorModeName = getRevision() == Document::Revision::Std22
? General::MIRRORED_INITIATOR : General::MIRRORED_MASTER;

for (const QSharedPointer<BusInterface> busif : *busInterfaces_)
{
if ((busif->getInterfaceMode() == General::MASTER || busif->getInterfaceMode() == General::MIRRORED_MASTER)
if ((busif->getInterfaceMode() == initiatorModeName || busif->getInterfaceMode() == mirroredInitiatorModeName)
&& (busif->getAddressSpaceRef() == addressSpace))
{
names.append(busif->name());
Expand All @@ -1245,12 +1251,19 @@ QStringList Component::getMasterInterfaces( const QString& addressSpace ) const
//-----------------------------------------------------------------------------
// Function: Component::getMasterInterfaces()
//-----------------------------------------------------------------------------
QStringList Component::getMasterInterfaces() const
QStringList Component::getInitiatorInterfaces() const
{
QStringList names;

General::InterfaceMode initiatorModeName = getRevision() == Document::Revision::Std22
? General::INITIATOR : General::MASTER;

General::InterfaceMode mirroredInitiatorModeName = getRevision() == Document::Revision::Std22
? General::MIRRORED_INITIATOR : General::MIRRORED_MASTER;

for (QSharedPointer<const BusInterface> busif : *busInterfaces_)
{
if (busif->getInterfaceMode() == General::MASTER || busif->getInterfaceMode() == General::MIRRORED_MASTER)
if (busif->getInterfaceMode() == initiatorModeName || busif->getInterfaceMode() == mirroredInitiatorModeName)
{
names.append(busif->name());
}
Expand Down
4 changes: 2 additions & 2 deletions IPXACTmodels/Component/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -765,14 +765,14 @@ class IPXACTMODELS_EXPORT Component: public Document
*
* @return QStringList containing names of the master and mirrored master interfaces.
*/
QStringList getMasterInterfaces(const QString& addressSpace) const;
QStringList getInitiatorInterfaces(const QString& addressSpace) const;

/*!
* Get list of the master and mirrored master interface names.
*
* @return QStringList containing the interface names.
*/
QStringList getMasterInterfaces() const;
QStringList getInitiatorInterfaces() const;

/*!
* Checks if the component contains bus interfaces.
Expand Down
2 changes: 1 addition & 1 deletion Plugins/MemoryMapHeaderGenerator/globalheadersavemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void GlobalHeaderSaveModel::setDesign( QSharedPointer<Component> topComp, QShare
}

// create header for each master interface
QStringList masterInterfaces = comp->getMasterInterfaces();
QStringList masterInterfaces = comp->getInitiatorInterfaces();
foreach (QString interfaceName, masterInterfaces)
{
// if the operated interface is not connected to any other instance within the design
Expand Down
4 changes: 2 additions & 2 deletions editors/ComponentEditor/addressSpaces/addressspaceeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ AddressSpaceEditor::AddressSpaceEditor(QSharedPointer<Component> component, Libr
ItemEditor(component, handler, parent),
addrSpace_(addrSpace),
nameEditor_(addrSpace, component->getRevision(), this),
generalEditor_(addrSpace, component->getMasterInterfaces(addrSpace_->name()), parameterFinder, expressionParser,
generalEditor_(addrSpace, component->getInitiatorInterfaces(addrSpace_->name()), parameterFinder, expressionParser,
component->getRevision(), this),
segmentsEditor_(addrSpace, component, handler->getDirectoryPath(component->getVlnv()), parameterFinder,
expressionParser, expressionFormatter, this),
Expand Down Expand Up @@ -103,7 +103,7 @@ localMemMapEditor_(addrSpace, component, handler, parameterFinder, blockInterfac
//-----------------------------------------------------------------------------
void AddressSpaceEditor::refresh()
{
QStringList masterInterfaceList = component()->getMasterInterfaces(addrSpace_->name());
QStringList masterInterfaceList = component()->getInitiatorInterfaces(addrSpace_->name());

// Block signals from here for the duration of refreshing editors.
blockSignals(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ masterInterfaceBindingLabel_(new QLabel(this))
layout->addRow(tr("Range (=size) [AUB], f(x):"), rangeEditor_);
layout->addRow(tr("Width [bits], f(x):"), widthEditor_);

if (docRevision != Document::Revision::Std22)
if (docRevision == Document::Revision::Std22)
{
layout->addRow(tr("Is present, f(x):"), isPresentEditor_);
layout->addRow(tr("Initiator interface binding(s):"), masterInterfaceBindingLabel_);
isPresentEditor_->setVisible(false);
}
else
{
isPresentEditor_->setVisible(false);
layout->addRow(tr("Is present, f(x):"), isPresentEditor_);
layout->addRow(tr("Master interface binding(s):"), masterInterfaceBindingLabel_);
}
layout->addRow(tr("Master interface binding(s):"), masterInterfaceBindingLabel_);

refresh(busInterfaceNames);

Expand Down
10 changes: 7 additions & 3 deletions editors/ComponentEditor/addressSpaces/addressspacesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ QVariant AddressSpacesModel::headerData( int section, Qt::Orientation orientatio
}
else if (section == AddressSpaceColumns::INTERFACE_BINDING)
{
if (component_->getRevision() == Document::Revision::Std22)
{
return tr("Initiator interface\nbinding(s)");
}
return tr("Master interface\nbinding(s)");
}
else if (section == AddressSpaceColumns::DESCRIPTION)
Expand Down Expand Up @@ -183,7 +187,7 @@ QVariant AddressSpacesModel::data(QModelIndex const& index, int role) const
}
else if (Qt::UserRole == role)
{
return component_->getMasterInterfaces(addressSpaces_->at(index.row())->name());
return component_->getInitiatorInterfaces(addressSpaces_->at(index.row())->name());
}
else if (Qt::ForegroundRole == role)
{
Expand Down Expand Up @@ -358,9 +362,9 @@ QVariant AddressSpacesModel::expressionOrValueForIndex(QModelIndex const& index)
}
else if (index.column() == AddressSpaceColumns::INTERFACE_BINDING)
{
QStringList interfaceNames = component_->getMasterInterfaces(addressSpaces_->at(index.row())->name());
QStringList interfaceNames = component_->getInitiatorInterfaces(addressSpaces_->at(index.row())->name());

// if no interface refers to the memory map
// if no interface refers to the address space
if (interfaceNames.isEmpty())
{
return tr("No binding");
Expand Down
4 changes: 4 additions & 0 deletions editors/ComponentEditor/memoryMaps/memorymapsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ QVariant MemoryMapsModel::headerData(int section, Qt::Orientation orientation, i
}
else if (section == MemoryMapsColumns::INTERFACE_COLUMN)
{
if (docRevision_ == Document::Revision::Std22)
{
return tr("Target interface\nbinding");
}
return tr("Slave interface\nbinding");
}
else if (section == MemoryMapsColumns::IS_PRESENT)
Expand Down
16 changes: 8 additions & 8 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
#ifndef VERSIONNO__H
#define VERSIONNO__H

#define VERSION_FULL 3.12.1013.0
#define VERSION_FULL 3.12.1016.0

#define VERSION_BASEYEAR 0
#define VERSION_DATE "2023-11-17"
#define VERSION_TIME "15:26:18"
#define VERSION_DATE "2023-11-20"
#define VERSION_TIME "10:05:57"

#define VERSION_MAJOR 3
#define VERSION_MINOR 12
#define VERSION_BUILDNO 1013
#define VERSION_BUILDNO 1016
#define VERSION_EXTEND 0

#define VERSION_FILE 3,12,1013,0
#define VERSION_PRODUCT 3,12,1013,0
#define VERSION_FILESTR "3,12,1013,0"
#define VERSION_PRODUCTSTR "3,12,1013,0"
#define VERSION_FILE 3,12,1016,0
#define VERSION_PRODUCT 3,12,1016,0
#define VERSION_FILESTR "3,12,1016,0"
#define VERSION_PRODUCTSTR "3,12,1016,0"

#endif

0 comments on commit 72dfc59

Please sign in to comment.