• 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-res-sigma-p
            • Vl-res-rewrite-occs
            • Vl-add-res-modules
              • Vl-make-res-occs
            • Vl-modulelist-make-esims
            • Vl-module-check-e-ok
            • Vl-collect-design-wires
            • Adding-z-drivers
            • 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
    • Resolving-multiple-drivers

    Vl-add-res-modules

    Top-level function for resolving multiple drivers in a list of E occurrences.

    Signature: (vl-add-res-modules all-names occs) returns occs'.

    occs should be a preliminary list of occurrences, e.g., generated perhaps by vl-modinst-to-eocc along with other occurrences for driving T/F, undriven outputs, etc. These occurrences are presumably not yet well-formed because the same wire may be driven by multiple occs.

    all-names must be a vl-emodwirelist-p 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_res, because any wires we are going to introduce are either already used in occs or are going to have the form vl_res[k]. This includes, for instance, the names added during vl-add-zdrivers and for driving the T and F wires.

    Definitions and Theorems

    Function: vl-add-res-modules

    (defun
     vl-add-res-modules (all-names occs)
     "Returns OCCS'"
     (declare
      (xargs
        :guard (and (vl-emodwirelist-p all-names)
                    (vl-emodwirelist-p (collect-signal-list :o occs)))))
     (b* ((multiply-driven
               (duplicated-members (collect-signal-list :o occs)))
          ((unless multiply-driven) occs)
          (idx (vl-emodwirelist-highest "vl_res" all-names))
          (mds (make-lookup-alist multiply-driven))
          (sigma (len multiply-driven))
          ((mv rw-occs idx sigma)
           (vl-res-rewrite-occs occs mds idx sigma))
          (sigma (b* ((tmp (hons-shrink-alist sigma nil)))
                     (fast-alist-free sigma)
                     tmp))
          ((mv res-occs ?idx)
           (vl-make-res-occs idx sigma)))
         (fast-alist-free mds)
         (fast-alist-free sigma)
         (append rw-occs res-occs)))

    Theorem: true-listp-of-vl-add-res-modules

    (defthm true-listp-of-vl-add-res-modules
            (implies (true-listp occs)
                     (true-listp (vl-add-res-modules all-names occs)))
            :rule-classes :type-prescription)

    Theorem: good-esim-occsp-of-vl-add-res-modules

    (defthm
     good-esim-occsp-of-vl-add-res-modules
     (implies
         (and (force (good-esim-occsp occs))
              (force (vl-emodwirelist-p (collect-signal-list :o occs))))
         (good-esim-occsp (vl-add-res-modules all-names occs))))