public class Platform
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Cluster[] |
clusters
All the Clusters of the platform.
|
private DmaEngine[] |
dmaEngines
All the DMA Engines of the platform.
|
private int |
dmaSetupTime
Initialization Time required for the DMA.
|
private NetworkLink[] |
links
All the network links of the platform.
|
private Memory[] |
memories
All the memories of the platform.
|
private int[][] |
minDistances
All the distances between processors or clusters of the platform.
|
private java.lang.String |
name
Name of the platform
|
private int |
numClusters
Total number of clusters in the platform
|
private int |
numDmaEngines
Total number of DMA Engines in the platform
|
private int |
numLinks
Total number of links in the platform
|
private int |
numMemories
Total number of memories in the platform
|
private int |
numProcessors
Total number of processors in the platform
|
private Processor[] |
processors
All the processors of the platform.
|
Constructor and Description |
---|
Platform(java.lang.String name,
int numClusters,
int numDmaEngines,
int numProcessors,
int numMemories,
int numLinks)
Initialize the platform model.
|
Modifier and Type | Method and Description |
---|---|
void |
addCluster(Cluster cluster)
Add a cluster component to the platform.
|
void |
addDmaEngine(DmaEngine dma)
Add a DMA Engine to the platform.
|
void |
addLink(NetworkLink lnk)
Add a network link to the platform.
|
void |
addMemory(Memory mem)
Add memory component to the platform.
|
void |
addProcessor(Processor proc)
Add a processor component to the platform.
|
void |
calculateMinDistances()
Calculate the minimum distances between the clusters.
|
java.util.HashSet<Cluster> |
getAllClusters()
Gets all the clusters of the platform
|
Cluster |
getCluster(int index)
Gets a cluster at particular index.
|
Cluster |
getCluster(java.lang.String name)
Gets a cluster by its name.
|
int |
getClusterIndex(Cluster cluster)
Gets index of Cluster in the platform.
|
java.util.HashMap<java.lang.Integer,java.util.List<int[]>> |
getDistanceMap()
Gets the minimum distances between the processors or clusters.
|
java.util.HashSet<DmaEngine> |
getDmaEngine(Cluster cluster)
Gets all the DMA Engines that belong to a cluster.
|
DmaEngine |
getDmaEngine(int index)
Gets a DMA Engine at particular index.
|
int |
getDmaEngineIndex(DmaEngine dmaEngine)
Gets index of DMA Engine in the platform.
|
int |
getDmaSetupTime()
Gets the dma initialization time in the platform.
|
NetworkLink |
getLink(int index)
Gets a Network Link at particular index.
|
int |
getMaxDistanceInPlatform()
Maximum distance in the platform between two processors / clusters.
|
int |
getMinDistance(Cluster srcCluster,
Cluster dstCluster)
Gets minimum distance between any two given clusters.
|
int |
getMinDistance(int aIndex,
int bIndex)
Get the minimum distance in the array.
|
int |
getMinDistance(Processor srcProc,
Processor dstProc)
Gets minimum distance between any two given processors.
|
int |
getMinDistanceInPlatform()
Minimum distance in the platform between two processors / clusters.
|
int |
getNumClusters()
Gets the number of clusters in the platform.
|
int |
getNumDmaEngines()
Gets the number of DMA Engines in the platform.
|
int |
getNumLinks()
Gets the number of Network Links in the platform.
|
int |
getNumMemories()
Gets the number of memories in the platform.
|
int |
getNumProcessors()
Gets the number of processors in the platform.
|
Processor |
getProcessor(int index)
Gets a processor at particular index.
|
Processor |
getProcessor(java.lang.String name)
Get a processor by its name.
|
int |
getProcIndex(Processor processor)
Gets index of Processor in the platform.
|
void |
setDmaSetupTime(int dmaSetupTime)
Set the DMA initialization time in the platform.
|
void |
sortElements()
We sort the components of the platform according to their ID's
This will help to address them using the index variable especially
in the API like
Processor.getMemory(int) |
void |
validatePlatform()
Check if platform model built confirms to specifications in the XML file.
|
private final java.lang.String name
private final int numClusters
private final int numDmaEngines
private final int numProcessors
private final int numMemories
private final int numLinks
private Cluster[] clusters
private Processor[] processors
private NetworkLink[] links
private Memory[] memories
private DmaEngine[] dmaEngines
private int[][] minDistances
private int dmaSetupTime
public Platform(java.lang.String name, int numClusters, int numDmaEngines, int numProcessors, int numMemories, int numLinks)
name
- name of the platformnumClusters
- total number of clusters in the platformnumDmaEngines
- total number of DMAs in the platformnumProcessors
- total number of processors in the platformnumMemories
- total number of memories in the platformnumLinks
- total number of network links in the platformpublic java.util.HashSet<Cluster> getAllClusters()
public void sortElements()
Processor.getMemory(int)
public void addDmaEngine(DmaEngine dma)
dma
- public void addLink(NetworkLink lnk)
lnk
- network link component to be added to the platform.public void addMemory(Memory mem)
mem
- memory component to be added to the platform.public void setDmaSetupTime(int dmaSetupTime)
dmaSetupTime
- dma initialization time of the platform.public void addProcessor(Processor proc)
proc
- processor component to be added to the platform.public void addCluster(Cluster cluster)
cluster
- cluster component to be added to the platform.public Cluster getCluster(int index)
index
- index location in the array of clusters.public Processor getProcessor(int index)
index
- index location in the array of processors.public DmaEngine getDmaEngine(int index)
index
- index location in the array of DMA Engines.public NetworkLink getLink(int index)
index
- index location in the array of network links.public Cluster getCluster(java.lang.String name)
name
- name of the cluster.public Processor getProcessor(java.lang.String name)
name
- name of the processorpublic java.util.HashSet<DmaEngine> getDmaEngine(Cluster cluster)
cluster
- cluster componentpublic int getClusterIndex(Cluster cluster)
cluster
- Cluster Componentpublic int getProcIndex(Processor processor)
processor
- Processor Componentpublic int getDmaEngineIndex(DmaEngine dmaEngine)
dmaEngine
- DMA Engine component.public java.util.HashMap<java.lang.Integer,java.util.List<int[]>> getDistanceMap()
public int getMinDistanceInPlatform()
public int getMaxDistanceInPlatform()
public int getMinDistance(Cluster srcCluster, Cluster dstCluster)
srcCluster
- source clusterdstCluster
- destination clusterpublic int getMinDistance(int aIndex, int bIndex)
aIndex
- first indexbIndex
- second indexpublic int getMinDistance(Processor srcProc, Processor dstProc)
srcProc
- source processordstProc
- destination processorpublic void calculateMinDistances()
public void validatePlatform()
public int getNumClusters()
public int getNumProcessors()
public int getNumLinks()
public int getNumMemories()
public int getNumDmaEngines()
public int getDmaSetupTime()