• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Extract-vl-types
          • Hierarchy
            • Vl-design-toplevel
            • Vl-remove-unnecessary-elements
            • Vl-necessary-elements-transitive
            • Vl-interfacelist-everinstanced
            • Vl-dependent-elements-transitive
            • Vl-necessary-elements-direct
            • Vl-modulelist-everinstanced
            • Vl-dependent-elements-direct
            • Vl-design-deporder-modules
              • Vl-design-check-complete
              • Vl-design-upgraph
              • Immdeps
              • Vl-design-downgraph
              • Vl-collect-dependencies
              • Vl-hierarchy-free
            • Range-tools
            • Finding-by-name
            • Stmt-tools
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Hierarchy

    Vl-design-deporder-modules

    Dependency-order sort the modules of a design.

    Signature
    (vl-design-deporder-modules x) → (mv successp new-x)
    Arguments
    x — Guard (vl-design-p x).
    Returns
    successp — Type (booleanp successp).
    new-x — Type (vl-design-p new-x).

    Definitions and Theorems

    Function: vl-design-deporder-modules

    (defun vl-design-deporder-modules (x)
     (declare (xargs :guard (vl-design-p x)))
     (let ((__function__ 'vl-design-deporder-modules))
      (declare (ignorable __function__))
      (b*
       (((vl-design x) (vl-design-fix x))
        (downgraph (vl-design-downgraph x))
        ((unless (uniquep (alist-keys downgraph)))
         (mv (cw "Global dependency graph has name clashes: ~x0.~%"
                 (duplicated-members (alist-keys downgraph)))
             x))
        ((mv okp deporder)
         (depgraph::toposort downgraph))
        ((unless okp)
         (mv (cw "Global dependency loop: ~x0.~%"
                 deporder)
             x))
        ((unless (string-listp deporder))
         (mv (raise "Type error, dependency order should be strings.")
             x))
        (new-mods (vl-reorder-modules deporder x.mods))
        ((unless (equal (mergesort x.mods)
                        (mergesort new-mods)))
         (mv (raise "Dependency ordering changed the modules somehow??")
             x)))
       (mv t
           (change-vl-design x :mods new-mods)))))

    Theorem: booleanp-of-vl-design-deporder-modules.successp

    (defthm booleanp-of-vl-design-deporder-modules.successp
      (b* (((mv ?successp ?new-x)
            (vl-design-deporder-modules x)))
        (booleanp successp))
      :rule-classes :type-prescription)

    Theorem: vl-design-p-of-vl-design-deporder-modules.new-x

    (defthm vl-design-p-of-vl-design-deporder-modules.new-x
      (b* (((mv ?successp ?new-x)
            (vl-design-deporder-modules x)))
        (vl-design-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-design-deporder-modules-of-vl-design-fix-x

    (defthm vl-design-deporder-modules-of-vl-design-fix-x
      (equal (vl-design-deporder-modules (vl-design-fix x))
             (vl-design-deporder-modules x)))

    Theorem: vl-design-deporder-modules-vl-design-equiv-congruence-on-x

    (defthm vl-design-deporder-modules-vl-design-equiv-congruence-on-x
      (implies (vl-design-equiv x x-equiv)
               (equal (vl-design-deporder-modules x)
                      (vl-design-deporder-modules x-equiv)))
      :rule-classes :congruence)