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
e499ee78
Commit
e499ee78
authored
Oct 11, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
man, i should've done that way sooner
parent
a987b367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
17 deletions
+3
-17
compare_test.go
mipsevm/compare_test.go
+3
-3
unicorn.go
mipsevm/unicorn.go
+0
-14
No files found.
mipsevm/compare_test.go
View file @
e499ee78
...
...
@@ -20,9 +20,9 @@ func RegSerialize(ram map[uint32](uint32)) []uint32 {
var
done
sync
.
Mutex
func
TestCompare
(
t
*
testing
.
T
)
{
fn
:=
"../mipigeth/test.bin"
//
fn := "../mipigeth/test.bin"
//fn := "test/bin/sc.bin"
//
fn := "../mipigeth/minigeth.bin"
fn
:=
"../mipigeth/minigeth.bin"
steps
:=
10000000
//steps := 1165
...
...
@@ -59,7 +59,7 @@ func TestCompare(t *testing.T) {
fmt
.
Println
(
"both processes exited"
)
break
}
if
i
%
1000
==
0
{
if
i
%
1000
00
==
0
{
fmt
.
Println
(
i
,
x
[
0
:
9
],
y
[
0
:
9
])
}
for
j
:=
0
;
j
<
len
(
x
);
j
++
{
...
...
mipsevm/unicorn.go
View file @
e499ee78
...
...
@@ -43,20 +43,6 @@ func WriteRam(ram map[uint32](uint32), addr uint32, value uint32) {
var
REG_OFFSET
uint32
=
0xc0000000
var
REG_PC
uint32
=
REG_OFFSET
+
0x20
*
4
var
REG_HEAP
uint32
=
REG_OFFSET
+
0x23
*
4
var
REG_PENDPC
uint32
=
REG_OFFSET
+
0x24
*
4
var
PC_PEND
uint32
=
0x80000000
var
PC_MASK
uint32
=
0x7FFFFFFF
func
SE
(
dat
uint32
,
idx
uint32
)
uint32
{
isSigned
:=
(
dat
>>
(
idx
-
1
))
!=
0
signed
:=
((
1
<<
(
32
-
idx
))
-
1
)
<<
idx
mask
:=
(
1
<<
idx
)
-
1
ret
:=
dat
&
uint32
(
mask
)
if
isSigned
{
ret
|=
uint32
(
signed
)
}
return
ret
}
func
SyncRegs
(
mu
uc
.
Unicorn
,
ram
map
[
uint32
](
uint32
))
{
pc
,
_
:=
mu
.
RegRead
(
uc
.
MIPS_REG_PC
)
...
...
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