Class MmuSubsystem.Builder
- java.lang.Object
-
- ru.ispras.microtesk.mmu.model.spec.MmuSubsystem.Builder
-
- Enclosing class:
- MmuSubsystem
public static final class MmuSubsystem.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MmuSubsystem
build()
MmuAddressInstance
getAddress(java.lang.String name)
MmuBuffer
getBuffer(java.lang.String name)
void
registerAction(MmuAction action)
Registers the action in the memory management unit.void
registerAddress(MmuAddressInstance address)
Registers the address type in the MMU.void
registerBuffer(MmuBuffer buffer)
Registers a buffer in the MMU.void
registerOperation(MmuOperation operation)
Registers an operation in the MMU.void
registerSegment(MmuSegment segment)
Registers a segment in the MMU.void
registerTransition(MmuTransition transition)
Registers the transition in the memory management unit.void
registerVariable(ru.ispras.fortress.expression.NodeVariable variable)
void
registerVariable(MmuStruct struct)
void
setDataVariable(ru.ispras.fortress.expression.NodeVariable variable)
void
setName(java.lang.String name)
void
setPhysicalAddress(MmuAddressInstance address)
void
setStartAction(MmuAction action)
Sets the initial (root) action of the memory management unit.void
setTargetBuffer(MmuBuffer buffer)
Sets the target buffer (the main memory device).void
setVirtualAddress(MmuAddressInstance address)
-
-
-
Method Detail
-
build
public MmuSubsystem build()
-
setName
public void setName(java.lang.String name)
-
registerVariable
public void registerVariable(ru.ispras.fortress.expression.NodeVariable variable)
-
registerVariable
public void registerVariable(MmuStruct struct)
-
setDataVariable
public void setDataVariable(ru.ispras.fortress.expression.NodeVariable variable)
-
registerAddress
public void registerAddress(MmuAddressInstance address)
Registers the address type in the MMU. Address that have the same name are considered as duplicates and ignored.- Parameters:
address
- the address to be registered.- Throws:
java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
getAddress
public MmuAddressInstance getAddress(java.lang.String name)
-
setVirtualAddress
public void setVirtualAddress(MmuAddressInstance address)
-
setPhysicalAddress
public void setPhysicalAddress(MmuAddressInstance address)
-
setTargetBuffer
public void setTargetBuffer(MmuBuffer buffer)
Sets the target buffer (the main memory device).- Parameters:
buffer
- the buffer to be set.- Throws:
java.lang.IllegalArgumentException
- ifbuffer
isnull
.
-
registerOperation
public void registerOperation(MmuOperation operation)
Registers an operation in the MMU.- Parameters:
operation
- the operation to be registered.- Throws:
java.lang.IllegalArgumentException
- ifoperation
isnull
.
-
registerSegment
public void registerSegment(MmuSegment segment)
Registers a segment in the MMU.- Parameters:
segment
- the segment to be registered.- Throws:
java.lang.IllegalArgumentException
- ifsegment
isnull
.
-
registerBuffer
public void registerBuffer(MmuBuffer buffer)
Registers a buffer in the MMU.Buffers are identified by their name. Buffers with equal names are considered duplicates and ignored.
- Parameters:
buffer
- the buffer to be registered.- Throws:
java.lang.IllegalArgumentException
- ifbuffer
isnull
.
-
getBuffer
public MmuBuffer getBuffer(java.lang.String name)
-
registerAction
public void registerAction(MmuAction action)
Registers the action in the memory management unit.Actions should be registered before transitions.
- Parameters:
action
- the action to be registered.- Throws:
java.lang.IllegalArgumentException
- ifaction
is null.
-
registerTransition
public void registerTransition(MmuTransition transition)
Registers the transition in the memory management unit.Transitions should be registered after actions.
- Parameters:
transition
- the transition to be registered.- Throws:
java.lang.IllegalArgumentException
- iftransition
is null.
-
setStartAction
public void setStartAction(MmuAction action)
Sets the initial (root) action of the memory management unit.- Parameters:
action
- the initial action.- Throws:
java.lang.IllegalArgumentException
- ifaction
is null.
-
-