-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First Keccak precompiled. Binary basic draft. (#76)
* Create ZiskInst::op_type() * First draft of keccak precompiled * Call opcode_execute from binary basic SM * Fix shift direction in Emu::step_slice()
- Loading branch information
Showing
19 changed files
with
833 additions
and
280 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use crate::{Mem, ROM_ENTRY}; | ||
|
||
/// ZisK instruction context data container, storing the state of the execution | ||
pub struct InstContext { | ||
pub mem: Mem, | ||
pub a: u64, | ||
pub b: u64, | ||
pub c: u64, | ||
pub flag: bool, | ||
pub sp: u64, | ||
pub pc: u64, | ||
pub step: u64, | ||
pub end: bool, | ||
} | ||
|
||
/// RisK instruction context implementation | ||
impl InstContext { | ||
/// RisK instruction context constructor | ||
pub fn new() -> InstContext { | ||
InstContext { | ||
mem: Mem::new(), | ||
a: 0, | ||
b: 0, | ||
c: 0, | ||
flag: false, | ||
sp: 0, | ||
pc: ROM_ENTRY, | ||
step: 0, | ||
end: false, | ||
} | ||
} | ||
} | ||
|
||
impl Default for InstContext { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.