package libsail

  1. Overview
  2. Docs
Sail is a language for describing the instruction semantics of processors

Install

Dune Dependency

Authors

Maintainers

Sources

sail-0.18.tbz
sha256=fcdbda14f1ed59fa30e23da34abe02547416e3c2a83fbeee5606e100a5edcf35
sha512=0bbd72706cb4c1ddf13ea1c42004ec498aa9db8a301020f0dd3d8ac582d1bed8a48c7a825b8e3e6f629279f1f900384f6966608e1cd59e7b1217776413c7fa27

doc/libsail/Libsail/Interpreter/index.html

Module Libsail.InterpreterSource

Sourcemodule Printer : sig ... end
Sourcetype gstate = {
  1. registers : Value.value Ast_util.Bindings.t;
  2. allow_registers : bool;
  3. primops : (Value.value list -> Value.value) Value.StringMap.t;
  4. letbinds : Type_check.tannot Ast.letbind list;
  5. fundefs : Type_check.tannot Ast.fundef Ast_util.Bindings.t;
  6. last_write_ea : (Value.value * Value.value * Value.value) option;
  7. typecheck_env : Type_check.Env.t;
}
Sourcetype lstate = {
  1. locals : Value.value Ast_util.Bindings.t;
}
Sourcetype state = lstate * gstate
Sourceval value_of_lit : Ast.lit -> Value.value
Sourceval is_value : 'a Ast.exp -> bool
Sourceval is_true : 'a Ast.exp -> bool
Sourceval is_false : 'a Ast.exp -> bool
Sourceval value_of_exp : 'a Ast.exp -> Value.value
Sourcetype return_value =
  1. | Return_ok of Value.value
  2. | Return_exception of Value.value
Sourcetype 'a response =
  1. | Early_return of Value.value
  2. | Exception of Value.value
  3. | Assertion_failed of string
  4. | Call of Ast.id * Value.value list * return_value -> 'a
  5. | Fail of string
  6. | Read_mem of Value.value * Value.value * Value.value * Value.value -> 'a
  7. | Write_ea of Value.value * Value.value * Value.value * unit -> 'a
  8. | Excl_res of bool -> 'a
  9. | Write_mem of Value.value * Value.value * Value.value * Value.value * bool -> 'a
  10. | Barrier of Value.value * unit -> 'a
  11. | Read_reg of string * Value.value -> 'a
  12. | Write_reg of string * Value.value * unit -> 'a
  13. | Get_primop of string * (Value.value list -> Value.value) -> 'a
  14. | Get_local of string * Value.value -> 'a
  15. | Put_local of string * Value.value * unit -> 'a
  16. | Get_global_letbinds of Type_check.tannot Ast.letbind list -> 'a
Sourceand 'a monad =
  1. | Pure of 'a
  2. | Yield of 'a monad response
Sourceval map_response : ('a -> 'b) -> 'a response -> 'b response
Sourceval liftM : ('a -> 'b) -> 'a monad -> 'b monad
Sourceval return : 'a -> 'a monad
Sourceval bind : 'a monad -> ('a -> 'b monad) -> 'b monad
Sourceval (>>=) : 'a monad -> ('a -> 'b monad) -> 'b monad
Sourceval (>>) : unit monad -> 'a monad -> 'a monad
Sourcetype ('a, 'b) either =
  1. | Left of 'a
  2. | Right of 'b
Sourceval catch : 'a monad -> (Value.value, 'a) either monad
Sourceval throw : Value.value -> 'a monad
Sourceval write_ea : Value.value -> Value.value -> Value.value -> unit monad
Sourceval excl_res : unit -> bool monad
Sourceval write_mem : Value.value -> Value.value -> Value.value -> Value.value -> bool monad
Sourceval barrier : Value.value -> unit monad
Sourceval read_reg : string -> Value.value monad
Sourceval write_reg : string -> Value.value -> unit monad
Sourceval fail : string -> 'a monad
Sourceval get_primop : string -> (Value.value list -> Value.value) monad
Sourceval get_local : string -> Value.value monad
Sourceval put_local : string -> Value.value -> unit monad
Sourceval get_global_letbinds : unit -> Type_check.tannot Ast.letbind list monad
Sourceval early_return : Value.value -> 'a monad
Sourceval assertion_failed : string -> 'a monad
Sourceval liftM2 : ('a -> 'b -> 'c) -> 'a monad -> 'b monad -> 'c monad
Sourceval letbind_pat_ids : 'a Ast.letbind -> Ast_util.IdSet.t
Sourceval unit_exp : 'a Ast.exp_aux
Sourceval is_value_fexp : 'a Ast.fexp -> bool
Sourceval value_of_fexp : 'a Ast.fexp -> string * Value.value
Sourceval build_letchain : Ast_util.IdSet.elt -> 'a Ast.letbind list -> 'a Ast.exp -> 'a Ast.exp
Sourceval is_interpreter_extern : Ast.id -> Type_check.Env.t -> bool
Sourceval get_interpreter_extern : Ast.id -> Type_check.Env.t -> string
Sourcetype partial_binding =
  1. | Complete_binding of Value.value
  2. | Partial_binding of (Value.value * Libsail.Value.Big_int.num * Libsail.Value.Big_int.num) list
Sourceval combine : 'a -> partial_binding option -> partial_binding option -> partial_binding option
Sourceval defs_letbinds : ('a, 'b) Ast.def list -> 'a Ast.letbind list
Sourceval initial_lstate : lstate
Sourceval stack_cont : ('a * 'b * 'c) -> 'c
Sourceval stack_string : ('a * 'b * 'c) -> 'a
Sourceval stack_state : ('a * 'b * 'c) -> 'b
Sourcetype frame =
  1. | Done of state * Value.value
  2. | Step of string Lazy.t * state * Type_check.tannot Ast.exp monad * (string Lazy.t * lstate * (return_value -> Type_check.tannot Ast.exp monad)) list
  3. | Break of frame
  4. | Effect_request of string Lazy.t * state * (string Lazy.t * lstate * (return_value -> Type_check.tannot Ast.exp monad)) list * effect_request
  5. | Fail of string Lazy.t * state * Type_check.tannot Ast.exp monad * (string Lazy.t * lstate * (return_value -> Type_check.tannot Ast.exp monad)) list * string
Sourceand effect_request =
  1. | Read_mem of Value.value * Value.value * Value.value * Value.value -> state -> frame
  2. | Write_ea of Value.value * Value.value * Value.value * unit -> state -> frame
  3. | Excl_res of bool -> state -> frame
  4. | Write_mem of Value.value * Value.value * Value.value * Value.value * bool -> state -> frame
  5. | Barrier of Value.value * unit -> state -> frame
  6. | Read_reg of string * Value.value -> state -> frame
  7. | Write_reg of string * Value.value * unit -> state -> frame
Sourceval eval_frame' : frame -> frame
Sourceval eval_frame : frame -> frame
Sourceval default_effect_interp : state -> effect_request -> frame
Sourceval effect_interp : (state -> effect_request -> frame) ref
Sourceval set_effect_interp : (state -> effect_request -> frame) -> unit
Sourceval run_frame : frame -> Value.value
Sourceval initialize_registers : bool -> bool -> gstate -> (Type_check.tannot, 'a) Ast.def list -> gstate
Sourceval initial_state : ?registers:bool -> ?undef_registers:bool -> (Type_check.tannot, 'a) Ast_defs.ast -> Type_check.Env.t -> (Value.value list -> Value.value) Value.StringMap.t -> lstate * gstate
Sourcetype value_result =
  1. | Value_success of Value.value
  2. | Value_error of exn
Sourceval decode_instruction : state -> Ast.lit_aux list -> value_result
Sourceval id_typ : string -> Ast.typ
Sourceval analyse_instruction : state -> Value.value -> frame
Sourceval execute_instruction : state -> Value.value -> frame
OCaml

Innovation. Community. Security.