All Projects → ARM-software → asl-interpreter

ARM-software / asl-interpreter

Licence: other
Example implementation of Arm's Architecture Specification Language (ASL)

Programming Languages

ocaml
1615 projects
Makefile
30231 projects

Projects that are alternatives of or similar to asl-interpreter

Lbforth
Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
Stars: ✭ 293 (+275.64%)
Mutual labels:  arm, interpreter
klever
Read-only mirror of the Klever Git repository
Stars: ✭ 18 (-76.92%)
Mutual labels:  specification, formal-specification
Enterprise Scale
The Enterprise-Scale architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
Stars: ✭ 511 (+555.13%)
Mutual labels:  arm, architecture
data-product-batch
Template to deploy a Data Product for Batch data processing into a Data Landing Zone of the Data Management & Analytics Scenario (former Enterprise-Scale Analytics). The Data Product template can be used by cross-functional teams to ingest, provide and create new data assets within the platform.
Stars: ✭ 27 (-65.38%)
Mutual labels:  arm, architecture
Silicon Info
Mac menu bar tool to view the architecture of the running application
Stars: ✭ 153 (+96.15%)
Mutual labels:  arm, architecture
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (-58.97%)
Mutual labels:  arm, interpreter
recurse
re<urse is a declarative language for generating musical patterns
Stars: ✭ 32 (-58.97%)
Mutual labels:  interpreter
rpi-couchdb
CouchDB Docker 🐳 for Raspberry Pi. Part of OLE's Treehouses Project.
Stars: ✭ 30 (-61.54%)
Mutual labels:  arm
hruby
Embed Ruby in your Haskell program.
Stars: ✭ 22 (-71.79%)
Mutual labels:  interpreter
biolink-model
Schema and generated objects for biolink data model and upper ontology
Stars: ✭ 83 (+6.41%)
Mutual labels:  specification
ntast
Notion Abstract Syntax Tree specification.
Stars: ✭ 101 (+29.49%)
Mutual labels:  specification
landscape-of-programming
This repo aim to show you what to learn on the way to excellence.
Stars: ✭ 67 (-14.1%)
Mutual labels:  architecture
SearchMovies
sample Android Application using MVP pattern
Stars: ✭ 47 (-39.74%)
Mutual labels:  architecture
eggplant
A behaviour driven development (BDD) library for Clojure. Simplicity is key.
Stars: ✭ 16 (-79.49%)
Mutual labels:  specification
silky
The Silky framework is designed to help developers quickly build a microservice development framework through simple code and configuration under the .net platform.
Stars: ✭ 146 (+87.18%)
Mutual labels:  architecture
drone-cortexm
ARM® Cortex®-M platform crate for Drone, an Embedded Operating System.
Stars: ✭ 31 (-60.26%)
Mutual labels:  arm
baking-pi
My code for Baking Pi - Operating Systems Development online course by Cambridge University (Raspberry Pi 3 update)
Stars: ✭ 22 (-71.79%)
Mutual labels:  arm
static-web-server
A blazing fast and asynchronous web server for static files-serving. ⚡
Stars: ✭ 230 (+194.87%)
Mutual labels:  arm
specification
Software Bill of Material (SBOM) standard designed for use in application security contexts and supply chain component analysis
Stars: ✭ 129 (+65.38%)
Mutual labels:  specification
3bc-lang
Low level language, tiny virtual machine that works on computers and microcontrollers. (Friendly Punched cards)
Stars: ✭ 155 (+98.72%)
Mutual labels:  interpreter

ASL Interpreter

Introduction

Example implementation of Arm's Architecture Specification Language (ASL).

The ASL interpreter is a collection of resources to help you to understand and make use of Arm's architecture specifications. It consists of lexer, parser, typechecker and interpreter for the ASL language and an interactive interface for evaluating ASL statements and expressions.

Requirements

To build and run the ASL interpreter, you will need:

  • OCaml version 4.07 (other versions may work)
  • OPAM OCaml version 2.0.5 (other versions may work)
  • The following OPAM packages
    • ocaml - OCaml compiler
    • menhir - parser generator tool
    • ocamlfind - build tool for OCaml
    • ott.0.29 - tool for defining language grammars and semantics (this version or later required)
    • linenoise - OCaml line editing library
    • pprint - OCaml pretty-printing library
    • z3.4.7.1 - OCaml bindings for the Z3 SMT solver (exactly this version is required)
    • zarith - OCaml multiprecision arithmetic library

License and contribution

The software is provided under the BSD-3-Clause licence. Contributions to this project are accepted under the same licence.

This software includes code from one other open source projects

  • The CIL project defines a useful visitor class for traversing C ASTs. The file visitor.ml is a modified copy of this class that generalizes the type to work with an arbitrary AST.

    CIL is distributed under a BSD-3-Clause licence.

Building and development

Directory structure

This interpreter consists of a single directory organized as follows

  • Metadata, documentation, etc:
    • LICENCE - Software licence
    • README.md - This file
    • asli.odocl - Manifest (for documentation generation)
    • Makefile - build system file
    • _tags - OCaml build system configuration file
  • Source code consisting of
    • Lexer
      • lexer.mll - ASL lexer (ocamllex file)
      • lexersupport.ml - indentation-based parsing support
    • Grammar and Parser
      • asl.ott - used to generate the ASL parser and abstract syntax tree (OTT file)
      • asl_visitor.ml - code to traverse abstract syntax tree
      • asl_utils.ml - code to transform abstract syntax tree
    • Typechecker
      • tcheck.ml - typechecker
    • Interpreter
      • primops.ml - implementation of ASL builtin types and operations
      • value.ml - interpreter support code
      • eval.ml - evaluator for ASL language
    • ASL standard library
      • prelude.asl - builtin types and functions
    • Programs
      • asli.ml - interactive ASL tool
      • testlexer.ml - test program that converts ASL code to list of tokens
    • Misc
      • utils.ml - utility code
  • Code copied from other open source projects
    • visitor.ml

Installing dependencies

Platform specific instructions:

    MacOS: brew install opam
    Ubuntu: sudo apt-get install opam

Platform independent instructions:

    opam install ocaml
    opam install menhir
    opam install ocamlfind
    opam install ott
    opam install linenoise
    opam install pprint
    opam install z3.4.7.1
    opam install zarith

    eval `opam config env`

You also need to execute this command

    MacOS: export DYLD_LIBRARY_PATH=`opam config var z3:lib`
    Linux: export LD_LIBRARY_PATH=`opam config var z3:lib`

Building

To build the ASL lexer, the ASL interpreter and PDF files containing the ASL grammar, execute these commands.

    make testlexer.native asli pdf doc

Using ASL lexer

This displays a list of tokens in an ASL file including the indent and dedent tokens used to support indentation-based parsing.

    $ ./testlexer.native prelude.asl

Using ASL interpreter

This reads ASL files specified on the command line and provides an interactive environment for executing ASL statements and expressions.

    $ ./asli
                _____  _       _    ___________________________________
        /\     / ____|| |     (_)   ASL interpreter
       /  \   | (___  | |      _    Copyright Arm Limited (c) 2017-2019
      / /\ \   \___ \ | |     | |
     / ____ \  ____) || |____ | |   Version 0.0 alpha
    /_/    \_\|_____/ |______||_|   ___________________________________

    Type :? for help
    ASLi> 1+1
    2
    ASLi> ZeroExtend('11', 32)
    '00000000000000000000000000000011'
    ASLi> bits(32) x = ZeroExtend('11', 32);
    ASLi> x
    '00000000000000000000000000000011'
    ASLi> :quit

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].