summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Kerneis2014-03-19 17:47:48 +0000
committerGabriel Kerneis2014-03-19 17:47:48 +0000
commit41317496577dc6289f23cb52b990219eec27f04f (patch)
tree22138e53311768f354627bdf076e41ec1471652e /src
parent37998039c75a6521fb91a5664aa0a3dce8879155 (diff)
Fetch-decode-execute & init for power
Diffstat (limited to 'src')
-rw-r--r--src/test/power.sail18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/test/power.sail b/src/test/power.sail
index ba7d76c7..07b74c60 100644
--- a/src/test/power.sail
+++ b/src/test/power.sail
@@ -120,10 +120,24 @@ end ast
register ast instr (* monitor decoded instructions *)
-function rec unit main () = {
+(* fetch-decode-execute loop *)
+function rec unit fde_loop () = {
NIA := CIA + 4;
instr := decode(MEM(CIA, 4));
execute(instr);
CIA := NIA;
- main ()
+ fde_loop ()
+}
+
+function unit init() = {
+ (* CIA is initialiazed externally, as well as MEM *)
+
+ GPR1 := 0;
+
+
+}
+
+function unit main () = {
+ init();
+ fde_loop();
}