kiama.example.oberon0.machine

class RISC

[source: kiama/example/oberon0/machine/RISC.scala]

class RISC(code : scala.Seq)
extends Machine
Abstract state machine simulation of a simple RISC architecture.
Type Summary
type Word
Words are 32-bits long.
Value Summary
lazy val FP : Reg
lazy val LNK : Reg
val Mem : State[scala.collection.immutable.Map[Int, Int]]
Byte addressed store of words.
val N : State[Boolean]
Condition code: less than.
lazy val PC : Reg
lazy val R : scala.Array[Reg]
lazy val SP : Reg
val Z : State[Boolean]
Condition code: zero.
val halt : State[java.lang.String]
Halt flag. Undefined until the machine is to stop executing.
Values and Variables inherited from Machine
name
Method Summary
def arithmetic (instr : Instr) : Unit
Execute arithmetic instructions.
def control (instr : Instr) : Unit
Execute control instructions, including default control step.
override def debug : Boolean
Debug flag. Set this to true in sub-classes or objects to obtain tracing information during execution of the machine.
def execute (instr : Instr) : Unit
Execute a single instruction.
def init : Unit
Initialise the machine.
def inputoutput (instr : Instr) : Unit
Execute input/output instructions.
def main : Unit
The main rule of this machine.
def memory (instr : Instr) : Unit
Execute memory instructions.
Methods inherited from Machine
stateTToT, step, steps, run
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
case class Reg (val name : java.lang.String) extends State[Int]
A named register.
Type Details
type Word
Words are 32-bits long.

Value Details
lazy val R : scala.Array[Reg]

lazy val PC : Reg

lazy val FP : Reg

lazy val SP : Reg

lazy val LNK : Reg

val Mem : State[scala.collection.immutable.Map[Int, Int]]
Byte addressed store of words.

val Z : State[Boolean]
Condition code: zero.

val N : State[Boolean]
Condition code: less than.

val halt : State[java.lang.String]
Halt flag. Undefined until the machine is to stop executing.

Method Details
override def debug : Boolean
Debug flag. Set this to true in sub-classes or objects to obtain tracing information during execution of the machine.
Overrides
Machine.debug

def init : Unit
Initialise the machine.
Overrides
Machine.init

def main : Unit
The main rule of this machine.
Overrides
Machine.main

def execute(instr : Instr) : Unit
Execute a single instruction.

def arithmetic(instr : Instr) : Unit
Execute arithmetic instructions.

def memory(instr : Instr) : Unit
Execute memory instructions.

def control(instr : Instr) : Unit
Execute control instructions, including default control step.

def inputoutput(instr : Instr) : Unit
Execute input/output instructions.