• 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
        • Esim-primitives
        • E-conversion
          • Vl-ealist-p
          • Modinsts-to-eoccs
          • Vl-module-make-esim
          • Exploding-vectors
          • Resolving-multiple-drivers
          • Vl-modulelist-make-esims
          • Vl-module-check-e-ok
          • Vl-collect-design-wires
          • Adding-z-drivers
            • Vl-add-zdrivers
              • Vl-make-z-occs
              • Vl-make-z-occ
            • Vl-design-to-e
            • Vl-design-to-e-check-ports
            • Vl-design-to-e-main
            • Port-bit-checking
          • 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
    • Adding-z-drivers

    Vl-add-zdrivers

    Top-level function for adding drivers for undriven outputs.

    Signature: (vl-add-zdrivers all-names flat-ins flat-outs occs) returns occs'.

    occs should be the initial list of occurrences that we generate from the module instances; see for instance vl-modinst-to-eocc.

    flat-outs should be the already-flattened list of the module's output bits, i.e., (pat-flatten (gpl :o mod)).

    flat-ins should be the already-flattened list of the module's input bits, i.e., (pat-flatten (gpl :i mod)).

    all-names must be a vl-emodwirelist-ps that captures the module's namespace. We expect it to include at least:

    • All signals in :i and :o for the module
    • All signals used in :i and :o patterns in occs
    • The names of all occs (i.e., the :u from each occ)

    However, as a special exception, all-names may exclude names that we know cannot have the basename vl_zdrive. This includes, for instance, all of the wires that are added during vl-add-res-modules, and the special wires that are added to drive T and F in vl-module-make-esim.

    Definitions and Theorems

    Function: vl-add-zdrivers

    (defun
     vl-add-zdrivers
     (all-names flat-ins flat-outs occs)
     (declare
      (xargs
        :guard (and (vl-emodwirelist-p all-names)
                    (vl-emodwirelist-p flat-ins)
                    (vl-emodwirelist-p flat-outs)
                    (vl-emodwirelist-p (collect-signal-list :i occs))
                    (vl-emodwirelist-p (collect-signal-list :o occs)))))
     (b* ((driven-signals
               (union (mergesort flat-ins)
                      (mergesort (collect-signal-list :o occs))))
          (consumed-signals
               (union (mergesort flat-outs)
                      (mergesort (collect-signal-list :i occs))))
          (signals-that-need-zdrivers
               (difference (difference consumed-signals driven-signals)
                           (mergesort '(acl2::f t))))
          ((unless signals-that-need-zdrivers)
           occs)
          (idx (vl-emodwirelist-highest "vl_zdrive" all-names))
          (new-occs (vl-make-z-occs idx signals-that-need-zdrivers)))
         (append new-occs occs)))

    Theorem: good-esim-occsp-of-vl-add-zdrivers

    (defthm
     good-esim-occsp-of-vl-add-zdrivers
     (implies
          (and (force (vl-emodwirelist-p all-names))
               (force (vl-emodwirelist-p flat-ins))
               (force (vl-emodwirelist-p flat-outs))
               (force (vl-emodwirelist-p (collect-signal-list :i occs)))
               (force (vl-emodwirelist-p (collect-signal-list :o occs)))
               (force (good-esim-occsp occs)))
          (good-esim-occsp
               (vl-add-zdrivers all-names flat-ins flat-outs occs))))