Averest


ScadMachine Type

A SCAD machine consists of the following components:

  • CU is the control unit which reads move instructions from the program memory. It is also responsible for branch and jump instructions, and uses three lanes in its input buffer for this reason:
    • CU.inp[0] is the branch condition lane.
    • CU.inp[1] is the `then' branch target lane.
    • CU.inp[2] is the `else' branch target lane.
    As long as a pc is available in CU.pc, the corresponding move instruction is fetched and issued, and this pc is incremented. Branch instructions are implemented as follows:
    • First move the branch target address to CU.inp[1].
    • Next, issue move instructions to compute the branch condition.
    • Finally, there is move instruction from an output buffer to the CU.inp[0]. If this instruction is issued by the CU, the CU will destroy its CU.pc (making it None), and will move pc+1 to CU.inp[2].
    • If CU.inp can fire, a new pc can be taken, and new instructions can be fetched again.
    The CU stops issuing further instructions as soon as the pc is outside the allowed addresses of the program memory.
  • PU is an array of universal processing units for processing binary operations. Each PU has one input and one output buffer with the following lanes:
    • PU[i].inp.valEntry[0] holds the left operands of binary operation.
    • PU[i].inp.valEntry[1] holds the right operands of a binary operation.
    • PU[i].inp.optEntry holds the opcodes and number of copies.
    • PU[i].out.valEntry[0] holds the result values.
    Each PU registers the move instructions issued by the CU whenever the address is either the source or target address of a move instruction. Moreover, result values are produced whenever input operands are available and there is enough space in the output buffer.
  • The LSU is the load/store unit of the SCAD machine with the following lanes:
    • PU[i].inp.valEntry[0] holds the addresses.
    • PU[i].inp.valEntry[1] holds the values to be stored.
    • PU[i].inp.optEntry holds the opcodes and number of copies, where opcode true means load and false means store.
    • PU[i].out.valEntry[0] holds the result values in case of load operations.
  • The ROB is the reorder unit of the SCAD machine that is used by the code generator whenever the operands are not found in the right order in the output buffers. It is one input and one output lane and simply copies the values from the input to the output buffer lane (so it is essentially just an additional buffer).
  • MemData is the data memory that can be accessed only by the LSU.
  • MemProg is the program memory that can be accessed only by the CU.
We use the following addresses of the functional units
  • 0: CU
  • 1: LSU
  • 2: ROB
  • 3..n+2: PU for the n universal processing units PU[0..n-1]

Record fields

Record Field Description

CU

Full Usage: CU

Field type: ControlUnit

Field type: ControlUnit

LSU

Full Usage: LSU

Field type: (bool * int) ProcUnit

Field type: (bool * int) ProcUnit

MemData

Full Usage: MemData

Field type: int[]

Field type: int[]

MemProg

Full Usage: MemProg

Field type: MoveInstr[]

Field type: MoveInstr[]

PU

Full Usage: PU

Field type: (Ops2 * int) ProcUnit[]

Field type: (Ops2 * int) ProcUnit[]

ROB

Full Usage: ROB

Field type: unit ProcUnit

Field type: unit ProcUnit

Instance members

Instance member Description

this.canEnqAdrInp adr

Full Usage: this.canEnqAdrInp adr

Parameters:
Returns: bool

checks whether an address can be added to an input buffer

adr : int * addressBuf
Returns: bool

this.canEnqAdrOut adr

Full Usage: this.canEnqAdrOut adr

Parameters:
Returns: bool

checks whether an address can be added to an output buffer

adr : int * addressBuf
Returns: bool

this.canEnqValInp (src, tgt)

Full Usage: this.canEnqValInp (src, tgt)

Parameters:
Returns: bool

checks whether a value can be added to an input buffer

src : int * addressBuf
tgt : address
Returns: bool

this.canEnqValOut (arg1, numCopies)

Full Usage: this.canEnqValOut (arg1, numCopies)

Parameters:
Returns: bool

checks whether nc copies of a value can be added to an output buffer

arg0 : address
numCopies : int
Returns: bool

this.canFireInp adrU

Full Usage: this.canFireInp adrU

Parameters:
    adrU : int

Returns: bool

check whether unit adrU can be fired

adrU : int
Returns: bool

this.canFireOut adrU

Full Usage: this.canFireOut adrU

Parameters:
    adrU : int

Returns: bool

check whether the output buffer of unit adrU can send out a value

adrU : int
Returns: bool

this.canIssueMoveInstruction mv

Full Usage: this.canIssueMoveInstruction mv

Parameters:
Returns: bool

check whether instruction mv can be issued

mv : MoveInstr
Returns: bool

this.enqAdrInp (arg1, adr)

Full Usage: this.enqAdrInp (arg1, adr)

Parameters:

add an address to an input buffer if possible

arg0 : address
adr : address

this.enqAdrOut (arg1, adr)

Full Usage: this.enqAdrOut (arg1, adr)

Parameters:

add an address to an output buffer if possible

arg0 : address
adr : address

this.enqValInp (src, tgt, v)

Full Usage: this.enqValInp (src, tgt, v)

Parameters:

add a value v to input buffer tgt that shall be sent from buffer src

src : address
tgt : int * addressBuf
v : value

this.enqValOut (arg1, v, nc)

Full Usage: this.enqValOut (arg1, v, nc)

Parameters:

add a value to an output buffer

arg0 : address
v : value
nc : int

this.fireInp adrU

Full Usage: this.fireInp adrU

Parameters:
    adrU : int

Returns: bool

Fire a functional unit if possible, i.e., if the input buffer is not empty and all fields in the head's fields are defined. A successful firing is reported as return value.

adrU : int
Returns: bool

this.fireOut adrU

Full Usage: this.fireOut adrU

Parameters:
    adrU : int

Returns: bool

Fire an output buffer if possible, i.e., sending some produced value to an input buffer of some other functional unit. An output buffer can be fired iff is not empty, all fields in the head's fields are defined, and there is enough space in the input buffer where the value should be sent to. A successful firing is reported as return value.

adrU : int
Returns: bool

this.issueMoveInstruction mv

Full Usage: this.issueMoveInstruction mv

Parameters:
Returns: bool

issues a move instruction if possible, and reports potential success

mv : MoveInstr
Returns: bool

this.writeTo ostr

Full Usage: this.writeTo ostr

Parameters:

print the buffer entries to output stream

ostr : TextWriter

this.writeToHtml ostr

Full Usage: this.writeToHtml ostr

Parameters:

write the buffer entries as html table to output stream

ostr : TextWriter