Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Carry Chain used as delay line - Problems with supllying LUT-s with ones and zeros

I am trying to implement carry chain with Cyclone IV FPGA. I will use carry chain as delay line so here is quick explanation of my program: When input signal "START" goes high, signal starts to propagate through chain and in moment when STOP occurs, propagation is sampled by registers. To do so, all it takes is to set all the bits of the first operand (input a) to ‘1’ and the bits of the second operand to ‘0’ (input b). Code which works fine for me is :

library ieee;

use ieee.std_logic_1164.all;

use ieee.numeric_std.all;

entity DelayLine is

generic (

DATA_WIDTH : natural := 20

);

port (

output: out signed ((DATA_WIDTH-1) downto 0);

a: in signed ((DATA_WIDTH-1) downto 0);

b: in signed ((DATA_WIDTH-1) downto 0);

START: in std_logic

);

end DelayLine;

architecture rtl of DelayLine is

SIGNAL reg: signed ((DATA_WIDTH-1) downto 0);

SIGNAL buf: signed ((DATA_WIDTH-1) downto 0);

SIGNAL STOP: std_logic;

SIGNAL I: integer := 0;

begin

process (START)

variable s : signed ((DATA_WIDTH) downto 0);

begin

s := ('0' & a) + ('0' & b) + ('0' & START);

buf<=s((DATA_WIDTH-1) downto 0);

if (falling_edge(START)) then

output<=buf((DATA_WIDTH-1) downto 0);

end if;

end process;

end rtl;

PROBLEM: Currently my only idea how to supply every adder block with two required signals ('1' and '0') is to make another two registers; one register with ones and other with zeros. Such solution is making a lots of problems in my design. My question is it possible to make some more simple circuit which will supply adders with ones and zeros. I have tried with nonsequential registers (All elements forced to high or low state) but then my carry chain gets deformation.

37 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have tested TDC. Only thing I was doing wrong were START and STOP blocks which caused usage of strange paths. So here is how I test delay line. I am using dynamic phase configuration in PLL. I have two signals from PLL. First one is START signal and it is connected directly to Carry in at the beginning of delay line. Phase shifted signal is used for latching FF's. I was changing phase with step of 100 ps. I was watching output of first 8 adders in delay line on LEDs. Every increase of phase step caused propagation through two adders which means that resolution is around 50 ps.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    For you using FFs latch delay-line's result, i think you can use SignalTap II to test your TDC. It's better than you current way.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for this interesting papers! I am currently testing my TDC and here is my transfer function:

    http://www.alteraforum.com/forum/attachment.php?attachmentid=12292&stc=1

    One thing bothers me; I was testing TDC as I have explained earlier with dynamic phase shift from PLL. I am shifting with external push button, one push means one shift but I am not quite sure that dynamic shift is done every time so I am looking to find a way to be sure about that. This TDC transfer characteristics was done in hope that every time when I pushed the button, signal has been shifted for another 96 ps.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Pretty impressive and I would say linearity is good enough... According to most of the papers I have read testing is done by means of density test for a given time delay. I think sort of pulse train with random noise modulation (inducing jitter) would be good enough.... I hope my description is clear enough...

    Let me know if you still use your original TDC (adder based) with the register in the front? Did you try to adapt and test the code I have posted? Let me know if you need wysiwyg doc for your cyclone series...

    According to the chart it looks like the delay line is about 80 cells?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have used original TDC (adder based) and everything is done as I have explained in earlier posts. Yeah measurement results are looking very good. Delay line was 128 cells long. I was adding 96 ps of shift in every step. Now my main problem is how to make tests with better resolution; my Cyclone IV is only resource for that so I need to see if I can do some better measurements.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't think you may obtain better resolution based on this simple TDC, all improvements for FPGA based designs I have read about, are based on more complicated structures and processing (wave union, double sampling, vernier methods etc) which I find unjustified effort at list in my case. Instead I am investigating analog interpolators which are quite simple and allow easy achievable high resolution with good linearity. Classical analog interpolator are based on pulse stretching method, you will find lot of examples by simple google search. Another novel method you may see in the attached paper, I find it very interesting and promising, it could be a small add on board with sigma-delta ADC on FPGA if you want to avoid any external ADC or additional microcontroller with embedded ADC...