Skip to content

Commit bc77575

Browse files
Docs: Fix word_logic.rst
It somehow got lost in the rebase.
1 parent c93fd54 commit bc77575

File tree

3 files changed

+47
-45
lines changed

3 files changed

+47
-45
lines changed

docs/source/cell/index_word.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Simulation models for the RTL cells can be found in the file
2323
/cell/word_mem
2424
/cell/word_fsm
2525
/cell/word_arith
26+
/cell/word_logic
2627
/cell/word_spec
2728
/cell/word_formal
2829
/cell/word_debug

docs/source/cell/word_arith.rst

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ Coarse arithmetics
33

44
.. todo:: Add information about `$alu`, `$fa`, and `$lcu` cells.
55

6-
Multiply-accumulate
7-
~~~~~~~~~~~~~~~~~~~
8-
96
The `$macc` cell type represents a generalized multiply and accumulate
107
operation. The cell is purely combinational. It outputs the result of summing up
118
a sequence of products and other injected summands.
@@ -47,48 +44,6 @@ CONFIG parameter carries the following information:
4744
4845
B is an array of concatenated 1-bit-wide unsigned integers to also be summed up.
4946

50-
Arbitrary logic functions
51-
~~~~~~~~~~~~~~~~~~~~~~~~~
52-
53-
The `$lut` cell type implements a single-output LUT (lookup table). It
54-
implements an arbitrary logic function with its ``\LUT`` parameter to map input
55-
port ``\A`` to values of ``\Y`` output port values. In psuedocode: ``Y =
56-
\LUT[A]``. ``\A`` has width set by parameter ``\WIDTH`` and ``\Y`` has a width
57-
of 1. Every logic function with a single bit output has a unique `$lut`
58-
representation.
59-
60-
The `$sop` cell type implements a sum-of-products expression, also known as
61-
disjunctive normal form (DNF). It implements an arbitrary logic function. Its
62-
structure mimics a programmable logic array (PLA). Output port ``\Y`` is the sum
63-
of products of the bits of the input port ``\A`` as defined by parameter
64-
``\TABLE``. ``\A`` is ``\WIDTH`` bits wide. The number of products in the sum is
65-
set by parameter ``\DEPTH``, and each product has two bits for each input bit -
66-
for the presence of the unnegated and negated version of said input bit in the
67-
product. Therefore the ``\TABLE`` parameter holds ``2 * \WIDTH * \DEPTH`` bits.
68-
69-
For example:
70-
71-
Let ``\WIDTH`` be 3. We would like to represent ``\Y =~\A[0] + \A[1]~\A[2]``.
72-
There are 2 products to be summed, so ``\DEPTH`` shall be 2.
73-
74-
.. code-block::
75-
76-
~A[2]-----+
77-
A[2]----+|
78-
~A[1]---+||
79-
A[1]--+|||
80-
~A[0]-+||||
81-
A[0]+|||||
82-
|||||| product formula
83-
010000 ~\A[0]
84-
001001 \A[1]~\A[2]
85-
86-
So the value of ``\TABLE`` will become ``010000001001``.
87-
88-
Any logic function with a single bit output can be represented with ``$sop`` but
89-
may have variously minimized or ordered summands represented in the ``\TABLE``
90-
values.
91-
9247
.. autocellgroup:: arith
9348
:members:
9449
:source:

docs/source/cell/word_logic.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Arbitrary logic functions
2+
-------------------------
3+
4+
The `$lut` cell type implements a single-output LUT (lookup table). It
5+
implements an arbitrary logic function with its ``\LUT`` parameter to map input
6+
port ``\A`` to values of ``\Y`` output port values. In psuedocode: ``Y =
7+
\LUT[A]``. ``\A`` has width set by parameter ``\WIDTH`` and ``\Y`` has a width
8+
of 1. Every logic function with a single bit output has a unique `$lut`
9+
representation.
10+
11+
The `$sop` cell type implements a sum-of-products expression, also known as
12+
disjunctive normal form (DNF). It implements an arbitrary logic function. Its
13+
structure mimics a programmable logic array (PLA). Output port ``\Y`` is the sum
14+
of products of the bits of the input port ``\A`` as defined by parameter
15+
``\TABLE``. ``\A`` is ``\WIDTH`` bits wide. The number of products in the sum is
16+
set by parameter ``\DEPTH``, and each product has two bits for each input bit -
17+
for the presence of the unnegated and negated version of said input bit in the
18+
product. Therefore the ``\TABLE`` parameter holds ``2 * \WIDTH * \DEPTH`` bits.
19+
20+
For example:
21+
22+
Let ``\WIDTH`` be 3. We would like to represent ``\Y =~\A[0] + \A[1]~\A[2]``.
23+
There are 2 products to be summed, so ``\DEPTH`` shall be 2.
24+
25+
.. code-block::
26+
27+
~A[2]-----+
28+
A[2]----+|
29+
~A[1]---+||
30+
A[1]--+|||
31+
~A[0]-+||||
32+
A[0]+|||||
33+
|||||| product formula
34+
010000 ~\A[0]
35+
001001 \A[1]~\A[2]
36+
37+
So the value of ``\TABLE`` will become ``010000001001``.
38+
39+
Any logic function with a single bit output can be represented with ``$sop`` but
40+
may have variously minimized or ordered summands represented in the ``\TABLE``
41+
values.
42+
43+
.. autocellgroup:: logic
44+
:members:
45+
:source:
46+
:linenos:

0 commit comments

Comments
 (0)