Stefan Holst 1 year ago
parent
commit
8957db48ab
  1. 2
      src/kyupy/logic.py

2
src/kyupy/logic.py

@ -28,12 +28,14 @@ Except when bit0 differs from bit1, but bit2 (activity) is 0:
Logic values are stored in numpy arrays of data type ``np.uint8``. Logic values are stored in numpy arrays of data type ``np.uint8``.
The axis convention is as follows: The axis convention is as follows:
* The **last** axis goes along patterns/vectors. I.e. ``values[...,0]`` is pattern 0, ``values[...,1]`` is pattern 1, etc. * The **last** axis goes along patterns/vectors. I.e. ``values[...,0]`` is pattern 0, ``values[...,1]`` is pattern 1, etc.
* The **second-to-last** axis goes along the I/O and flip-flops of circuits. For a circuit ``c``, this axis is usually * The **second-to-last** axis goes along the I/O and flip-flops of circuits. For a circuit ``c``, this axis is usually
``len(c.s_nodes)`` long. The values of all inputs, outputs and flip-flops are stored within the same array and the location ``len(c.s_nodes)`` long. The values of all inputs, outputs and flip-flops are stored within the same array and the location
along the second-to-last axis is determined by the order in ``c.s_nodes``. along the second-to-last axis is determined by the order in ``c.s_nodes``.
Two storage formats are used in KyuPy: Two storage formats are used in KyuPy:
* ``mv...`` (for "multi-valued"): Each logic value is stored in the least significant 3 bits of ``np.uint8``. * ``mv...`` (for "multi-valued"): Each logic value is stored in the least significant 3 bits of ``np.uint8``.
* ``bp...`` (for "bit-parallel"): Groups of 8 logic values are stored as three ``np.uint8``. This format is used * ``bp...`` (for "bit-parallel"): Groups of 8 logic values are stored as three ``np.uint8``. This format is used
for bit-parallel logic simulations. It is also more memory-efficient. for bit-parallel logic simulations. It is also more memory-efficient.

Loading…
Cancel
Save