-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
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
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,69 @@ | ||
import Sail.sail | ||
|
||
structure cr_type where | ||
bits : BitVec 8 | ||
|
||
|
||
def undefined_cr_type (lit : Unit) : cr_type := | ||
sorry | ||
|
||
def Mk_cr_type (v : BitVec 8) : cr_type := | ||
{bits := v} | ||
|
||
def _get_cr_type_bits (v : cr_type) : BitVec 8 := | ||
(Sail.BitVec.extractLsb v.bits (HSub.hSub 8 1) 0) | ||
|
||
def _update_cr_type_bits (v : cr_type) (x : BitVec 8) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits (HSub.hSub 8 1) 0 x)} | ||
|
||
def _set_cr_type_bits (r_ref : Register cr_type) (v : BitVec 8) : Unit := | ||
sorry | ||
|
||
def _get_cr_type_CR0 (v : cr_type) : BitVec 4 := | ||
(Sail.BitVec.extractLsb v.bits 7 4) | ||
|
||
def _update_cr_type_CR0 (v : cr_type) (x : BitVec 4) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits 7 4 x)} | ||
|
||
def _set_cr_type_CR0 (r_ref : Register cr_type) (v : BitVec 4) : Unit := | ||
sorry | ||
|
||
def _get_cr_type_CR1 (v : cr_type) : BitVec 2 := | ||
(Sail.BitVec.extractLsb v.bits 3 2) | ||
|
||
def _update_cr_type_CR1 (v : cr_type) (x : BitVec 2) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits 3 2 x)} | ||
|
||
def _set_cr_type_CR1 (r_ref : Register cr_type) (v : BitVec 2) : Unit := | ||
sorry | ||
|
||
def _get_cr_type_CR3 (v : cr_type) : BitVec 2 := | ||
(Sail.BitVec.extractLsb v.bits 1 0) | ||
|
||
def _update_cr_type_CR3 (v : cr_type) (x : BitVec 2) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits 1 0 x)} | ||
|
||
def _set_cr_type_CR3 (r_ref : Register cr_type) (v : BitVec 2) : Unit := | ||
sorry | ||
|
||
def _get_cr_type_GT (v : cr_type) : BitVec 1 := | ||
(Sail.BitVec.extractLsb v.bits 6 6) | ||
|
||
def _update_cr_type_GT (v : cr_type) (x : BitVec 1) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits 6 6 x)} | ||
|
||
def _set_cr_type_GT (r_ref : Register cr_type) (v : BitVec 1) : Unit := | ||
sorry | ||
|
||
def _get_cr_type_LT (v : cr_type) : BitVec 1 := | ||
(Sail.BitVec.extractLsb v.bits 7 7) | ||
|
||
def _update_cr_type_LT (v : cr_type) (x : BitVec 1) : cr_type := | ||
{v with bits := (Sail.BitVec.update_subrange v.bits 7 7 x)} | ||
|
||
def _set_cr_type_LT (r_ref : Register cr_type) (v : BitVec 1) : Unit := | ||
sorry | ||
|
||
def initialize_registers : Unit := | ||
() | ||
|
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,11 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
bitfield cr_type : bits(8) = { | ||
CR0 : 7 .. 4, | ||
LT : 7, | ||
GT : 6, | ||
CR1 : 3 .. 2, | ||
CR3 : 1 .. 0 | ||
} |