Giter Club home page Giter Club logo

seqconsistency's Introduction

This repository contains the proof of a full system implementing sequential
consistency. The proof is modular in the sense that we prove that an arbitrary
tree hierarchy of caches implements an instantaneous atomic memory, and a
speculative out-of-order processor implements an instantaneous atomic
processor. The final theorem states that when multiple such speculative
processors are connected to the hierarchy of caches, then it implements several
atomic processors connected to memory.

The cache proof is present in the cache folder. BaseTree.v and Tree.v files
contains the inductive definition for trees and the cache hierarchies are
instances of trees. Tree.v is a named version of BaseTree with each node having
a name computed based on the position of the node w.r.t. root of the tree.
Hier.v and HierProperties.v contains a list of properties about tree
hierarchies.  Caches/DataTypes.v and MsiState.v contains the definition of some
of the datatypes used in the caches. Cache.v contains the invariants related to
internal caches and the root while L1.v and LatestValue.v contains the
invariants related to the leaf caches. CommonBeh record inside Cache.v captures
the trivial invariants that can be obtained by simply examining the state
transitions of the caches (given in Rules.v), and the proofs of these trivial
invariants are in BehaviorAxioms.v. LatestValue.v contains theorems which
pertain to establishing that any non-I address in a cache contains the latest
value (given by the last store from any processor to that address).
LatestValueAxiom.v proves some helper theorems in LatestValue.v file.
Channel.v defines the communication channel between the caches, represented
using unbounded lists. ChannelAxiom.v and ChannelAxiomHelp.v contains
invariants regarding the channels. Top.v assembles the whole system by
combining the internal caches with the L1 caches and the channels and proves
the store-atomicity theorem (which states that any load reads the latest store
from any processor).

TransitionsNew.v in the top-level directory defines the semantics of the
transition system and the speculative processor is implemented in FreshNew.v.
The speculative processor's implementation is not concrete -- it abstracts
over the ISA and does not have a concrete implementation of a reorder buffer
or branch predictors (instead their behaviors are encapsulated directly in the
preconditions in the state transitions). StoreAtomicity.v shows that any
system that obeys the store-atomicity theorem implements instantaneous memory,
where loads read values from the memory instantaneously and stores update the
corresponding location instantaneously.

Useful.v and Caches.Useful.v contain useful generic lemmas which are used at
various places in this project (e.g. facts about lists that are not present in
the standard library).

Two things to note:
a) When this framework was being developed, I did not know much about proof
automation, so most of the proofs contain a lot of tedious details spelt out.
Moreover, I was also learning Coq at that point, so things could have been
designed differently if I were to start it again (which is what I am doing with
Kami).
b) The Processor part and the Cache part were developed completely
orthogonally, with no foreseen plan to integrate them. So a lot of code has
been copied and pasted between these two parts.

seqconsistency's People

Contributors

vmurali avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.