public class Cluster extends PlatformComponentProp
Modifier and Type | Field and Description |
---|---|
private DmaEngine[] |
dmaEngines
DMA Engines of the cluster.
|
private NetworkLink[] |
links
Links connected to the cluster.
|
private Memory[] |
memory
Memories of the cluster.
|
private int |
numDmaEngines
Number of DMA engines of the cluster.
|
private int |
numLinksToCluster
Number of links connected to the cluster.
|
private int |
numMemoriesInCluster
Number of memories inside the cluster.
|
private int |
numProcessorsInCluster
Number of processors inside the cluster.
|
private Processor[] |
processors
Processors of the cluster.
|
private int |
speed
Speed of the cluster.
|
Constructor and Description |
---|
Cluster(java.lang.String name,
int id,
int speed,
int numProcessorsInThisCluster,
int numberOfLinksToThisCluster,
int numClusterMemory,
int numDmaEngines)
Initialize the cluster component of the platform model.
|
Modifier and Type | Method and Description |
---|---|
void |
addDma(DmaEngine dma)
Adds DMA Engine to the cluster at available index.
|
void |
addLink(NetworkLink lnk,
int port)
Adds network link to a given port.
|
void |
addMemory(Memory mem)
Adds Memory to the cluster at available index.
|
void |
addProcessor(Processor proc)
Adds Processor to the cluster at available index.
|
DmaEngine |
getDmaEngine(int index)
Gets DMA inside cluster at index
|
NetworkLink |
getLink(int index)
Gets Link of cluster at index
|
Memory |
getMemory(int index)
Gets Memory inside cluster at index
|
int |
getNumDmaInCluster()
Gets number of DMA in the cluster
|
int |
getNumLinksToCluster()
Gets number of links connected to the cluster
|
int |
getNumMemoriesInCluster()
Gets number of Memories in the cluster
|
int |
getNumProcInCluster()
Gets number of processors in the cluster
|
Processor |
getProcessor(int index)
Gets processor inside cluster at index
|
int |
getSpeed()
Get Speed of the cluster
|
void |
sortDma()
Sort the DMA inside the cluster according to their ID.
|
void |
sortProcessors()
Sort the processors inside the cluster according to their ID.
|
getId, getName, toString
private final int numMemoriesInCluster
private final int numProcessorsInCluster
private final int numLinksToCluster
private final int numDmaEngines
private final int speed
private Processor[] processors
private NetworkLink[] links
private Memory[] memory
private DmaEngine[] dmaEngines
public Cluster(java.lang.String name, int id, int speed, int numProcessorsInThisCluster, int numberOfLinksToThisCluster, int numClusterMemory, int numDmaEngines)
name
- name of the clusterid
- id of the clusterspeed
- speed of the clusternumProcessorsInThisCluster
- number of processors present in the clusternumberOfLinksToThisCluster
- number of links connected to the clusternumClusterMemory
- number of memories present in the clusternumDmaEngines
- number of DMA present in the clusterpublic void sortProcessors()
public void sortDma()
public int getNumProcInCluster()
public int getNumDmaInCluster()
public int getNumLinksToCluster()
public int getNumMemoriesInCluster()
public Processor getProcessor(int index)
index
- processor at this particular indexpublic DmaEngine getDmaEngine(int index)
index
- DMA at this particular indexpublic NetworkLink getLink(int index)
index
- Link at this particular indexpublic Memory getMemory(int index)
index
- Memory at this particular indexpublic int getSpeed()
public void addDma(DmaEngine dma)
dma
- DMA Engine instance to be addedpublic void addProcessor(Processor proc)
proc
- Processor instance to be addedpublic void addMemory(Memory mem)
mem
- Memory instance to be addedpublic void addLink(NetworkLink lnk, int port)
lnk
- Network Link instance to be added.port
- Port of the cluster where network link is added.