public class Memory extends PlatformComponentProp
Modifier and Type | Field and Description |
---|---|
private Cluster[] |
cluster
Clusters which can access this memory.
|
private int |
latency
Latency of memory access.
|
private int |
numClusters
Number of clusters which can access this memory.
|
private int |
numProcessors
Number of processors which can access this memory.
|
private Processor[] |
proc
Processors which can access this memory.
|
private long |
sizeInBytes
Size of the Memory in bytes.
|
Constructor and Description |
---|
Memory(java.lang.String name,
int id,
long sizeInBytes,
int latency,
int numClusters,
int numProcessors)
Initializes the Memory component of the platform.
|
Modifier and Type | Method and Description |
---|---|
void |
addCluster(Cluster cluster)
Add the cluster which can access this memory.
|
void |
addProcessor(Processor processor)
Add the processor which can access this memory.
|
int |
getLatency()
Gets the latency of the memory access.
|
long |
getSizeInBytes()
Gets the size of the memory in bytes.
|
getId, getName, toString
private final int numProcessors
private final int numClusters
private final long sizeInBytes
private final int latency
private Processor[] proc
private Cluster[] cluster
public Memory(java.lang.String name, int id, long sizeInBytes, int latency, int numClusters, int numProcessors)
name
- name of the memoryid
- id of the memorysizeInBytes
- size of memory in bytes.latency
- latency of access for this memory.numClusters
- number of clusters which can access this memory.numProcessors
- number of processors which can access this memory.public long getSizeInBytes()
public int getLatency()
public void addProcessor(Processor processor)
processor
- processor which can access this memorypublic void addCluster(Cluster cluster)
cluster
- cluster which can access this memory