Skip to content

Commit dfe803b

Browse files
Docs: Comments from @jix
- Unswap shift/shiftx - Add brief overview to cell lib - Clarify $div cell B input - Clarify unary operators - What is $modfloor
1 parent 927dc44 commit dfe803b

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

docs/source/cell/properties.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Cell properties
1515
.. cell:defprop:: x-output
1616
1717
These cells can produce 'x' output even if all inputs are defined. For
18-
example, a `$div` cell with ``B=0`` has undefined output.
18+
example, a `$div` cell with divisor (``B``) equal to zero has undefined
19+
output.
1920

2021
Refer to the :ref:`propindex` for the list of cells with a given property.

docs/source/cell/word_binary.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ Division and modulo cells are available in two rounding modes. The original
6666
`$div` and `$mod` cells are based on truncating division, and correspond to the
6767
semantics of the verilog ``/`` and ``%`` operators. The `$divfloor` and
6868
`$modfloor` cells represent flooring division and flooring modulo, the latter of
69-
which is also known as "remainder" in several languages. See the following table
70-
for a side-by-side comparison between the different semantics.
69+
which corresponds to the ``%`` operator in Python. See the following table for a
70+
side-by-side comparison between the different semantics.
7171

7272
.. table:: Comparison between different rounding modes for division and modulo cells.
7373

docs/source/cell/word_unary.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ For the unary cells that output a logical value (`$reduce_and`, `$reduce_or`,
3838
``Y_WIDTH`` parameter is greater than 1, the output is zero-extended, and only
3939
the least significant bit varies.
4040

41-
Note that `$reduce_or` and `$reduce_bool` actually represent the same logic
42-
function. But the HDL frontends generate them in different situations. A
43-
`$reduce_or` cell is generated when the prefix ``|`` operator is being used. A
44-
`$reduce_bool` cell is generated when a bit vector is used as a condition in an
45-
``if``-statement or ``?:``-expression.
41+
Note that `$reduce_or` and `$reduce_bool` generally represent the same logic
42+
function. But the `read_verilog` frontend will generate them in different
43+
situations. A `$reduce_or` cell is generated when the prefix ``|`` operator is
44+
being used. A `$reduce_bool` cell is generated when a bit vector is used as a
45+
condition in an ``if``-statement or ``?:``-expression.
4646

4747
.. autocellgroup:: unary
4848
:members:

docs/source/cell_index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Internal cell library
22
=====================
33

4-
.. todo:: brief overview of internal cell library
4+
The intermediate language used by Yosys (RTLIL) represents logic and memory with
5+
a series of cells. This section provides details for those cells, breaking them
6+
down into two major categories: coarse-grain word-level cells; and fine-grain
7+
gate-level cells. An additional section contains a list of properties which may
8+
be shared across multiple cells.
59

610
.. toctree::
711
:maxdepth: 2

techlibs/common/simlib.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,10 @@ endmodule
528528
// --------------------------------------------------------
529529

530530
//* ver 2
531-
//* title Indexed part-select
531+
//* title Variable shifter
532532
//* group binary
533-
//* tags x-output
534-
//- Same as the `$shift` cell, but fills with 'x'.
533+
//- Performs a right logical shift if the second operand is positive (or
534+
//- unsigned), and a left logical shift if it is negative.
535535
//-
536536

537537
module \$shift (A, B, Y);
@@ -567,10 +567,10 @@ endmodule
567567
// --------------------------------------------------------
568568

569569
//* ver 2
570-
//* title Variable shifter
570+
//* title Indexed part-select
571571
//* group binary
572-
//- Performs a right logical shift if the second operand is positive (or
573-
//- unsigned), and a left logical shift if it is negative.
572+
//* tags x-output
573+
//- Same as the `$shift` cell, but fills with 'x'.
574574
//-
575575

576576
module \$shiftx (A, B, Y);

0 commit comments

Comments
 (0)