Documentation

Solanalib.SBPF.Memory

SBPF.Memory — the sBPF memory model #

Byte-addressable memory, access widths, and the load / store operations of the sBPF semantics, ported from Mem.thy. Memory is a partial map from 64-bit address to byte; loads and stores are little-endian and operate at one of four access widths.

Main definitions #

Access width for a memory operation (the source theory's memory_chunk).

Instances For
    @[implicit_reducible]
    Equations
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]

      Byte-addressable memory: a partial map from 64-bit address to byte.

      Modelled as a total function into Option U8 (none = unmapped), matching the source theory's (u64, u8) map.

      Equations
      Instances For

        The empty address space — every byte unmapped.

        Equations
        Instances For
          def Solanalib.SBPF.loadv (mc : MemoryChunk) (m : Mem) (addr : U64) :

          Read a value of the given width at addr, little-endian. Yields none if any byte in the accessed range is unmapped.

          Equations
          Instances For
            def Solanalib.SBPF.storev (mc : MemoryChunk) (m : Mem) (addr : U64) (v : Val) :

            Write a value of the given width at addr, little-endian. Yields none if the value's tag does not match the access width.

            Equations
            Instances For