You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Verilog creates a sequential 5-bit register (``r_counter``) which increments every clock cycle.
174
174
If the count is below ``16`` it drives the output (``o_led``) high, otherwise it drives it low.
@@ -184,9 +184,9 @@ Lets start by making a fresh directory for us to work in:
184
184
185
185
Next we need to run the three main sets of tools:
186
186
187
-
* :ref:`odin_II` performs 'synthesis' which converts our behavioural Verilog into a circuit netlist (``.blif`` file) consisting of logic equations and FPGA architecture primitives (Flip-Flops, adders etc.),
188
-
* :ref:`ABC` performs 'logic optimization' which simplifies the circuit logic, and 'technology mapping' which converts logic equations to Look-Up-Tables (LUTs), and
189
-
* :ref:`VPR` which performs packing, placement and routing of the circuit onto the targetted FPGA architecture.
187
+
* :ref:`odin_II` performs 'synthesis' which converts our behavioural Verilog (``.v`` file) into a circuit netlist (``.blif`` file) consisting of logic equations and FPGA architecture primitives (Flip-Flops, adders etc.),
188
+
* :ref:`ABC` performs 'logic optimization' which simplifies the circuit logic, and 'technology mapping' which converts logic equations into the Look-Up-Tables (LUTs) available on an FPGA, and
189
+
* :ref:`VPR` which performs packing, placement and routing of the circuit to implement it on the targetted FPGA architecture.
190
190
191
191
Synthesizing with ODIN II
192
192
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -220,15 +220,15 @@ Some interesting highlights are shown below:
220
220
221
221
.. literalinclude:: blink.odin.blif
222
222
:lines: 14,40
223
-
:caption: Instantiations of rising-edge triggered Latches (i.e. Flip-Flops) in ``blink.odin.blif`` which implement (``r_counter`` in blink.v)
223
+
:caption: Instantiations of rising-edge triggered Latches (i.e. Flip-Flops) in ``blink.odin.blif`` (implements part of ``r_counter`` in blink.v)
224
224
225
225
.. literalinclude:: blink.odin.blif
226
226
:lines: 17-19,21-22
227
-
:caption: Adder primitive instantiations in ``blink.odin.blif``, used to perform addition (``+`` operator in blink.v)
227
+
:caption: Adder primitive instantiations in ``blink.odin.blif``, used to perform addition (implements part of the ``+`` operator in blink.v)
228
228
229
229
.. literalinclude:: blink.odin.blif
230
230
:lines: 45-50
231
-
:caption: Logic equation (.names truth-table) in ``blink.odin.blif``, implementing logical OR
231
+
:caption: Logic equation (.names truth-table) in ``blink.odin.blif``, implementing logical OR (implements part of the ``<`` operator in blink.v)
232
232
233
233
.. seealso:: For more information on the BLIF file format see :ref:`blif_format`.
234
234
@@ -242,7 +242,7 @@ Next, we'll optimize and technology map our circuit using ABC, providing the opt
242
242
We'll use the following, simple ABC commands::
243
243
244
244
read blink.odin.blif; #Read the circuit synthesized by ODIN
245
-
if -K 6; #Technology map to 6-LUTs
245
+
if -K 6; #Technology map to 6 input LUTs (6-LUTs)
246
246
write_hie blink.odin.blif blink.abc_no_clock.blif #Write new circuit to blink.abc_no_clock.blif
247
247
248
248
.. note:: Usually you should use a more complicated script (such as that used by :ref:`run_vtr_flow`) to ensure ABC optitmizes your circuit well.
@@ -271,11 +271,12 @@ If we now inspect the produced BLIF file (``blink.abc_no_clock.blif``) we see th
271
271
272
272
ABC has kept the ``.latch`` and ``.subckt adder`` primitives, but has significantly simplified the other logic (``.names``).
273
273
274
+
275
+
However, there is an issue with the above BLIF produced by ABC: the latches (rising edge Flip-Flops) do not have any clocks specified, which is information required by VPR.
276
+
274
277
Re-inserting clocks
275
278
^^^^^^^^^^^^^^^^^^^
276
-
There is an issue with the above BLIF produced by ABC.
277
-
The latches (rising edge Flip-Flops) do not have any clocks specified, which is information required by VPR.
278
-
We will restore this information by running a script which will transfer that information from the original ODIN BLIF file:
279
+
We will restore the clock information by running a script which will transfer that information from the original ODIN BLIF file (writing it to the new file ``blink.pre-vpr.blif``):
279
280
280
281
.. code-block:: bash
281
282
@@ -299,7 +300,7 @@ If we inspect ``blink.pre-vpr.blif`` we now see that the clock (``blink^clk``) h
299
300
300
301
Implementing the circuit with VPR
301
302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302
-
Now that we have the optimized and technology mapped netlist (``blink.pre-vpr.blif``), we can invoke VPR to implement it onto the ``EArch`` FPGA architecture, in the same way we did with the ``tseng`` design.
303
+
Now that we have the optimized and technology mapped netlist (``blink.pre-vpr.blif``), we can invoke VPR to implement it onto the ``EArch`` FPGA architecture (in the same way we did with the ``tseng`` design earlier).
303
304
However, since our BLIF file doesn't match the design name we explicitly specify:
304
305
305
306
* ``blink`` as the circuit name, and
@@ -340,14 +341,14 @@ We can then view the implementation as usual by appending ``--analysis --disp on
340
341
341
342
Automatically Running the VTR Flow
342
343
----------------------------------
343
-
Running each stage of the flow manually is time consuming.
344
+
Running each stage of the flow manually is time consuming (and potentially error prone).
344
345
For convenience, VTR provides a script (:ref:`run_vtr_flow`) which automates this process.
345
346
346
347
Lets make a new directory to work in named ``blink_run_flow``:
347
348
348
349
.. code-block:: bash
349
350
350
-
> mkdir -p ~/vtr_work/quickstart/blink_manual
351
+
> mkdir -p ~/vtr_work/quickstart/blink_run_flow
351
352
>cd~/vtr_work/quickstart/blink_run_flow
352
353
353
354
Now lets run the script (``$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.pl``) passing in:
@@ -371,7 +372,7 @@ The resulting command is:
371
372
-temp_dir . \
372
373
--route_chan_width 100
373
374
374
-
.. note:: Options unrecognized by run_vtr_flow (like --route_chan_width) are passed on to VPR.
375
+
.. note:: Options unrecognized by run_vtr_flow (like ``--route_chan_width``) are passed on to VPR.
375
376
376
377
which should produce output similar to::
377
378
@@ -395,7 +396,7 @@ You will also see there are several BLIF files produced:
With the main files of intereset being ``blink.odin.blif`` (netlist produced by ODIN), ``blink.abc.blif`` (final netlist produced by ABC after clock restoration), ``blink.pre-vpr.blif`` netlist used by VPR (identical to ``blink.abc.blif``).
399
+
With the main files of interest being ``blink.odin.blif`` (netlist produced by ODIN), ``blink.abc.blif`` (final netlist produced by ABC after clock restoration), ``blink.pre-vpr.blif`` netlist used by VPR (usually identical to ``blink.abc.blif``).
399
400
400
401
Like before, we can also see the implementation files generated by VPR:
401
402
@@ -421,9 +422,9 @@ Now that you've finished the VTR quickstart, you're ready to start experimenting
421
422
422
423
Here are some possible next steps for users wishing to use VTR:
423
424
424
-
* Try modifying the verilog file (e.g. ``blink.v``) or make your own circuit and try running it through the flow.
425
+
* Try modifying the Verilog file (e.g. ``blink.v``) or make your own circuit and try running it through the flow.
425
426
426
-
* Learn about FPGA architecture modelling (:ref:`Tutorials <arch_tutorial>`, :ref:`Reference <fpga_architecture_description>`), and try modifying a copy of ``EArch`` to see how it changes the implementation of ``blinky.v``.
427
+
* Learn about FPGA architecture modelling (:ref:`Tutorials <arch_tutorial>`, :ref:`Reference <fpga_architecture_description>`), and try modifying a copy of ``EArch`` to see how it changes the implementation of ``blink.v``.
427
428
428
429
* Read more about the :ref:`VTR CAD Flow <vtr_cad_flow>`, and :ref:`Task <vtr_tasks>` automation framework.
0 commit comments