From: Konstantinos Margaritis Date: Mon, 20 Mar 2023 09:40:46 +0000 (+0000) Subject: Pass object code filename instead of actual data X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8bf14994843e91ea6029bdbadfc4e70ddf24d11;p=openpower-isa.git Pass object code filename instead of actual data This enables compilation on non-Power architectures. --- diff --git a/src/openpower/decoder/isa/pypowersim.py b/src/openpower/decoder/isa/pypowersim.py index 4cb32a6b..fed3091f 100644 --- a/src/openpower/decoder/isa/pypowersim.py +++ b/src/openpower/decoder/isa/pypowersim.py @@ -281,13 +281,13 @@ def help(): exit(-1) -def run_a_simulation(binary, bigendian, prog, +def run_a_simulation(binaryname, bigendian, prog, qemu_cosim, initial_regs, initial_sprs, svstate, mmu, initial_cr, initial_mem, initial_fprs, initial_pc): - log ("binary", binary) + log ("binaryname", binaryname) log ("bigendian", bigendian) log ("prog", prog) log ("qemu_cosim", qemu_cosim) @@ -300,6 +300,9 @@ def run_a_simulation(binary, bigendian, prog, log ("initial_fprs", initial_fprs) log ("initial_pc", initial_pc) + with open(binaryname, "rb") as f: + binary = f.read() + with Program(binary, bigendian=bigendian, orig_filename=None) as prog: simulator, qemu = run_tst(None, prog, qemu_cosim, initial_regs,