Transform
(vl-gte-occform x nf mod ialist warnings) → (mv new-warnings new-modules new-modinsts new-assigns new-nf)
Function:
(defun vl-gte-occform (x nf mod ialist warnings) (declare (xargs :guard (and (vl-assign-p x) (vl-namefactory-p nf) (vl-module-p mod) (vl-warninglist-p warnings) (equal ialist (vl-make-moditem-alist mod))))) (declare (xargs :guard (and (not (vl-atom-p (vl-assign->expr x))) (member (vl-nonatom->op (vl-assign->expr x)) '(:vl-binary-gte)) t))) (let ((__function__ 'vl-gte-occform)) (declare (ignorable __function__)) (b* ((x (vl-assign-fix x)) (warnings (vl-warninglist-fix warnings)) (nf (vl-namefactory-fix nf))) (b* (((vl-assign x) x) (arg1 (first (vl-nonatom->args x.expr))) (arg2 (second (vl-nonatom->args x.expr))) (arg1width (vl-expr->finalwidth arg1)) (arg1type (vl-expr->finaltype arg1)) ((unless (and (equal (vl-expr->finalwidth x.expr) 1) (equal (vl-expr->finaltype x.expr) :vl-unsigned) (equal (vl-expr->finalwidth x.lvalue) 1) (vl-expr->finaltype x.lvalue) arg1type (posp arg1width) (equal arg1type (vl-expr->finaltype arg2)) (equal arg1width (vl-expr->finalwidth arg2)))) (occform-return :assigns (list x) :warnings (fatal :type :vl-programming-error :msg "~a0: bad widths/types in assignment of >= operation." :args (list x)))) (warnings (if (eq arg1type :vl-unsigned) warnings (warn :type :vl-warn-signed-comparison :msg "~a0: found a signed comparison expression. This is ~ dangerous because whereas NCVerilog properly carries ~ out a comparison between 2's complement numbers, ~ Verilog-XL incorrectly uses an unsigned comparison. ~ We follow the Verilog-2005 standard and mimick ~ NCVerilog, but to ensure compatibility across Verilog ~ implementations, you should probably not use signed ~ comparisons. Some typical causes of signedness are ~ plain decimal numbers like 17, and the use of integer ~ variables instead of regs." :args (list x)))) ((mv warnings arg1) (vl-occform-argfix arg1 mod ialist warnings)) ((mv warnings arg2) (vl-occform-argfix arg2 mod ialist warnings)) ((mv instname nf) (vl-namefactory-indexed-name "vl_gte" nf)) (mods (if (eq arg1type :vl-unsigned) (vl-make-n-bit-unsigned-gte arg1width) (vl-make-n-bit-signed-gte arg1width))) (modinst (vl-simple-instantiate (car mods) instname (list x.lvalue arg1 arg2) :loc x.loc))) (occform-return :mods mods :modinsts (list modinst))))))
Theorem:
(defthm vl-warninglist-p-of-vl-gte-occform.new-warnings (b* (((mv ?new-warnings ?new-modules ?new-modinsts ?new-assigns ?new-nf) (vl-gte-occform x nf mod ialist warnings))) (vl-warninglist-p new-warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-modulelist-p-of-vl-gte-occform.new-modules (b* (((mv ?new-warnings ?new-modules ?new-modinsts ?new-assigns ?new-nf) (vl-gte-occform x nf mod ialist warnings))) (vl-modulelist-p new-modules)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinstlist-p-of-vl-gte-occform.new-modinsts (b* (((mv ?new-warnings ?new-modules ?new-modinsts ?new-assigns ?new-nf) (vl-gte-occform x nf mod ialist warnings))) (vl-modinstlist-p new-modinsts)) :rule-classes :rewrite)
Theorem:
(defthm vl-assignlist-p-of-vl-gte-occform.new-assigns (b* (((mv ?new-warnings ?new-modules ?new-modinsts ?new-assigns ?new-nf) (vl-gte-occform x nf mod ialist warnings))) (vl-assignlist-p new-assigns)) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-gte-occform.new-nf (b* (((mv ?new-warnings ?new-modules ?new-modinsts ?new-assigns ?new-nf) (vl-gte-occform x nf mod ialist warnings))) (vl-namefactory-p new-nf)) :rule-classes :rewrite)
Theorem:
(defthm vl-gte-occform-mvtypes-1 (true-listp (mv-nth 1 (vl-gte-occform x nf mod ialist warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-gte-occform-mvtypes-2 (true-listp (mv-nth 2 (vl-gte-occform x nf mod ialist warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-gte-occform-mvtypes-3 (true-listp (mv-nth 3 (vl-gte-occform x nf mod ialist warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-gte-occform-of-vl-assign-fix-x (equal (vl-gte-occform (vl-assign-fix x) nf mod ialist warnings) (vl-gte-occform x nf mod ialist warnings)))
Theorem:
(defthm vl-gte-occform-vl-assign-equiv-congruence-on-x (implies (vl-assign-equiv x x-equiv) (equal (vl-gte-occform x nf mod ialist warnings) (vl-gte-occform x-equiv nf mod ialist warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gte-occform-of-vl-namefactory-fix-nf (equal (vl-gte-occform x (vl-namefactory-fix nf) mod ialist warnings) (vl-gte-occform x nf mod ialist warnings)))
Theorem:
(defthm vl-gte-occform-vl-namefactory-equiv-congruence-on-nf (implies (vl-namefactory-equiv nf nf-equiv) (equal (vl-gte-occform x nf mod ialist warnings) (vl-gte-occform x nf-equiv mod ialist warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gte-occform-of-vl-module-fix-mod (equal (vl-gte-occform x nf (vl-module-fix mod) ialist warnings) (vl-gte-occform x nf mod ialist warnings)))
Theorem:
(defthm vl-gte-occform-vl-module-equiv-congruence-on-mod (implies (vl-module-equiv mod mod-equiv) (equal (vl-gte-occform x nf mod ialist warnings) (vl-gte-occform x nf mod-equiv ialist warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gte-occform-of-vl-warninglist-fix-warnings (equal (vl-gte-occform x nf mod ialist (vl-warninglist-fix warnings)) (vl-gte-occform x nf mod ialist warnings)))
Theorem:
(defthm vl-gte-occform-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-gte-occform x nf mod ialist warnings) (vl-gte-occform x nf mod ialist warnings-equiv))) :rule-classes :congruence)