Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
27bf62a6
Commit
27bf62a6
authored
Oct 16, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor test touch up
parent
5244cf21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
MIPS.sol
contracts/MIPS.sol
+1
-1
compare_test.go
mipsevm/compare_test.go
+13
-13
No files found.
contracts/MIPS.sol
View file @
27bf62a6
...
...
@@ -44,7 +44,7 @@ contract MIPS {
if (address(m) != address(0)) {
emit DidWriteMemory(addr, value);
bytes32 newStateHash = m.WriteMemory(stateHash, addr, value);
require(ReadMemory(newStateHash, addr) == value, "memory readback check failed");
require(
m.
ReadMemory(newStateHash, addr) == value, "memory readback check failed");
return newStateHash;
} else {
assembly {
...
...
mipsevm/compare_test.go
View file @
27bf62a6
...
...
@@ -2,28 +2,28 @@ package main
import
(
"fmt"
uc
"github.com/unicorn-engine/unicorn/bindings/go/unicorn"
"log"
"sync"
"testing"
"time"
)
func
RegSerialize
(
ram
map
[
uint32
](
uint32
))
[]
uint32
{
ret
:=
[]
uint32
{
ram
[
0xc0000080
],
uint32
(
len
(
ram
))}
// 36 registers, 32 basic + pc + hi/lo + heap
for
i
:=
uint32
(
0xc0000000
);
i
<
0xc0000000
+
36
*
4
;
i
+=
4
{
ret
=
append
(
ret
,
ram
[
i
])
}
return
ret
}
var
done
sync
.
Mutex
uc
"github.com/unicorn-engine/unicorn/bindings/go/unicorn"
)
func
TestCompare
(
t
*
testing
.
T
)
{
func
TestCompare
UnicornEvm
(
t
*
testing
.
T
)
{
fn
:=
"../mipigo/test/test.bin"
//fn := "../mipigo/minigeth.bin"
var
done
sync
.
Mutex
RegSerialize
:=
func
(
ram
map
[
uint32
](
uint32
))
[]
uint32
{
ret
:=
[]
uint32
{
ram
[
0xc0000080
],
uint32
(
len
(
ram
))}
// 36 registers, 32 basic + pc + hi/lo + heap
for
i
:=
uint32
(
0xc0000000
);
i
<
0xc0000000
+
36
*
4
;
i
+=
4
{
ret
=
append
(
ret
,
ram
[
i
])
}
return
ret
}
steps
:=
1000000000
//steps := 1165
//steps := 1180
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment