Giter VIP home page Giter VIP logo

arm-asl-parser's Introduction

Overview

This repository implements a parser for the ARM Semantics Language (ASL), which is a domain-specific language for describing the semantics of ARM instructions [fn:asl-description]. The parser is written in Java using ANTLR; the Java tool dumps the parsed AST in an s-expression format. The included Haskell library (asl-parser) parses the s-expression format into a native Haskell ADT.

The ASL is extracted from the official XML specifications from ARM [fn:arm-specs] using a set of tools [fn:mra_tools] developed by Alastair Reid.

Use

To download, extract, and parse the ASL specification, simply run:

make all

This performs the following steps:

  1. Downloads and extracts the XML specifications from ARM into the xml subdirectory.
  2. Uses mra_tools to parse the XML specifications into ASL. This creates arch.asl, arch_instrs.asl, regs.asl and support.asl in the asl subdirectory.
  3. Uses the ANTLR parser to parse these into an s-expression format. This creates arm_defs.sexpr, arm_instrs.sexpr, arm_regs.sexpr and support.expr in the asl-parsed subdirectory.

Building

Currently, this repository only implements a library parsing the generated s-expression files. Client code can use the library to process ASL. See the module Language.ASL.Parser and the functions parseAslDefs, parseAslInsts and parseAslRegs. The mra_tools produce three files of interest: arch.asl, arch_instrs.asl and regs.asl. The first contains definitions of functions used to implement instruction semantics. The second contains the definitions of the semantics of each instruction in the architecture. The third contains definitions for the registers used in other two. Additionally mra_tools provides a collection of reference implementations for implementation-defined functions in the ASL specification. These are concatenated together in support.asl.

The cabal target `asl-parser` builds the parser library.

cabal v2-build asl-parser

References

[fn:mra_tools] https://github.com/alastairreid/mra_tools [fn:asl-description] https://alastairreid.github.io/dissecting-ARM-MRA/ [fn:arm-specs] https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools

arm-asl-parser's People

Contributors

danmatichuk avatar m10f avatar travitch avatar benjaminselfridge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.