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
fada13be
Commit
fada13be
authored
Oct 04, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
profile minigeth...no real hot spots
parent
c9024c00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
MIPS.sol
contracts/MIPS.sol
+1
-2
main.go
minigeth/main.go
+12
-2
No files found.
contracts/MIPS.sol
View file @
fada13be
...
@@ -73,7 +73,6 @@ contract MIPS {
...
@@ -73,7 +73,6 @@ contract MIPS {
return uint32(dat&mask | (isSigned ? signed : 0));
return uint32(dat&mask | (isSigned ? signed : 0));
}
}
function handleSyscall(bytes32 stateHash) internal returns (bytes32) {
function handleSyscall(bytes32 stateHash) internal returns (bytes32) {
uint32 syscall_no = ReadMemory(stateHash, REG_OFFSET+2*4);
uint32 syscall_no = ReadMemory(stateHash, REG_OFFSET+2*4);
uint32 v0 = 0;
uint32 v0 = 0;
...
@@ -215,7 +214,7 @@ contract MIPS {
...
@@ -215,7 +214,7 @@ contract MIPS {
if (opcode == 0 && func >= 8 && func < 0x1c) {
if (opcode == 0 && func >= 8 && func < 0x1c) {
if (func == 8 || func == 9) {
if (func == 8 || func == 9) {
// jr/jalr
// jr/jalr
return branchDelay(stateHash, nextPC,
val
| (func == 9 ? PC_FLAG : 0));
return branchDelay(stateHash, nextPC,
rs
| (func == 9 ? PC_FLAG : 0));
}
}
// handle movz and movn when they don't write back
// handle movz and movn when they don't write back
...
...
minigeth/main.go
View file @
fada13be
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"log"
"log"
"math/big"
"math/big"
"os"
"os"
"runtime/pprof"
"strconv"
"strconv"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
...
@@ -27,8 +28,14 @@ func check(err error) {
...
@@ -27,8 +28,14 @@ func check(err error) {
}
}
func
main
()
{
func
main
()
{
// init secp256k1BytePoints
if
len
(
os
.
Args
)
>
2
{
crypto
.
S256
()
f
,
err
:=
os
.
Create
(
os
.
Args
[
2
])
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
pprof
.
StartCPUProfile
(
f
)
defer
pprof
.
StopCPUProfile
()
}
// non mips
// non mips
if
len
(
os
.
Args
)
>
1
{
if
len
(
os
.
Args
)
>
1
{
...
@@ -43,6 +50,9 @@ func main() {
...
@@ -43,6 +50,9 @@ func main() {
fmt
.
Println
(
"commited transactions"
,
hash
,
err
)
fmt
.
Println
(
"commited transactions"
,
hash
,
err
)
}
}
// init secp256k1BytePoints
crypto
.
S256
()
// read start block header
// read start block header
var
parent
types
.
Header
var
parent
types
.
Header
check
(
rlp
.
DecodeBytes
(
oracle
.
Preimage
(
oracle
.
Input
(
0
)),
&
parent
))
check
(
rlp
.
DecodeBytes
(
oracle
.
Preimage
(
oracle
.
Input
(
0
)),
&
parent
))
...
...
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