• Stars
    star
    599
  • Rank 74,745 (Top 2 %)
  • Language Isabelle
  • License
    Other
  • Created almost 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sail architecture definition language

The Sail ISA specification language

Build and Test

Overview

Sail is a language for describing the instruction-set architecture (ISA) semantics of processors. Sail aims to provide a engineer-friendly, vendor-pseudocode-like language for describing instruction semantics. It is essentially a first-order imperative language, but with lightweight dependent typing for numeric types and bitvector lengths, which are automatically checked using Z3. It has been used for several papers, available from http://www.cl.cam.ac.uk/~pes20/sail/.

Given a Sail definition, the tool will type-check it and generate documentation, executable emulators (in C and OCaml), theorem-prover definitions (for Isabelle, HOL4, and Coq), and definitions to integrate with our RMEM and isla-axiomatic tools for concurrency semantics. The Isla engine provides SMT-based symbolic evaluation for Sail models, and the Islaris verification tool integrates Isla output with the Iris program logic to support proof about binary code in Coq. Not all models are integrated with all tools - see the most recent papers and models for descriptions of the current state.

This repository contains the implementation of Sail, together with some Sail specifications and related tools.

The support library for Coq models is in a separate repository to help our package management.

Sail ISA Models

Sail is currently being used for Arm-A, Morello (CHERI-Arm), RISC-V, CHERI-RISC-V, MIPS, CHERI-MIPS, IBM Power, and x86 models, variously ranging from full definitions (able to boot an OS in the Sail-generated emulator) to core user-mode fragments:

REMS Models

The hand-written IBM POWER, and x86 models are currently not in sync with the latest version of Sail, which is the (default) sail2 branch on Github. These and the RISC-V model are integrated with our RMEM tool for concurrency semantics.

External Models

Installation

See INSTALL.md for how to install Sail using opam.

Emacs Mode

editors/sail-mode.el contains an Emacs mode for the most recent version of Sail which provides some basic syntax highlighting.

VSCode Mode

editors/vscode contains a Visual Studio Code mode which provides some basic syntax highlighting. It is also available on the VSCode Marketplace.

CLion/PyCharm Syntax highlighting

editors/vscode/sail contains a Visual Studio Code mode which provides some basic syntax highlighting. CLion/PyCharm can also parse the editors/vscode/sail/syntax/sail.tmLanguage.json file and use it to provide basic syntax highlighting. To install open Preferences > Editor > TextMate Bundles. On that settings page press the + icon and locate the editors/vscode/sail directory.

This requires the TextMate Bundles plugin.

Vim

editors/vim contains support for syntax highlighting in the vim editor, in vim's usual format of an ftdetect directory to detect Sail files and a syntax directory to provide the actual syntax highlighting.

Licensing

The Sail implementation, in src/, as well as its tests in test/ and other supporting files in lib/ and language/, is distributed under the 2-clause BSD licence in the headers of those files and in src/LICENCE.

The generated parts of the ASL-derived Armv8.5 and Armv8.3 models are copyright Arm Ltd, and distributed under a BSD Clear licence. See https://github.com/meriac/archex, and the README file in that directory.

The hand-written Armv8 model, in arm/, is distributed under the 2-clause BSD licence in the headers of those files.

The x86 model in x86/ is distributed under the 2-clause BSD licence in the headers of those files.

The POWER model in power/ is distributed under the 2-clause BSD licence in the headers of those files.

The models in separate repositories are licensed as described in each.

Funding

This work was partially supported by the UK Government Industrial Strategy Challenge Fund (ISCF) under the Digital Security by Design (DSbD) Programme, to deliver a DSbDtech enabled digital platform (grant 105694). This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 789108, ELVER). This work was partially supported by EPSRC grant EP/K008528/1 REMS: Rigorous Engineering for Mainstream Systems, an ARM iCASE award, and EPSRC IAA KTF funding. This work was partially supported by donations from Arm and Google. Approved for public release; distribution is unlimited. This research is sponsored by the Defense Advanced Research Projects Agency (DARPA) and the Air Force Research Laboratory (AFRL), under contracts FA8750-10-C-0237 ("CTSRD") and FA8650-18-C-7809 ("CIFV"). The views, opinions, and/or findings contained in these articles OR presentations are those of the author(s)/presenter(s) and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government.

More Repositories

1

lem

Lem semantic definition language
OCaml
127
star
2

netsem

Network Semantics
HTML
86
star
3

sail-arm

Sail version of Arm ISA definition, currently for Armv9.3-A, and with the previous Sail Armv8.5-A model
Isabelle
70
star
4

isla

Symbolic execution tool for Sail ISA specifications
Rust
62
star
5

cerberus

Cerberus C semantics
OCaml
49
star
6

linksem

Semantic model for aspects of ELF static linking and DWARF debug information
Standard ML
42
star
7

rmem

rmem public repo
JavaScript
40
star
8

islaris

isla coq infrastructure
Coq
11
star
9

reviewing-good-and-bad-reasons

11
star
10

cn-tutorial

C
7
star
11

asl_to_sail

ASL to Sail translation tool
OCaml
6
star
12

read-dwarf

Binary analysis tool
OCaml
6
star
13

sail-x86-from-acl2

Sail x86 model automatically translated from the ACL2 model
Python
6
star
14

extract

extract tool
OCaml
6
star
15

armv8a-address-translation

ARMv8-A Address Translation: Isabelle Proof Scripts
Isabelle
5
star
16

minisail

A core language for Sail
OCaml
5
star
17

riscv_config2sail

Program to convert RISC-V yaml config to Sail
OCaml
4
star
18

c-verif-mark

OCaml
4
star
19

isla-snapshots

Compiled Sail ISA snapshots for the Isla symbolic execution tool
4
star
20

CN-pKVM-early-allocator-case-study

CN pKVM early allocator case study
C
3
star
21

cn-pKVM-buddy-allocator-case-study

C
3
star
22

armv8a-address-translation-coq

Port of Isabelle address translation proof (WIP)
Coq
3
star
23

coq-sail

Coq support library for Sail instruction set models
Coq
3
star
24

stdpp_MC

iris's stdpp modified
Coq
2
star
25

sail-riscv-test-generation

RISC-V random instruction generator based on the Sail model
OCaml
2
star
26

isla-testgen

ISA automatic test generator using the isla symbolic execution tool
Rust
2
star
27

system-semantics-arm-axiomatic-models

Isla-compatible systems-level tests
Python
1
star
28

linux-pkvm-verif

copy of upstream https://android-kvm.googlesource.com/linux for pKVM verification
C
1
star
29

system-litmus-harness

test harness for systems-concurrency litmus tests, as a QEMU guest
C
1
star
30

isla-sail-riscv

Adaption of the RISC-V Sail model for Isla
Coq
1
star
31

pkvm-tester

Test scaffolding for pKVM
Shell
1
star
32

pkvm-proxy-ocaml

Ocaml library to talk to pKVM-proxy, and tests written on top of it
OCaml
1
star
33

coq-cheri-capabilities

This repository contains an abstract implementation in Coq of CHERI capabilities, and a concrete implementation for Arm Morello.
Coq
1
star
34

linux

Linux fork used in the REMS project. Mostly working of pKVM developement at: https://android-kvm.googlesource.com/linux/
C
1
star
35

isla-lang

Isla-lang is an ocaml parser (and pretty printer) for isla instruction trace syntax
Coq
1
star