public class Processor extends PlatformComponentProp
Modifier and Type | Field and Description |
---|---|
private Cluster |
cluster
Cluster to which this processor belongs to.
|
private NetworkLink[] |
links
Links connected to the processor.
|
private Memory[] |
memory
Memories of the processor
|
private int |
numLinks
Number of network links connected to the processor
|
private int |
numMemory
Number of memories in direct access to this processor.
|
private int |
speed
Speed of the processor.
|
Constructor and Description |
---|
Processor(java.lang.String name,
int id,
int speed,
int numLinks,
int numMemory,
Cluster cluster)
Initialize the processor component of the platform model.
|
Modifier and Type | Method and Description |
---|---|
void |
addLink(NetworkLink lnk,
int port)
Adds network link at the port of the processor
|
void |
addMemory(Memory mem)
Adds a memory component to the processor at next available index.
|
Cluster |
getCluster()
Gets the cluster to which this processor belongs to.
|
NetworkLink |
getLink(int index)
Gets the network link at a particular index.
|
Memory |
getMemory(int index)
Gets the memory at a particular index.
|
int |
getNumLinks()
Gets number of links connected to the processor
|
int |
getnumMemory()
Gets number of memories accessed by the processor
|
int |
getSpeed()
Gets the speed of the processor
|
getId, getName, toString
private final int speed
private final int numLinks
private final int numMemory
private final Cluster cluster
private Memory[] memory
private NetworkLink[] links
public Processor(java.lang.String name, int id, int speed, int numLinks, int numMemory, Cluster cluster)
name
- name of the processorid
- id of the processorspeed
- speed of the processornumLinks
- number of links connected to the processornumMemory
- number of memories accessed by the processorcluster
- cluster to which the processor belongs topublic int getSpeed()
public int getNumLinks()
public int getnumMemory()
public NetworkLink getLink(int index)
index
- index of the network linkpublic Memory getMemory(int index)
index
- index of the memorypublic void addMemory(Memory mem)
mem
- memory component to addpublic void addLink(NetworkLink lnk, int port)
lnk
- network link to be addedport
- port at which network link is added (port < numLinks)public Cluster getCluster()