Author Topic: FPGA based Direct Digital Synthesis  (Read 2894 times)

0 Members and 1 Guest are viewing this topic.

Offline knightTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: sg
FPGA based Direct Digital Synthesis
« on: March 01, 2022, 08:12:49 am »
Hello. I'm trying to generate a discrete-sine waveform using FPGA and then convert it to analog using a DAC and filter. I want to know how can I take the output from the FPGA I/O. The simulation works fine but it is parallel data for example sine[7:0]. I want to take it as a single output to give it to a DAC. Can anyone give any idea?
 

Offline knightTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: sg
Re: FPGA based Direct Digital Synthesis
« Reply #1 on: March 01, 2022, 09:37:51 am »
I got badly confused so sorry. Of course a DAC will have n-bit digital input, my bad. Actually, I don't have the target FPGA board yet so I just ran a power analysis in Xilinx Vivado. I was shocked to see that I/O consumes 7W of power! Now, I don't know if that is accurate as it was just software estimation. Hence, I thought to convert parallel data to serial but I was wrong.
Can you tell me why such a simple implementation is consuming so much power? I don't understand. Thank You/
 

Online Someone

  • Super Contributor
  • ***
  • Posts: 4961
  • Country: au
    • send complaints here
Re: FPGA based Direct Digital Synthesis
« Reply #2 on: March 01, 2022, 10:09:22 am »
I was shocked to see that I/O consumes 7W of power! Now, I don't know if that is accurate as it was just software estimation. Hence, I thought to convert parallel data to serial but I was wrong.
Can you tell me why such a simple implementation is consuming so much power? I don't understand. Thank You
Read the power reporting, it breaks that down into the specifics. But in general something is very misleading/wrong in that figure, a dozen gigabit serdes wouldn't use 7W of power, and that would be driving a 10GS/s DAC.
 
The following users thanked this post: BrianHG, knight

Offline knightTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: sg
Re: FPGA based Direct Digital Synthesis
« Reply #3 on: March 01, 2022, 03:56:55 pm »
Thank you for the reply guys. Greatly appreciate it. I have attached the screenshots of the power breakdown and the power report text file. I don't understand what is going on. I think you will understand it.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: FPGA based Direct Digital Synthesis
« Reply #4 on: March 01, 2022, 04:04:45 pm »
We need to see the entire report for the 1.8V rail.
 
The following users thanked this post: knight

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27923
  • Country: nl
    • NCT Developments
Re: FPGA based Direct Digital Synthesis
« Reply #5 on: March 01, 2022, 04:07:40 pm »
Likely a constraint is wrong (frequency way too high) or something is self-oscillating -according to the power estimator- causing an excessive power prediction.

The text file doesn't list any clock constraints which is a red flag.

Please show us the place & route report which includes which timing constraints are applied to the design.
« Last Edit: March 01, 2022, 04:10:39 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: knight

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: FPGA based Direct Digital Synthesis
« Reply #6 on: March 02, 2022, 07:11:35 am »
You may know this already, but if you have a signal in Vivado's simulator you can right-click on it, and change it's "waveform style" to "analog". This might save you needing a DAC at all! (see attached picture)

Excessive power will be due to not having a clock constraint. To add one, add an 'XDC' file to your project and add a line like this:

Code: [Select]
create_clock -add -name sys_clk_pin -period 10.0 -waveform {0 5.0} [get_ports clk]

That adds a 100MHz clock to the pin called 'clk'. Just change the period (in nanoseconds) to be what you want.

If your DAC needs are modest, you can implement a single bit DAC using just a pin!

Code: [Select]
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity easy_dac is
    Port ( clk        : in STD_LOGIC;
           d_in       : in STD_LOGIC_VECTOR(7 downto 0);
           pulses_out : out STD_LOGIC);
end easy_dac;

architecture Behavioral of easy_dac is
    signal total : unsigned(8 downto 0) := (others => '0');
begin
   pulses_out <= total(8);
   
process(clk)
    begin
        if rising_edge(clk) then
            total <= ("0"&total(7 downto 0)) + unsigned(d_in);
        end if;
    end process;

end Behavioral;

When d_in is 0x20, pulses_out will have a duty cycle of 32/256, at about 1/8th the clock speed
When d_in is 0x80, pulses_out will have a duty cycle of 128/256 at about 1/2th the clock speed

Follow it up with a simple low pass filter (a 200 ohm series resistor followed with an appropriately sized capacitor) and you have your DAC.



 
« Last Edit: March 02, 2022, 07:18:39 am by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: knight

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: FPGA based Direct Digital Synthesis
« Reply #7 on: March 02, 2022, 07:16:27 am »
PS. Oh, and ask how I'm calculating sin() and cos() from that phase value in that screen shot. I'ld love to show you another really neat FPGA thing...

( https://xkcd.com/1053/ )
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: knight

Offline knightTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: sg
Re: FPGA based Direct Digital Synthesis
« Reply #8 on: March 02, 2022, 07:17:10 am »
I forgot to write the constraints file. So, I specified the input clock, reset and the output sine on GPIO of FPGA and the power went down to 127mW. I think it is possible to bring down the power under 100mW or maybe even less by efficient implementation. Thank you all of you.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: FPGA based Direct Digital Synthesis
« Reply #9 on: March 02, 2022, 07:21:30 am »
I forgot to write the constraints file. So, I specified the input clock, reset and the output sine on GPIO of FPGA and the power went down to 127mW. I think it is possible to bring down the power under 100mW or maybe even less by efficient implementation. Thank you all of you.

FPGAs have pretty high power draw even when doing nothing - there is a lot of idle logic leaking electrons :D.

Even if your design doesn't use much power, the will use quite a bit at startup as the load the bitstream.

If you care about power, then FPGAs are not the solution you are looking for.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: knight

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1970
  • Country: us
Re: FPGA based Direct Digital Synthesis
« Reply #10 on: March 02, 2022, 07:39:21 am »
If you care about power, then FPGAs are not the solution you are looking for.

Well that depends, doesn't it?
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: hamster_nz, knight

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27923
  • Country: nl
    • NCT Developments
Re: FPGA based Direct Digital Synthesis
« Reply #11 on: March 02, 2022, 11:52:13 am »
I forgot to write the constraints file. So, I specified the input clock, reset and the output sine on GPIO of FPGA and the power went down to 127mW. I think it is possible to bring down the power under 100mW or maybe even less by efficient implementation. Thank you all of you.

FPGAs have pretty high power draw even when doing nothing - there is a lot of idle logic leaking electrons :D.

Even if your design doesn't use much power, the will use quite a bit at startup as the load the bitstream.

If you care about power, then FPGAs are not the solution you are looking for.
Maybe not the Xilinx device the OP is using but I think there are FPGAs out there which target low power circuits that might be better suited.

Recently I used a Gowin GW1N-1 FPGA in a design (clocked at 25MHz). The power estimator says the total power consumption is 13mW. When I increase the clock frequency to 100MHz, the dissipation goes up to 31mW.
« Last Edit: March 02, 2022, 12:01:17 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15321
  • Country: fr
Re: FPGA based Direct Digital Synthesis
« Reply #12 on: March 02, 2022, 06:17:25 pm »
If you care about power, then FPGAs are not the solution you are looking for.

In general yes, but I don't think the OP really defined the max sampling frequency? If it's moderate, small FPGAs, such as in the iCE40 series, could be used, and power much under 100 mW can definitely be easily achieved. Of course, if you want to implement says 500 Msps DDS, you'll need something much beefier and the 100 mW will be hard to meet.
 

Online Someone

  • Super Contributor
  • ***
  • Posts: 4961
  • Country: au
    • send complaints here
Re: FPGA based Direct Digital Synthesis
« Reply #13 on: March 02, 2022, 08:51:02 pm »
If you care about power, then FPGAs are not the solution you are looking for.
Pretty broad and poor generalization, more typically for power efficiency:

"software solution" < bare metal on general purpose CPU < GPU/FPGA < ASIC

while the implementation effort is almost exactly the reverse of that ordering! Accelerators in CPUs/GPUs move out into the GPU/ASIC region, if they do the task you need.
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 8089
  • Country: ca
Re: FPGA based Direct Digital Synthesis
« Reply #14 on: March 03, 2022, 02:41:18 am »
With a typical 250Mhz DDS running on Altera's Cyclone IV or MAX10 FPGAs, properly written, the entire FPGA should operate within <1 watt.  However, these FPGAs arent the fastest things out there, but for simple comm/audio/video apps, they can fit the bill.  Low power Cyclone10's are slower, but, you can expect less than 0.5watts for the same specs.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: FPGA based Direct Digital Synthesis
« Reply #15 on: March 03, 2022, 10:55:14 am »
With a typical 250Mhz DDS running on Altera's Cyclone IV or MAX10 FPGAs, properly written, the entire FPGA should operate within <1 watt.  However, these FPGAs arent the fastest things out there, but for simple comm/audio/video apps, they can fit the bill.  Low power Cyclone10's are slower, but, you can expect less than 0.5watts for the same specs.

Glancing at the AD9913 datasheet...  250MS/s with integrated 10-bit DAC, and less 100mW.

Of course it isn't as flexible as an FPGA based solution, but who knows, maybe the OP only needs a basic DDS?
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 8089
  • Country: ca
Re: FPGA based Direct Digital Synthesis
« Reply #16 on: March 03, 2022, 12:27:08 pm »
With a typical 250Mhz DDS running on Altera's Cyclone IV or MAX10 FPGAs, properly written, the entire FPGA should operate within <1 watt.  However, these FPGAs arent the fastest things out there, but for simple comm/audio/video apps, they can fit the bill.  Low power Cyclone10's are slower, but, you can expect less than 0.5watts for the same specs.

Glancing at the AD9913 datasheet...  250MS/s with integrated 10-bit DAC, and less 100mW.

Of course it isn't as flexible as an FPGA based solution, but who knows, maybe the OP only needs a basic DDS?
The numbers I specked are approximations based on past experience with altera parts.  They include the use of 2 PLLs and some small additional sub-systems.  You will not beat a dedicated DDS capable IC in power consumption with an FPGA, but, under 1 watt isn't terrible unless you have a battery powered app.  The original Xilinx 7w just for the IOs sounds wrong, but I do know that Xilinx tends to run hot while many of my Alter apps run at room temp without any heatsink needed.  Though, Xilinx can be made to run twice as fast.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf