• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
            • X86isa-state-history
            • Environment-field
            • Physical-memory-model
            • Save-restore
              • Restore-x86
              • Save-x86
            • Syscalls
            • Cpuid
            • Linear-memory
            • Rflag-specifications
            • Characterizing-undefined-behavior
            • Top-level-memory
            • App-view
            • X86-decoder
            • Physical-memory
            • Decoding-and-spec-utils
            • Instructions
            • Register-readers-and-writers
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Save-restore

    Save-x86

    Signature
    (save-x86 filename memsize x86 state) → state
    Arguments
    filename — The name of the file to write the non-memory state out to. The memory will be written out to <filename>.mem.
        Guard (stringp filename).
    memsize — The number of bytes of memory to save.
        Guard (natp memsize).

    Definitions and Theorems

    Function: save-x86

    (defun save-x86 (filename memsize x86 state)
      (declare (xargs :stobjs (x86 state)))
      (declare (xargs :guard (and (stringp filename)
                                  (natp memsize))))
      (declare (xargs :guard (<= memsize *mem-size-in-bytes*)))
      (let ((__function__ 'save-x86))
        (declare (ignorable __function__))
        (b* ((serialized-x86 (serialize-x86 x86))
             (state (serialize-write filename serialized-x86))
             (memfilename (concatenate 'string filename ".mem"))
             ((mv memchannel state)
              (open-output-channel memfilename
                                   :byte state))
             ((unless memchannel) state)
             (state (write-mem-to-channel memsize memchannel x86 state))
             (state (close-output-channel memchannel state)))
          state)))