0
\$\begingroup\$

How does an FPGA synthesis tool decide how to implement arithmetic operations on the target hardware?

For example, if I implement some integer multiplication and division operations directly in HDL statements, the hardware implementation options could be:

  • A LUT for all possible input combinations.
  • Some multiplication or division algorithms such as Booth / Baugh-Wooley etc. using full adders.
  • An ALU.

Does the synthesis tool just do the first option and generate a LUT for all input combinations unless a specific architecture is defined?

Is there any way of knowing what implementation the synthesis tool has used?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ an ALU is an element of a CPU, not a concept in the context of FPGAs. Do you perhaps mean "DSP slice"? \$\endgroup\$ Commented Apr 30, 2024 at 19:39

2 Answers 2

4
\$\begingroup\$

It's going to depend on the target FPGA part and the synthesis tools used.

With the most basic FPGAs and tools, all of your RTL code gets divided up into combinational Boolean equations and registers. All arithmetics get converted into Boolean equations. Those equations get partitioned and mapped into the LUTs for the best utilization.

As you go up the scale of increasing FPGA complexity, they start including blocks for operations like addition, multiplication, and multiply/accumulate. And they can get up to full blown ALUs. Synthesis tools will try to map your RTL to the highest level blocks available, and everything else gets mapped into LUTs.

Of course, many FPGAs now contain large CPUs, but synthesis tools are not advanced enough to map to them automatically—you must manually instantiate them.

Most vendor's synthesis tools provide reports or schematics that show how your RTL got mapped.

\$\endgroup\$
2
  • \$\begingroup\$ Is there a way of determining how the FPGA has implemented the RTL code in hardware? \$\endgroup\$ Commented May 1, 2024 at 7:54
  • 2
    \$\begingroup\$ @b7031719 the synthesis tools will usually show you exactly what they have inferred. For example Quartus has the "Technology Map Viewer". \$\endgroup\$ Commented May 1, 2024 at 9:30
1
\$\begingroup\$

Each serious FPGA synthesis tool chain includes tools to output the resulting RTL design. The accompanied documentation lists them and their usage.

Commonly you can expect at least these two options:

  1. A textual view in form of a set of VHDL sources, which contain lots of primitive components and their connections.
  2. A graphical view in form of a set of schematics, which show lots of primitive components and their connections.

The set of VHDL sources is the prerequisite to test against the timing requirements.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.