-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for implicit arguments in function application
- Loading branch information
Showing
3 changed files
with
59 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Out.Sail.Sail | ||
|
||
open Sail | ||
|
||
abbrev SailM := StateM Unit | ||
|
||
/-- Type quantifiers: k_n : Int, m : Int, m ≥ k_n -/ | ||
def EXTZ {m : _} (v : (BitVec k_n)) : (BitVec m) := | ||
(Sail.BitVec.zeroExtend v m) | ||
|
||
def foo (x : (BitVec 8)) : (BitVec 16) := | ||
(EXTZ x) | ||
|
||
def initialize_registers (lit : Unit) : 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> | ||
|
||
val EXTZ : forall 'n 'm, 'm >= 'n. (implicit('m), bits('n)) -> bits('m) | ||
function EXTZ(m, v) = sail_zero_extend(v, m) | ||
|
||
val foo : bits(8) -> bits(16) | ||
function foo x = { | ||
EXTZ(x) | ||
} |