Turn a vl-bitlist into a 4vec. Assumes msb-first ordering, such as in a vl-weirdint.
(vl-bitlist->4vec msb-bits) → val
Function:
(defun vl-bitlist->4vec (msb-bits) (declare (xargs :guard (vl-bitlist-p msb-bits))) (let ((__function__ 'vl-bitlist->4vec)) (declare (ignorable __function__)) (let ((lsb-bits (rev (vl-bitlist-fix msb-bits)))) (sv::4vec (vl-bitlist->onset lsb-bits) (lognot (vl-bitlist->offset lsb-bits))))))
Theorem:
(defthm 4vec-p-of-vl-bitlist->4vec (b* ((val (vl-bitlist->4vec msb-bits))) (sv::4vec-p val)) :rule-classes :rewrite)
Theorem:
(defthm vl-bitlist->4vec-of-vl-bitlist-fix-msb-bits (equal (vl-bitlist->4vec (vl-bitlist-fix msb-bits)) (vl-bitlist->4vec msb-bits)))
Theorem:
(defthm vl-bitlist->4vec-vl-bitlist-equiv-congruence-on-msb-bits (implies (vl-bitlist-equiv msb-bits msb-bits-equiv) (equal (vl-bitlist->4vec msb-bits) (vl-bitlist->4vec msb-bits-equiv))) :rule-classes :congruence)