Run an
(stv-fully-general-simulation-debug n mod override-stbits) → (mv init-st in-alists nst-alists out-alists int-alists)
This is practically identical to stv-fully-general-simulation-run, except that it also gathers up and returns a
list of
These expressions are useful for generating waveforms for debugging simulations. We could have just had stv-fully-general-simulation-run always compute them, but computing the internal signals can be expensive so we want to avoid it unless we're actually doing debugging.
Due to the structure of esim, we get a lot of memoized sharing between the
We memoize this function so that if we're reusing an STV, we can just reuse the same general simulation repeatedly as we debug with different values. BOZO as with the -run function, maybe we should be doing the memoization at the level of individual steps, instead of memoizing the whole thing.
Function:
(defun stv-fully-general-simulation-debug (n mod override-stbits) (declare (xargs :guard (and (posp n) (symbol-listp override-stbits)))) (let ((__function__ 'stv-fully-general-simulation-debug)) (declare (ignorable __function__)) (b* ((in-alists (stv-fully-general-in-alists n mod)) (init-st-alist (stv-fully-general-st-alist mod)) (override-alists (stv-fully-general-in-alists-aux (- n 1) override-stbits nil)) ((mv nsts outs internals) (ec-call (stv-run-esim-debug mod in-alists override-alists init-st-alist)))) (mv init-st-alist in-alists nsts outs internals))))
Theorem:
(defthm len-of-stv-fully-general-simulation-debug-1 (equal (len (mv-nth 1 (stv-fully-general-simulation-debug nphases mod override-stbits))) (nfix nphases)))
Theorem:
(defthm len-of-stv-fully-general-simulation-debug-2 (equal (len (mv-nth 2 (stv-fully-general-simulation-debug nphases mod override-stbits))) (nfix nphases)))
Theorem:
(defthm len-of-stv-fully-general-simulation-debug-3 (equal (len (mv-nth 3 (stv-fully-general-simulation-debug nphases mod override-stbits))) (nfix nphases)))
Theorem:
(defthm len-of-stv-fully-general-simulation-debug-4 (equal (len (mv-nth 4 (stv-fully-general-simulation-debug nphases mod override-stbits))) (nfix nphases)))
Theorem:
(defthm cons-list-listp-of-stv-fully-general-simulation-debug-1 (cons-list-listp (mv-nth 1 (stv-fully-general-simulation-debug nphases mod override-stbits))))