• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
        • Symbolic-test-vectors
          • Defstv
          • Stv-compile
          • Symbolic-test-vector-format
          • Stv-implementation-details
          • Compiled-stv-p
          • Stv-run-for-all-dontcares
          • Stv-run
          • Stv-process
          • Stv-run-check-dontcares
          • Symbolic-test-vector-composition
          • Stv-expand
          • Stv-easy-bindings
          • Stv-debug
          • Stv-run-squash-dontcares
          • Stvdata-p
          • Stv-doc
          • Stv2c
            • Stv2c-opts-p
            • Stv2c-c-symbol-names
            • Stv2c-outs-structdef
            • Stv2c-ins-structdef
            • Stv2c-c-symbol-name
            • Stv2c-header
            • Stv2c-main
            • Stv-widen
            • Stv-out->width
            • Stv-in->width
            • Stv->outs
            • Stv-number-of-phases
            • Stv->ins
            • Stv-suffix-signals
            • Stv->vars
          • Esim-primitives
          • E-conversion
          • Esim-steps
          • Patterns
          • Mod-internal-paths
          • Defmodules
          • Esim-simplify-update-fns
          • Esim-tutorial
          • Esim-vl
        • Vl2014
        • Sv
        • Vwsim
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Stv2c

    Stv2c-main

    Signature
    (stv2c-main stv &key (state 'state)) → state
    Arguments
    stv — Guard (processed-stv-p stv).

    Definitions and Theorems

    Function: stv2c-main-fn

    (defun
     stv2c-main-fn (stv state)
     (declare (xargs :stobjs (state)))
     (declare (xargs :guard (processed-stv-p stv)))
     (let
      ((__function__ 'stv2c-main))
      (declare (ignorable __function__))
      (b*
       (((processed-stv stv) stv)
        (c-name (stv2c-c-symbol-name stv.name))
        (header-filename (str::cat c-name ".h"))
        (impl-filename (str::cat c-name ".cc"))
        (header-txt (str::rchars-to-string (stv2c-header stv nil)))
        (impl-txt
         (b*
          ((acc nil)
           (acc
            (str::revappend-chars
             "// Warning: automatically generated file!
    // Do not hand edit!
    
    #include \""
             acc))
           (acc (str::revappend-chars header-filename acc))
           (acc (cons #\" acc))
           (acc (cons #\Newline acc))
           (acc (cons #\Newline acc))
           (acc (stv2c-make-run-fn stv acc)))
          (str::rchars-to-string acc)))
        (state (stv2c-write header-filename header-txt state))
        (state (stv2c-write impl-filename impl-txt state)))
       state)))