+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Advanced Member level 5
    Points: 11,780, Level: 26

    Join Date
    Aug 2011
    Posts
    2,408
    Helped
    280 / 280
    Points
    11,780
    Level
    26

    What FPGA logic do constants consume

    Hello,

    Suppose I have a large set of ~6000 vectors ( 16 bits each ) which I use as coefficients in my design.
    There's no address decoding (each set is connected to a specific logic block) and all sets are constant during compile time.

    Will these be implemented as simple wires to VCC / GND or there's a chance that the tool will use LUTs / Registers / RAM for some reason ?

    •   Alt11th July 2017, 22:20

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 33,755, Level: 44
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,180
    Helped
    1808 / 1808
    Points
    33,755
    Level
    44

    Re: What FPGA logic do constants consume

    They just get connected to VCC/GND



    •   Alt11th July 2017, 22:22

      advertising

        
       

  3. #3
    Super Moderator
    Points: 231,316, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    39,925
    Helped
    12197 / 12197
    Points
    231,316
    Level
    100

    Re: What FPGA logic do constants consume

    If it's appropriate to store the constants in ROM (initialized RAM), you can do that. The tools won't do that "for some reason" rather than your decision.



    •   Alt11th July 2017, 22:30

      advertising

        
       

  4. #4
    Advanced Member level 5
    Points: 11,780, Level: 26

    Join Date
    Aug 2011
    Posts
    2,408
    Helped
    280 / 280
    Points
    11,780
    Level
    26

    Re: What FPGA logic do constants consume

    If it's appropriate to store the constants in ROM (initialized RAM), you can do that.
    I don't want to do that.
    I need all values to be accessible simultaneously and (obviously) would prefer it consumes no resources other then routing to VCC / GND.

    Again,
    I have a large array of N vectors and N circuits.
    Each vector is connected to a different circuit.
    The vectors are all constant during compile time.

    Intuitively, I see no reason why these constant vectors shall be implemented by something other than simple wires to either VCC or GND.
    And this is exactly what I want...but I'm not 100% sure.

    Do you agree that that's what would happen ?



  5. #5
    Advanced Member level 5
    Points: 33,755, Level: 44
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,180
    Helped
    1808 / 1808
    Points
    33,755
    Level
    44

    Re: What FPGA logic do constants consume

    Why not compile the design, and take a look?



    •   Alt12th July 2017, 07:33

      advertising

        
       

  6. #6
    Super Moderator
    Points: 231,316, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    39,925
    Helped
    12197 / 12197
    Points
    231,316
    Level
    100

    Re: What FPGA logic do constants consume

    I need all values to be accessible simultaneously and (obviously) would prefer it consumes no resources other then routing to VCC / GND.
    Why did you ask about RAM then?

    You'll surely get GND/VCC wires in RTL netlist. During synthesis, all possible logic minimizations will be made, pulling the constants into the logic terms. (Unless the logic blocks are locked).


    1 members found this post helpful.

  7. #7
    Advanced Member level 3
    Points: 3,955, Level: 14

    Join Date
    Apr 2016
    Posts
    823
    Helped
    153 / 153
    Points
    3,955
    Level
    14

    Re: What FPGA logic do constants consume

    Quote Originally Posted by TrickyDicky View Post
    They just get connected to VCC/GND
    Not really, it is more complicated than that. You don't want to have any logic lumped to the ground/vdd wires as they would bounce a lot. You'd typically provide a constant that comes from a special gate called tiecell. There are cells for tie high and tie low. The FPGA vendor might hide that from you, but internally that is how it works.
    Really, I am not Sam.


    1 members found this post helpful.

  8. #8
    Super Moderator
    Points: 26,525, Level: 39
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,030
    Helped
    1477 / 1477
    Points
    26,525
    Level
    39

    Re: What FPGA logic do constants consume

    Quote Originally Posted by ThisIsNotSam View Post
    Not really, it is more complicated than that. You don't want to have any logic lumped to the ground/vdd wires as they would bounce a lot. You'd typically provide a constant that comes from a special gate called tiecell. There are cells for tie high and tie low. The FPGA vendor might hide that from you, but internally that is how it works.
    Exactly this....

    Shown implemented in Vivado like this:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	7 
Size:	5.4 KB 
ID:	139887
    Click image for larger version. 

Name:	Capture2.PNG 
Views:	12 
Size:	25.2 KB 
ID:	139888


    1 members found this post helpful.

--[[ ]]--