Skip to content

Commit

Permalink
docs: more tidying
Browse files Browse the repository at this point in the history
Fix 010 pdf link.
Swap yosys script code blocks for literal includes.
Fix broken example code.
  • Loading branch information
KrystalDelusion committed Nov 15, 2023
1 parent bb7ebec commit 0fb5119
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 62 deletions.
2 changes: 1 addition & 1 deletion docs/source/appendix/APPNOTE_010_Verilog_to_BLIF.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Download
========

This document was originally published in April 2015:
:download:`Converting Verilog to BLIF PDF</_downloads/APPNOTE_012_Verilog_to_BTOR.pdf>`
:download:`Converting Verilog to BLIF PDF</_downloads/APPNOTE_010_Verilog_to_BLIF.pdf>`

..
Installation
Expand Down
20 changes: 15 additions & 5 deletions docs/source/code_examples/macc/macc_xilinx_test.ys
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# ============================================================================
# part a
read_verilog macc_xilinx_test.v
read_verilog -lib -icells macc_xilinx_unwrap_map.v
read_verilog -lib -icells macc_xilinx_xmap.v
hierarchy -check ;;

# end part a
show -prefix macc_xilinx_test1a -format dot -notitle test1
show -prefix macc_xilinx_test2a -format dot -notitle test2

# ============================================================================
# part b
techmap -map macc_xilinx_swap_map.v;;

# end part b
show -prefix macc_xilinx_test1b -format dot -notitle test1
show -prefix macc_xilinx_test2b -format dot -notitle test2

# ============================================================================
# part c
techmap -map macc_xilinx_wrap_map.v

connwrappers -unsigned $__mul_wrapper Y Y_WIDTH \
-unsigned $__add_wrapper Y Y_WIDTH;;

# end part c
show -prefix macc_xilinx_test1c -format dot -notitle test1
show -prefix macc_xilinx_test2c -format dot -notitle test2

# ============================================================================
# part d
design -push
read_verilog macc_xilinx_xmap.v
techmap -map macc_xilinx_swap_map.v
Expand All @@ -29,12 +37,14 @@ design -pop
extract -constports -ignore_parameters \
-map %__macc_xilinx_xmap \
-swap $__add_wrapper A,B ;;

# end part d
show -prefix macc_xilinx_test1d -format dot -notitle test1
show -prefix macc_xilinx_test2d -format dot -notitle test2

# ============================================================================
# part e
techmap -map macc_xilinx_unwrap_map.v;;

# end part e
show -prefix macc_xilinx_test1e -format dot -notitle test1
show -prefix macc_xilinx_test2e -format dot -notitle test2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Yosys script for ASIC synthesis of the Amber ARMv2 CPU.
if (ARST)
Q <= ARST_VALUE;
else
<= D;
Q <= D;
endmodule
Expand Down
88 changes: 33 additions & 55 deletions docs/source/using_yosys/yosys_flows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,23 @@ The extract pass

.. todo:: add/expand supporting text

.. literalinclude:: /code_examples/macc/macc_simple_test.ys
:language: yoscrypt
:lines: 1-2

.. figure:: /_images/code_examples/macc/macc_simple_test_00a.*
:class: width-helper

before `extract`
before :cmd:ref:`extract`

.. literalinclude:: /code_examples/macc/macc_simple_test.ys
:language: yoscrypt
:lines: 6

.. figure:: /_images/code_examples/macc/macc_simple_test_00b.*
:class: width-helper

after `extract`
after :cmd:ref:`extract`

.. literalinclude:: /code_examples/macc/macc_simple_test.v
:language: verilog
Expand All @@ -59,13 +67,6 @@ The extract pass
:language: verilog
:caption: ``docs/source/code_examples/macc/macc_simple_xmap.v``

.. code:: yoscrypt
read_verilog macc_simple_test.v
hierarchy -check -top test
extract -map macc_simple_xmap.v;;
.. literalinclude:: /code_examples/macc/macc_simple_test_01.v
:language: verilog
:caption: ``docs/source/code_examples/macc/macc_simple_test_01.v``
Expand Down Expand Up @@ -191,14 +192,10 @@ Wrapping in ``test1``:
.. figure:: /_images/code_examples/macc/macc_xilinx_test1b.*
:class: width-helper

.. code:: yoscrypt
techmap -map macc_xilinx_wrap_map.v
connwrappers -unsigned $__mul_wrapper \
Y Y_WIDTH \
-unsigned $__add_wrapper \
Y Y_WIDTH ;;
.. literalinclude:: /code_examples/macc/macc_xilinx_test.ys
:language: yoscrypt
:start-after: part c
:end-before: end part c

.. figure:: /_images/code_examples/macc/macc_xilinx_test1c.*
:class: width-helper
Expand All @@ -208,57 +205,37 @@ Wrapping in ``test2``:
.. figure:: /_images/code_examples/macc/macc_xilinx_test2b.*
:class: width-helper

.. code:: yoscrypt
techmap -map macc_xilinx_wrap_map.v
connwrappers -unsigned $__mul_wrapper \
Y Y_WIDTH \
-unsigned $__add_wrapper \
Y Y_WIDTH ;;
.. literalinclude:: /code_examples/macc/macc_xilinx_test.ys
:language: yoscrypt
:start-after: part c
:end-before: end part c

.. figure:: /_images/code_examples/macc/macc_xilinx_test2c.*
:class: width-helper

Extract in ``test1``:

.. code:: yoscrypt
design -push
read_verilog macc_xilinx_xmap.v
techmap -map macc_xilinx_swap_map.v
techmap -map macc_xilinx_wrap_map.v;;
design -save __macc_xilinx_xmap
design -pop
extract -constports -ignore_parameters \
-map %__macc_xilinx_xmap \
-swap $__add_wrapper A,B ;;
.. figure:: /_images/code_examples/macc/macc_xilinx_test1c.*
:class: width-helper

.. literalinclude:: /code_examples/macc/macc_xilinx_test.ys
:language: yoscrypt
:start-after: part d
:end-before: end part d

.. figure:: /_images/code_examples/macc/macc_xilinx_test1d.*
:class: width-helper

Extract in ``test2``:

.. code:: yoscrypt
design -push
read_verilog macc_xilinx_xmap.v
techmap -map macc_xilinx_swap_map.v
techmap -map macc_xilinx_wrap_map.v;;
design -save __macc_xilinx_xmap
design -pop
extract -constports -ignore_parameters \
-map %__macc_xilinx_xmap \
-swap $__add_wrapper A,B ;;
.. figure:: /_images/code_examples/macc/macc_xilinx_test2c.*
:class: width-helper

.. literalinclude:: /code_examples/macc/macc_xilinx_test.ys
:language: yoscrypt
:start-after: part d
:end-before: end part d

.. figure:: /_images/code_examples/macc/macc_xilinx_test2d.*
:class: width-helper

Expand All @@ -267,13 +244,14 @@ Unwrap in ``test2``:
.. figure:: /_images/code_examples/macc/macc_xilinx_test2d.*
:class: width-helper

.. literalinclude:: /code_examples/macc/macc_xilinx_test.ys
:language: yoscrypt
:start-after: part e
:end-before: end part e

.. figure:: /_images/code_examples/macc/macc_xilinx_test2e.*
:class: width-helper

.. code:: yoscrypt
techmap -map macc_xilinx_unwrap_map.v ;;
Symbolic model checking
-----------------------

Expand Down

0 comments on commit 0fb5119

Please sign in to comment.