guidoism
guidoism

Reputation: 8158

What do assignments with math operators (+, -, <, etc) get synthesized to?

Clearly it will depend on the compiler and target — But is there a de facto standard? Do they synthesize as entire ALUs? Or as whatever the minimum adder or comparator would look like?

Another way to ask this question: If I were to have a bunch of logic with math in the verilog might it end up much larger than sticking in a simple cpu and forcing the calculations through that?

Upvotes: 1

Views: 166

Answers (1)

Oldfart
Oldfart

Reputation: 6259

But is there a de facto standard? Do they synthesize as entire ALUs? Or as whatever the minimum adder or comparator would look like?

They will synthesize to the smallest block of logic which can still full-fill the operation in the required time.

I have opened up one of my mathematical blocks for you: A bilinear interpolator. This is the structure before it goes into the synthesis tool. At that time it is already a set of dedicated operations. The synthesis tool will then optimize these by e.g. reducing the amount of logic and/or merging functions. enter image description here

If I were to have a bunch of logic with math in the Verilog might it end up much larger than sticking in a simple cpu and forcing the calculations through that?

Definitely not. You can think yourself through that:

  • A CPU is build from Verilog code.
  • That CPU has adders, multipliers etc.
  • If you would use a CPU instead of each of those, you would get recursion.

Upvotes: 1

Related Questions