forked from rems-project/asl-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocaml backend fixes for pc, export offline lifter library (#120)
* new offline lifter & asli packages, make dune build offline lifter We now define two packages, asli and aslp_offline. The offline lifter library gets a different name depending on whether its built with pc support which is enabled by default in offlineASL/gen-command (breaking offline-coverage). libASL/dune now invokes asli to generate the lifter into the build directory. This makes everything buildable so the offline lifter should be useable as an opam pin dependency. Asli can generate the dune to build the offline lifter, but there is a little bit bit of manual mess, e.g. regarding the command to build asli. We also don't properly invalidate the cached marshalled generated lifter (which appears in _build/default/marshalled-offline-lifter-*) when we rebuild asli; to regenerate the lifter you must first run `dune clean`. * make `dune build` build just asli the install dependency was requiring a build of all packages. note, to install asli only, you will have to use `dune install -p asli` * make `dune build offlineASL` build all aslp offline things this will also build asli if needed for the offline generation * readme: recommend dune to install package, clarify subpackages * separate offline lifter with pc support * offline depend on stage0 - Moves Primops, Value and Symbolic into stage0 to support this - Some fixes for the previous commit * update offline dune files * fix bin/dune * fix test action coverage * add js lib * ci: try to fake DUNE_INSTALL_PREFIX * readme: add alias for building all offline things * bootstrapping for offline dune files * tests: add package restrictions * reword readme --------- Co-authored-by: rina <[email protected]>
- Loading branch information
1 parent
9b487c6
commit 52726c4
Showing
33 changed files
with
1,888 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,13 @@ interactive execution of ASL statements and expressions, | |
executing opcodes one at a time, | ||
loading ELF files and executing Arm binaries. | ||
""" | ||
maintainer: ["Alastair Reid <[email protected]>"] | ||
authors: ["Alastair Reid"] | ||
maintainer: ["UQ-PAC"] | ||
authors: ["UQ-PAC"] | ||
license: "BSD-3-Clause" | ||
homepage: "https://github.com/alastairreid/asl-interpreter" | ||
bug-reports: "https://github.com/alastairreid/asl-interpreter/issues" | ||
homepage: "https://github.com/UQ-PAC/aslp" | ||
bug-reports: "https://github.com/UQ-PAC/aslp/issues" | ||
depends: [ | ||
"dune" {>= "2.8"} | ||
"dune" {>= "2.9"} | ||
"ocaml" {>= "4.14"} | ||
"menhir" {build} | ||
"ott" {build & >= "0.31"} | ||
|
@@ -41,9 +41,11 @@ build: [ | |
name | ||
"-j" | ||
jobs | ||
"--promote-install-files=false" | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
["dune" "install" "-p" name "--create-install-files" name] | ||
] | ||
dev-repo: "git+https://github.com/alastairreid/asl-interpreter.git" | ||
dev-repo: "git+https://github.com/UQ-PAC/aslp.git" |
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,33 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
version: "0.2.0" | ||
synopsis: "AArch64 Offline lifter" | ||
description: "" | ||
maintainer: ["UQ-PAC"] | ||
authors: ["UQ-PAC"] | ||
license: "BSD-3-Clause" | ||
homepage: "https://github.com/UQ-PAC/aslp" | ||
bug-reports: "https://github.com/UQ-PAC/aslp/issues" | ||
depends: [ | ||
"dune" {>= "2.9"} | ||
"ocaml" {>= "4.14"} | ||
"asli" | ||
"odoc" {with-doc} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"--promote-install-files=false" | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
["dune" "install" "-p" name "--create-install-files" name] | ||
] | ||
dev-repo: "git+https://github.com/UQ-PAC/aslp.git" |
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,37 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
version: "0.2.0" | ||
synopsis: "AArch64 Offline lifter javascript library" | ||
description: "" | ||
maintainer: ["UQ-PAC"] | ||
authors: ["UQ-PAC"] | ||
license: "BSD-3-Clause" | ||
homepage: "https://github.com/UQ-PAC/aslp" | ||
bug-reports: "https://github.com/UQ-PAC/aslp/issues" | ||
depends: [ | ||
"dune" {>= "2.9"} | ||
"ocaml" {>= "4.14"} | ||
"aslp_offline" | ||
"asli" | ||
"js_of_ocaml" | ||
"js_of_ocaml-ppx" | ||
"zarith_stubs_js" | ||
"odoc" {with-doc} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"--promote-install-files=false" | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
["dune" "install" "-p" name "--create-install-files" name] | ||
] | ||
dev-repo: "git+https://github.com/UQ-PAC/aslp.git" |
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,22 @@ | ||
open LibASL_stage0 | ||
open Asl_utils | ||
open Asl_ast | ||
open Js_of_ocaml | ||
|
||
let dis (opcode: string) : stmt list = | ||
let op = Z.of_string opcode in | ||
let bv = Primops.prim_cvt_int_bits (Z.of_int 32) op in | ||
OfflineASL.Offline.run bv | ||
|
||
|
||
(* | ||
import("offline_js.bc.js"); | ||
offlineLifter.dis(opcode); | ||
*) | ||
|
||
let () = Js.export "offlineLifter" | ||
begin object%js | ||
method dis x = List.map (fun s -> pp_stmt s |> Js.string) (dis (Js.to_string x)) | ||
end end | ||
|
||
|
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.