diff --git a/docs/source/code_examples/macro_commands/synth_ice40.ys b/docs/source/code_examples/macro_commands/synth_ice40.ys index adefa59c2..f949f9e87 100644 --- a/docs/source/code_examples/macro_commands/synth_ice40.ys +++ b/docs/source/code_examples/macro_commands/synth_ice40.ys @@ -26,6 +26,9 @@ coarse: opt_expr opt_clean memory_dff + alumacc -macc-only + maccmap -unmap + opt_clean wreduce t:$mul techmap select a:mul2dsp diff --git a/docs/source/getting_started/example_synth.rst b/docs/source/getting_started/example_synth.rst index a156bdfac..9202ba3a6 100644 --- a/docs/source/getting_started/example_synth.rst +++ b/docs/source/getting_started/example_synth.rst @@ -406,7 +406,7 @@ The next group of commands performs a series of optimizations: .. literalinclude:: /code_examples/macro_commands/synth_ice40.ys :language: yoscrypt :start-at: wreduce - :end-before: t:$mul + :end-before: macc-only :dedent: :caption: ``coarse`` section (part 2) :name: synth_coarse2 @@ -477,12 +477,19 @@ take a quick look at the commands here and describe what they do. .. literalinclude:: /code_examples/macro_commands/synth_ice40.ys :language: yoscrypt - :start-at: t:$mul - :end-before: alumacc + :start-at: macc-only + :end-at: chtype :dedent: :caption: ``coarse`` section (part 3) :name: synth_coarse3 +The first three commands reassociate sums of products. :yoscrypt:`alumacc +-macc-only` collects each chain of `$mul` and `$add` cells into a single +`$macc_v2` cell, and :yoscrypt:`maccmap -unmap` lowers it straight back to +`$mul` and `$add` cells, but as a chain with the plain addends first, so that +every multiplier has an adder of its own for `ice40_dsp` to absorb. +`opt_clean` then removes the original cells. + :yoscrypt:`wreduce t:$mul` performs width reduction again, this time targetting only cells of type `$mul`. :yoscrypt:`techmap -map +/mul2dsp.v -map +/ice40/dsp_map.v ... -D DSP_NAME=$__MUL16X16` uses `techmap` to map `$mul` @@ -516,7 +523,7 @@ That brings us to the fourth and final part for the iCE40 synthesis flow: .. literalinclude:: /code_examples/macro_commands/synth_ice40.ys :language: yoscrypt - :start-at: alumacc + :start-after: chtype :end-before: map_ram: :dedent: :caption: ``coarse`` section (part 4)