package asli
Interpreter for Arm's Architecture Specification Language (ASL)
Install
Dune Dependency
Authors
Maintainers
Sources
0.2.0.tar.gz
md5=f4581fd209256823fa4d569ac96c8cee
sha512=fd4a74294beb9eeeafa80c9224b5dc30f5e5ebde4d53fa601929d283b6ca72154de313874321774914f738ac6f0d640e59452f7d03cb1db7b3a019b48b82e0d4
doc/src/asli.libASL/cpu.ml.html
Source file cpu.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
(**************************************************************** * CPU interface * * Copyright Arm Limited (c) 2017-2019 * SPDX-Licence-Identifier: BSD-3-Clause ****************************************************************) module AST = Asl_ast type cpu = { env : Eval.Env.t; reset : unit -> unit; step : unit -> unit; getPC : unit -> Primops.bigint; setPC : Primops.bigint -> unit; elfwrite : Int64.t -> char -> unit; opcode : string -> Primops.bigint -> unit; } let mkCPU (env : Eval.Env.t): cpu = let loc = AST.Unknown in let reset (_ : unit): unit = Eval.eval_proccall loc env (AST.FIdent ("__TakeColdReset", 0)) [] [] and step (_ : unit): unit = Eval.eval_proccall loc env (AST.FIdent ("__InstructionExecute", 0)) [] [] and getPC (_ : unit): Primops.bigint = let r = Eval.eval_funcall loc env (AST.FIdent ("__getPC", 0)) [] [] in Value.to_integer loc r and setPC (x : Primops.bigint): unit = let a = Value.VInt x in Eval.eval_proccall loc env (AST.FIdent ("__setPC", 0)) [] [a] and elfwrite (addr: Int64.t) (b: char): unit = let a = Value.VBits (Primops.mkBits 64 (Z.of_int64 addr)) in let b = Value.VBits (Primops.mkBits 8 (Z.of_int (Char.code b))) in Eval.eval_proccall loc env (AST.FIdent ("__ELFWriteMemory", 0)) [] [a; b] and opcode (iset: string) (opcode: Primops.bigint): unit = let op = Value.VBits (Primops.prim_cvt_int_bits (Z.of_int 32) opcode) in let decoder = Eval.Env.getDecoder env (Ident iset) in Eval.eval_decode_case AST.Unknown env decoder op in { env = env; reset = reset; step = step; getPC = getPC; setPC = setPC; elfwrite = elfwrite; opcode = opcode } (**************************************************************** * End ****************************************************************)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>