diff --git a/editors/MemoryDesigner/MasterSlavePathSearch.cpp b/editors/MemoryDesigner/MasterSlavePathSearch.cpp index 8f616b8b1..1624e2157 100644 --- a/editors/MemoryDesigner/MasterSlavePathSearch.cpp +++ b/editors/MemoryDesigner/MasterSlavePathSearch.cpp @@ -60,7 +60,7 @@ QVector > MasterSlavePathSearch::findIniti for (auto const& vertex : graph->getInterfaces()) { - if ((vertex->getMode() == General::MASTER || vertex->getMode() == General::INITIATOR) && vertex->getConnectedMemory()) + if (isStartInterface(vertex) && isConnectedToMemory(vertex)) { masterInterfaces.append(vertex); } @@ -69,6 +69,53 @@ QVector > MasterSlavePathSearch::findIniti return masterInterfaces; } +//----------------------------------------------------------------------------- +// Function: MasterSlavePathSearch::isStartInterface() +//----------------------------------------------------------------------------- +bool MasterSlavePathSearch::isStartInterface(QSharedPointer vertex) const +{ + return vertex->getMode() == General::MASTER || vertex->getMode() == General::INITIATOR; +} + +//----------------------------------------------------------------------------- +// Function: MasterSlavePathSearch::isConnectedToMemory() +//----------------------------------------------------------------------------- +bool MasterSlavePathSearch::isConnectedToMemory(QSharedPointer vertex) const +{ + if (vertex->getMode() == General::MASTER) + { + return vertex->isConnectedToMemory(); + } + else if (vertex->getMode() == General::INITIATOR && vertex->getInstance()) + { + return vertex->isConnectedToMemory() || isConnectedToSubspaceMap(vertex); + } + + return false; +} + +//----------------------------------------------------------------------------- +// Function: MasterSlavePathSearch::isConnectedToSubspaceMap() +//----------------------------------------------------------------------------- +bool MasterSlavePathSearch::isConnectedToSubspaceMap(QSharedPointer vertex) const +{ + for (auto memoryItem : vertex->getInstance()->getMemories()) + { + if (memoryItem->getType() == MemoryDesignerConstants::MEMORYMAP_TYPE) + { + for (auto memoryBlock : memoryItem->getChildItems()) + { + if (memoryBlock->getType() == MemoryDesignerConstants::SUBSPACEMAP_TYPE && memoryBlock->getInitiatorReference() == vertex->getName()) + { + return true; + } + } + } + } + + return false; +} + //----------------------------------------------------------------------------- // Function: MasterSlavePathSearch::findPaths() //----------------------------------------------------------------------------- diff --git a/editors/MemoryDesigner/MasterSlavePathSearch.h b/editors/MemoryDesigner/MasterSlavePathSearch.h index 449e86221..2030ac66f 100644 --- a/editors/MemoryDesigner/MasterSlavePathSearch.h +++ b/editors/MemoryDesigner/MasterSlavePathSearch.h @@ -56,6 +56,33 @@ class MasterSlavePathSearch QVector > findInitialMasterInterfaces( QSharedPointer graph) const; + /*! + * Check if the selected interface is a starting interface. + * + * @param [in] vertex The selected interface. + * + * @return True, if the interface is a starting interface, false otherwise. + */ + bool isStartInterface(QSharedPointer vertex) const; + + /*! + * Check if the selected interface is connected to a memory item. + * + * @param [in] vertex The selected interface. + * + * @return True, if the interface is a starting interface, false otherwise. + */ + bool isConnectedToMemory(QSharedPointer vertex) const; + + /*! + * Check if the selected interface is connected to a subspace map. + * + * @param [in] vertex The selected interface. + * + * @return True, if the interface is connected to a subspace map, false otherwise. + */ + bool isConnectedToSubspaceMap(QSharedPointer vertex) const; + /*! * Finds all the paths branching from the given start vertex. * diff --git a/version.h b/version.h index cf0ae9bad..b1f8b7d1c 100644 --- a/version.h +++ b/version.h @@ -10,20 +10,20 @@ #ifndef VERSIONNO__H #define VERSIONNO__H -#define VERSION_FULL 3.13.144.0 +#define VERSION_FULL 3.13.150.0 #define VERSION_BASEYEAR 0 -#define VERSION_DATE "2024-02-12" -#define VERSION_TIME "14:44:47" +#define VERSION_DATE "2024-02-13" +#define VERSION_TIME "12:07:11" #define VERSION_MAJOR 3 #define VERSION_MINOR 13 -#define VERSION_BUILDNO 144 +#define VERSION_BUILDNO 150 #define VERSION_EXTEND 0 -#define VERSION_FILE 3,13,144,0 -#define VERSION_PRODUCT 3,13,144,0 -#define VERSION_FILESTR "3,13,144,0" -#define VERSION_PRODUCTSTR "3,13,144,0" +#define VERSION_FILE 3,13,150,0 +#define VERSION_PRODUCT 3,13,150,0 +#define VERSION_FILESTR "3,13,150,0" +#define VERSION_PRODUCTSTR "3,13,150,0" #endif