From 41317496577dc6289f23cb52b990219eec27f04f Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Wed, 19 Mar 2014 17:47:48 +0000 Subject: Fetch-decode-execute & init for power --- src/test/power.sail | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3