add function for calling a simulation
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 19 Sep 2022 08:15:18 +0000 (09:15 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 19 Sep 2022 08:15:18 +0000 (09:15 +0100)
src/openpower/decoder/isa/pypowersim.py

index 20edf56560b248df965d17cb6430a7803e2e3737..f19de83fa21f44797ffba47c231f49464b019ee4 100644 (file)
@@ -281,6 +281,21 @@ def help():
     exit(-1)
 
 
+def run_a_simulation(lst, bigendian, orig_filename,
+                     prog, qemu_cosim, initial_regs,
+                     initial_sprs, svstate, mmu,
+                     initial_cr, mem,
+                     initial_fprs, initial_pc):
+
+    with Program(lst, bigendian=bigendian, orig_filename=binaryname) as prog:
+        simulator, qemu = run_tst(None, prog, qemu_cosim,
+                            initial_regs,
+                            initial_sprs=initial_sprs,
+                            svstate=svstate, mmu=mmu,
+                            initial_cr=initial_cr, mem=initial_mem,
+                            initial_fprs=initial_fprs,
+                            initial_pc=initial_pc)
+
 def run_simulation():
 
     binaryname = None