object RISCTree
Module containing structures for representing RISC machine programs. In essence this is a register-less assembly code, in which the flow of data between constructs is represented in the parent-child relationships of a tree structure.
- Source
- RISCTree.scala
- Alphabetic
- By Inheritance
- RISCTree
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
AddW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Add two word values and return the sum l + r.
-
sealed abstract
class
Address
extends RISCTree
Memory addresses that can be stored to or loaded from.
-
case class
Beq
(cond: Datum, dest: Label) extends Item with Product with Serializable
Branch to the given label if the value of the given datum is equal to zero.
-
case class
Bne
(cond: Datum, dest: Label) extends Item with Product with Serializable
Branch to the given label if the value of the given datum is not equal to zero.
-
case class
CmpeqW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Compare two word values for equality and return 1 if they are equal and 0 if they are not.
-
case class
CmpgtW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Compare two word values and return 1 if the left operand is greater then the right operands, otherwise return 0.
-
case class
CmpltW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Compare two word values and return 1 if the left operand is less then the right operands, otherwise return 0.
-
case class
CmpneW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Compare two word values for inequality and return 1 if they are equal and 0 if they are not.
-
case class
Cond
(cond: Datum, t: Datum, f: Datum) extends Datum with Product with Serializable
Evaluate cond and if the value is true (non-zero) return the value of t, else return the value of f.
-
sealed abstract
class
Datum
extends RISCTree with NeedsRegister
Superclass of all datum constructs, ie target constructs that return a value to their enclosing construct.
Superclass of all datum constructs, ie target constructs that return a value to their enclosing construct. reg is the local register (%l1 to %l7) that is being used to store the value of this datum (set by the encoder).
-
case class
DivW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Divide two word values and return the dividend from l / r.
-
case class
Indexed
(base: Local, offset: Datum) extends Address with NeedsRegister with Product with Serializable
An address that is calculated by a indexing from the local address addr.
An address that is calculated by a indexing from the local address addr. In this case the offset is calculated by a datum.
-
case class
IntDatum
(num: Int) extends Datum with Product with Serializable
Return the given integer value.
-
sealed abstract
class
Item
extends RISCTree
Superclass of all item constructs, ie.
Superclass of all item constructs, ie. target constructs that do not return a value to their enclosing construct.
-
case class
Jmp
(dest: Label) extends Item with Product with Serializable
Jump unconditionally to the given label.
-
case class
Label
(num: Int) extends Product with Serializable
Labels represent a code position.
-
case class
LabelDef
(lab: Label) extends Item with Product with Serializable
Define the given at this point in the item sequence.
-
case class
LdW
(mem: Address) extends Datum with Product with Serializable
Load a value from memory address given by mem.
-
case class
Local
(offset: Int) extends Address with Product with Serializable
An address that is calculated by an known integer offset from the start of the local memory block.
-
case class
MulW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Multiple two word values and return l * r.
-
trait
NeedsRegister
extends RISCTree
Trait to mark those nodes which need to have a return value allocated to a register.
-
case class
NegW
(d: Datum) extends Datum with Product with Serializable
Negate a word value and return the negation of e.
-
case class
Not
(d: Datum) extends Datum with Product with Serializable
Complement a Boolean value.
-
case class
RISCProg
(insns: Seq[Item]) extends RISCTree with Product with Serializable
A stack program consisting of the given statements.
-
sealed abstract
class
RISCTree
extends TreeNode
Superclass of all RISC tree nodes.
-
case class
Read
() extends Datum with Product with Serializable
Read an integer value from standard input.
-
case class
RemW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Divide two word values and return the remainder from l / r.
-
case class
Ret
() extends Item with Product with Serializable
Cause the program to terminate.
-
case class
SequenceDatum
(insns: Seq[Item], d: Datum) extends Datum with Product with Serializable
A compound datum, consisting of a sequence of items to execute followed by a datum whose value is evaluated and returned.
-
case class
StW
(mem: Address, d: Datum) extends Item with Product with Serializable
Evaluate d and store its value in the memory location given by mem.
-
case class
SubW
(l: Datum, r: Datum) extends Datum with Product with Serializable
Subtract two word values and return the difference l - r.
-
case class
Write
(d: Datum) extends Item with Product with Serializable
Calculate and write out the value of the given datum to standard output.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )