FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-2006, 01:23 PM
Roger Bourne
Guest
 
Posts: n/a
Default How are constants stored ?

Hello all,

I always wondered the following:

How are constants implemented in an FPGA ? How many can be stored
without causing bottlenecks (routing issues)?
A quick scan of a Spartan3 indicated there is no ROM.

Thx
-Roger

Reply With Quote
  #2 (permalink)  
Old 04-27-2006, 02:14 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Roger Bourne wrote:

> How are constants implemented in an FPGA ?


All FPGA gates are synthesized in look-up tables.
A constant is synthesized with tables set for fixed output.
Think of it as wires to power or ground.

> How many can be stored
> without causing bottlenecks (routing issues)?


Try it and see.
One constant bit per LUT is maximum.

-- Mike Treseler
Reply With Quote
  #3 (permalink)  
Old 04-27-2006, 02:23 PM
Aurelian Lazarut
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Mike Treseler wrote:
> Roger Bourne wrote:
>
>> How are constants implemented in an FPGA ?

>
>
> All FPGA gates are synthesized in look-up tables.
> A constant is synthesized with tables set for fixed output.
> Think of it as wires to power or ground.
>
>> How many can be stored
>> without causing bottlenecks (routing issues)?

>
>
> Try it and see.
> One constant bit per LUT is maximum.
>
> -- Mike Treseler


and some routing resources have tie offs (to gnd or vcc) mostly on the
gaskets of hard ip blocks.
Aurash
Reply With Quote
  #4 (permalink)  
Old 04-27-2006, 02:36 PM
c d saunter
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Roger,
It's not exactly as simple as 'storing' them... Often a constant
input to some logic results in a simplifaction of the logic (e.g. 1 and x
just becomes x) and this is propogated through the design by the tools,
pruning off redundant logic etc. Any constant input to the base LUTs in
the design can be absorbed into the LUT contents and so is never
explicitly stored.

Or if you mean a lookup table of addressable constants they may be stored
in LUT ram or embedded RAM etc. depending on how they are coded.

A constant input to an embedded resource such as a RAM or multiplier will
be stored in slice registers (flip flops) within the device.

hth
cds
Roger Bourne ([email protected]) wrote:
: Hello all,

: I always wondered the following:

: How are constants implemented in an FPGA ? How many can be stored
: without causing bottlenecks (routing issues)?
: A quick scan of a Spartan3 indicated there is no ROM.

: Thx
: -Roger

Reply With Quote
  #5 (permalink)  
Old 04-27-2006, 02:49 PM
Roger Bourne
Guest
 
Posts: n/a
Default Re: How are constants stored ?


c d saunter wrote:
> Roger,
> It's not exactly as simple as 'storing' them... Often a constant
> input to some logic results in a simplifaction of the logic (e.g. 1 and x
> just becomes x) and this is propogated through the design by the tools,
> pruning off redundant logic etc. Any constant input to the base LUTs in
> the design can be absorbed into the LUT contents and so is never
> explicitly stored.
>
> Or if you mean a lookup table of addressable constants they may be stored
> in LUT ram or embedded RAM etc. depending on how they are coded.
>
> A constant input to an embedded resource such as a RAM or multiplier will
> be stored in slice registers (flip flops) within the device.
>
> hth
> cds
> Roger Bourne ([email protected]) wrote:
> : Hello all,
>
> : I always wondered the following:
>
> : How are constants implemented in an FPGA ? How many can be stored
> : without causing bottlenecks (routing issues)?
> : A quick scan of a Spartan3 indicated there is no ROM.
>
> : Thx
> : -Roger



Actually,
what I was pondering was how a set of constants that are suppose to be
routed to the same operand of a multiplier (not at the same time, of
course ), will be stored.

> A constant input to an embedded resource such as a RAM or multiplier will
> be stored in slice registers (flip flops) within the device.


I guess, from the above, it means that the constants will stored in
the same number of FFs as the number of bits of the constants.

-Roger

Reply With Quote
  #6 (permalink)  
Old 04-27-2006, 03:03 PM
c d saunter
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Roger Bourne ([email protected]) wrote:

: c d saunter wrote:

: Actually,
: what I was pondering was how a set of constants that are suppose to be
: routed to the same operand of a multiplier (not at the same time, of
: course ), will be stored.

: > A constant input to an embedded resource such as a RAM or multiplier will
: > be stored in slice registers (flip flops) within the device.

: I guess, from the above, it means that the constants will stored in
: the same number of FFs as the number of bits of the constants.

Roger I snarfed there - looks like they are stored in the LUTs not the
FFs.

There are several options for efficient storage of multiple constants for
a multiplier etc. - in a Xilinx device the LUTs may act as 16x1 ROMs or
RAMs or a 16 bit shift register. So if you wanted to store say 16 8 bit
constants you would only need 8 LUTs and no extra routing overhead
compared to having only 1 constant (except for the addressing) It's called Distrbuted
RAM in the X. devices. If you only need cyclic and not random access to
the data using the shift mode simplifies things - SRL16E. Involve the
slice FF as well as the LUT and get an extra element...

cds
Reply With Quote
  #7 (permalink)  
Old 04-27-2006, 03:22 PM
Ben Jones
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Hi Roger,

"Roger Bourne" <[email protected]> wrote in message
news:[email protected] oups.com...
>
> what I was pondering was how a set of constants that are suppose to be
> routed to the same operand of a multiplier (not at the same time, of
> course ), will be stored.
>
> > A constant input to an embedded resource such as a RAM or multiplier

will
> > be stored in slice registers (flip flops) within the device.

>
> I guess, from the above, it means that the constants will stored in
> the same number of FFs as the number of bits of the constants.


Actually, a constant will rarely if ever be stored in a flip-flop, because
the tools will optimize away a flip-flop that never toggles and replace it
with a LUT driving the same value. Since there are only two possible values
for each bit, you need a minimum of two LUTs to give you "global" 1/0
signals, which can then be routed to the appropriate input(s). Your original
question seemed to be: does this cause routing congestion, and if so, how
can I avoid it? The answer is that the implementation tools will (read:
/should/) take care of this for you, by duplicating these constant drivers
appropriately

However, in your case, it sounds like you actually want a ROM to store your
multiplier coefficients. What you describe seems to be a number of constant
values, fed to a multiplexor that selects the appropriate constant given the
state of some other signals in your design. Now say that you have four
signals that determine which constant to use on the current clock cycle. For
each bit of the constant operand you need a function that determines what
that bit should be. This function is four-bit input, one bit output: i.e. it
is a LUT. So in fact all of your constants (up to 16 of them) will fit in N
LUTs, where N is the number of bits of the constant.

When the said four bits are a binary-encoded address, the LUT is effectively
being used as a conventional ROM.

In general, constants are rarely "stored" in any recognizable way in an
FPGA, except in ROM tables; rather, constant propagation at synthesis time
causes them to be absorbed into the surrounding logical expressions (often
simplifying them and reducing the area consumed by your circuit).

Cheers,

-Ben-


Reply With Quote
  #8 (permalink)  
Old 04-27-2006, 08:56 PM
Jon Elson
Guest
 
Posts: n/a
Default Re: How are constants stored ?



Roger Bourne wrote:

>Hello all,
>
>I always wondered the following:
>
>How are constants implemented in an FPGA ? How many can be stored
>without causing bottlenecks (routing issues)?
>A quick scan of a Spartan3 indicated there is no ROM.
>
>

Actually, the LUTs of all FPGAs **ARE** ROMs! They are very SMALL
ROMs, but they are a ROM until you reconfigure the FPGA differently.

Jon

Reply With Quote
  #9 (permalink)  
Old 04-28-2006, 10:50 AM
Aurelian Lazarut
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Jon Elson wrote:
>
>
> Roger Bourne wrote:
>
>> Hello all,
>>
>> I always wondered the following:
>>
>> How are constants implemented in an FPGA ? How many can be stored
>> without causing bottlenecks (routing issues)?
>> A quick scan of a Spartan3 indicated there is no ROM.
>>
>>

> Actually, the LUTs of all FPGAs **ARE** ROMs! They are very SMALL
> ROMs, but they are a ROM until you reconfigure the FPGA differently.

Jon,
this is not quite true (or at least doesn't apply to all Xilinx
architectures)
in virtex2/pro all LUTs can be loaded (serially in SRL mode) in later
architectures some of them (SLICEM) can be used as RAM, more, some of
our customers are using this feature, to reload coefficients for
filters, or pixels for led displays, or to make "runtime reprogramable
gates". More advanced users know that a lut used as logic, still can
load bits in SRL mode, to reload the lut, and are taking advantage of this.
Aurash
>
> Jon
>

Reply With Quote
  #10 (permalink)  
Old 04-28-2006, 09:59 PM
Simon Peacock
Guest
 
Posts: n/a
Default Re: How are constants stored ?

Usually constants are just absorbed into the code. If you have a large
amount and they are indexed then either block rams are used (pre-loaded) or
LUT-RAMS.
so
A <= x"45" or B
will set bits 0, 2 & 7 and put B into the rest of the bits.

Simon

"Aurelian Lazarut" <[email protected]> wrote in message
news:[email protected]
> Jon Elson wrote:
> >
> >
> > Roger Bourne wrote:
> >
> >> Hello all,
> >>
> >> I always wondered the following:
> >>
> >> How are constants implemented in an FPGA ? How many can be stored
> >> without causing bottlenecks (routing issues)?
> >> A quick scan of a Spartan3 indicated there is no ROM.
> >>
> >>

> > Actually, the LUTs of all FPGAs **ARE** ROMs! They are very SMALL
> > ROMs, but they are a ROM until you reconfigure the FPGA differently.

> Jon,
> this is not quite true (or at least doesn't apply to all Xilinx
> architectures)
> in virtex2/pro all LUTs can be loaded (serially in SRL mode) in later
> architectures some of them (SLICEM) can be used as RAM, more, some of
> our customers are using this feature, to reload coefficients for
> filters, or pixels for led displays, or to make "runtime reprogramable
> gates". More advanced users know that a lut used as logic, still can
> load bits in SRL mode, to reload the lut, and are taking advantage of

this.
> Aurash
> >
> > Jon
> >



Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SystemVerilog Constants? Amal Verilog 4 12-08-2008 08:18 PM
Use explicitly sized constants? Paul Marciano Verilog 17 11-29-2005 06:39 PM
real constants in XST gallen FPGA 2 08-22-2005 01:49 PM
output-value isn't stored Manfred Balik FPGA 4 07-13-2005 07:27 PM
where are the PAO files for the system.bsp stored??? nara_chak45 FPGA 0 05-19-2005 01:16 AM


All times are GMT +1. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved