(vl-build-range-select name indices range) → select-expr
Function:
(defun vl-build-range-select (name indices range) (declare (xargs :guard (and (vl-scopeexpr-p name) (vl-exprlist-p indices) (vl-erange-p range)))) (let ((__function__ 'vl-build-range-select)) (declare (ignorable __function__)) (b* (((vl-erange range) range)) (case range.type (:vl-index (make-vl-index :scope name :indices (append-without-guard indices (list range.left)) :part (make-vl-partselect-none))) (:vl-colon (make-vl-index :scope name :indices indices :part (vl-range->partselect (make-vl-range :msb range.left :lsb range.right)))) (:vl-pluscolon (make-vl-index :scope name :indices indices :part (vl-plusminus->partselect (make-vl-plusminus :base range.left :width range.right :minusp nil)))) (otherwise (make-vl-index :scope name :indices indices :part (vl-plusminus->partselect (make-vl-plusminus :base range.left :width range.right :minusp t))))))))
Theorem:
(defthm vl-expr-p-of-vl-build-range-select (b* ((select-expr (vl-build-range-select name indices range))) (vl-expr-p select-expr)) :rule-classes :rewrite)