Commit acd35444 authored by George Hotz's avatar George Hotz

add test run of test.bin

parent d34531cd
...@@ -15,9 +15,8 @@ jobs: ...@@ -15,9 +15,8 @@ jobs:
sudo apt-get -y --no-install-recommends install golang-1.16 nodejs npm sudo apt-get -y --no-install-recommends install golang-1.16 nodejs npm
- name: Install unicorn - name: Install unicorn
run: | run: |
curl -LO https://github.com/unicorn-engine/unicorn/archive/1.0.3.tar.gz git clone https://github.com/geohot/unicorn.git
tar xf 1.0.3.tar.gz cd unicorn
cd unicorn-1.0.3
UNICORN_ARCHS=mips make -j8 UNICORN_ARCHS=mips make -j8
sudo UNICORN_ARCHS=mips make install sudo UNICORN_ARCHS=mips make install
- name: Install yarn - name: Install yarn
...@@ -26,3 +25,5 @@ jobs: ...@@ -26,3 +25,5 @@ jobs:
yarn install yarn install
- name: Test MIPS on EVM - name: Test MIPS on EVM
run: cd mipsevm && ./evm.sh run: cd mipsevm && ./evm.sh
- name: Compare test.bin run on EVM/unicorn
run: cd mipsevm && go test
#!/bin/bash #!/bin/bash
git clone https://github.com/geohot/unicorn.git -b dev git clone https://github.com/geohot/unicorn.git
cd unicorn cd unicorn
UNICORN_ARCHS=mips make -j8 UNICORN_ARCHS=mips make -j8
UNICORN_ARCHS=mips make -j8 UNICORN_ARCHS=mips make -j8
......
__pycache__ __pycache__
go-ethereum go-ethereum
sysroot sysroot
test test/test
test.bin
minigeth minigeth
minigeth.bin minigeth.bin
...@@ -10,8 +10,9 @@ import ( ...@@ -10,8 +10,9 @@ import (
) )
func RegSerialize(ram map[uint32](uint32)) []uint32 { func RegSerialize(ram map[uint32](uint32)) []uint32 {
ret := []uint32{ram[0xc0000080], ram[0xc00000A0], uint32(len(ram))} ret := []uint32{ram[0xc0000080], uint32(len(ram))}
for i := uint32(0xc0000000); i < 0xc0000000+37*4; i += 4 { // 36 registers, 32 basic + pc + hi/lo + heap
for i := uint32(0xc0000000); i < 0xc0000000+36*4; i += 4 {
ret = append(ret, ram[i]) ret = append(ret, ram[i])
} }
return ret return ret
......
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