• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
            • Basic-bind-elim
            • Argresolve
            • Basicsanity
            • Portdecl-sign
              • Vl-modulelist-portdecl-sign
              • Vl-portdecl-sign-list
              • Vl-portdecl-sign-1
              • Vl-portdecl-sign-main
              • Vl-portdecl-type-set-signed
                • Vl-module-portdecl-sign
                • Vl-design-portdecl-sign
                • Vl-datatype->signedp
              • Enum-names
              • Port-resolve
              • Udp-elim
              • Vl-annotate-design
              • Vl-annotate-module
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • Svl
        • X86isa
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Portdecl-sign

    Vl-portdecl-type-set-signed

    Signature
    (vl-portdecl-type-set-signed type elem) 
      → 
    (mv successp warnings new-type)
    Arguments
    type — Type of this port declaration.
        Guard (vl-datatype-p type).
    elem — Context for warnings.
        Guard (vl-modelement-p elem).
    Returns
    warnings — Type (vl-warninglist-p warnings).
    new-type — Type (vl-datatype-p new-type).

    Definitions and Theorems

    Function: vl-portdecl-type-set-signed

    (defun vl-portdecl-type-set-signed (type elem)
     (declare (xargs :guard (and (vl-datatype-p type)
                                 (vl-modelement-p elem))))
     (let ((__function__ 'vl-portdecl-type-set-signed))
      (declare (ignorable __function__))
      (b*
       ((elem (vl-modelement-fix elem))
        (type (vl-datatype-fix type))
        ((fun (badtype type elem))
         (mv
          nil
          (list
           (make-vl-warning
            :type :vl-portdecl-sign-fail
            :msg
            "~a0: Don't know how to change the sign of datatype ~
                              ~a1 to be signed"
            :args (list elem type)
            :fatalp t))
          type)))
       (if (consp (vl-datatype->udims type))
           (badtype type elem)
         (vl-datatype-case
              type
              :vl-coretype (mv t nil
                               (change-vl-coretype type :signedp t))
              :vl-struct (mv t
                             nil (change-vl-struct type :signedp t))
              :vl-union (mv t nil (change-vl-union type :signedp t))
              :otherwise (badtype type elem))))))

    Theorem: vl-warninglist-p-of-vl-portdecl-type-set-signed.warnings

    (defthm vl-warninglist-p-of-vl-portdecl-type-set-signed.warnings
      (b* (((mv ?successp ?warnings ?new-type)
            (vl-portdecl-type-set-signed type elem)))
        (vl-warninglist-p warnings))
      :rule-classes :rewrite)

    Theorem: vl-datatype-p-of-vl-portdecl-type-set-signed.new-type

    (defthm vl-datatype-p-of-vl-portdecl-type-set-signed.new-type
      (b* (((mv ?successp ?warnings ?new-type)
            (vl-portdecl-type-set-signed type elem)))
        (vl-datatype-p new-type))
      :rule-classes :rewrite)