Commit 54646cb4 authored by George Hotz's avatar George Hotz

first 1,000,000 steps match

parent b5ad9990
...@@ -3,6 +3,7 @@ echo "compiling" ...@@ -3,6 +3,7 @@ echo "compiling"
./build.sh ./build.sh
COMPILE=1 ./run.py COMPILE=1 ./run.py
echo "running in go" echo "running in go"
export STEPS=1000000
$(cd ../mipsevm && DEBUG=1 ./evm.sh /tmp/minigeth.bin > /tmp/gethtrace) $(cd ../mipsevm && DEBUG=1 ./evm.sh /tmp/minigeth.bin > /tmp/gethtrace)
echo "compare" echo "compare"
./simple.py ./simple.py
...@@ -102,10 +102,6 @@ def hook_code_simple(uc, address, size, user_data): ...@@ -102,10 +102,6 @@ def hook_code_simple(uc, address, size, user_data):
assert address == pc assert address == pc
assert size == 4 assert size == 4
# check for BDS
# UGH! there should be a better way to do this
dat = next(md.disasm(uc.mem_read(address, size), address))
inst = struct.unpack(">I", uc.mem_read(pc, 4))[0] inst = struct.unpack(">I", uc.mem_read(pc, 4))[0]
regs = [] regs = []
# starting at AT # starting at AT
...@@ -116,12 +112,14 @@ def hook_code_simple(uc, address, size, user_data): ...@@ -116,12 +112,14 @@ def hook_code_simple(uc, address, size, user_data):
ss = "%7d %8X %08X : " % (step, pc, inst) + rr ss = "%7d %8X %08X : " % (step, pc, inst) + rr
sgt = gtf.readline().strip("\n") sgt = gtf.readline().strip("\n")
if ss != sgt: if ss != sgt:
dat = next(md.disasm(uc.mem_read(address, size), address))
print(dat)
print(colored(ss, 'green')) print(colored(ss, 'green'))
print(colored(sgt, 'red')) print(colored(sgt, 'red'))
os._exit(0) os._exit(0)
else: else:
if step % 1000 == 0:
print(ss) print(ss)
print(dat)
step += 1 step += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment