Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Integers only as generics?

 
Thread Tools Search this Thread
Old 09-22-2003, 01:59 PM   #1
Default Integers only as generics?


Dear all,

I'm currently designing a peripheral device in VHDL, which is
connected to a 32-bit bus. As I want to make its position in the
memory map parametrizable, I defined a mask as a generic constant
parameter. Here is the code sample below:

entity bus_peripheral is
generic(
DEVICE_ID : std_logic_vector(7 downto 0);
REVISION_NO : std_logic_vector(7 downto 0);

BASE_ADDR : std_logic_vector(31 downto 0); -- Base address
on the bus

-- timing settings (100MHz clk)
T1 : integer := 10;
T2 : integer := 28;
T3 : integer := 23
);
port(
clk : in std_logic;
rst : in std_logic;

-- bus signals
--
);
end entity;

The above code compiles with no problems under ModelSim with "check
for synthesis" enabled, yet it makes Synopsys Design Compiler issue an
error. The error message I get is:
"Only generics of type INTEGER are supported for synthesys
(VHDL-2024)".
Is that really a limitation of Synopsys DC? If so, I am really
disappointed... I had the impression DC is the best synth tool around
. Did you guys have this problem with other tools? Is any workaround
possible?

Thanks for answers


Acciduzzu
  Reply With Quote
Old 09-22-2003, 02:54 PM   #2
Ralf Hildebrandt
 
Posts: n/a
Default Re: Integers only as generics?
Hi Acciduzzu


> entity bus_peripheral is
> generic(
> DEVICE_ID : std_logic_vector(7 downto 0);
> REVISION_NO : std_logic_vector(7 downto 0);
>
> BASE_ADDR : std_logic_vector(31 downto 0); -- Base address
> on the bus
>
> -- timing settings (100MHz clk)
> T1 : integer := 10;
> T2 : integer := 28;
> T3 : integer := 23
> );




> The above code compiles with no problems under ModelSim with "check
> for synthesis" enabled, yet it makes Synopsys Design Compiler issue an
> error. The error message I get is:
> "Only generics of type INTEGER are supported for synthesys
> (VHDL-2024)".


What's the problem? There are conversion functions, that help you using
integer als generic parameters.

e.g.:

DEVICE_ID : integer:=to_integer(unsigned("00000000"));


O.k., you have to convert all parameters to integer, when instanziating
a component and often you have to reconvert the generic parameters to
use them inside the component, but it's only a little bit more code to
write.


Ralf



Ralf Hildebrandt
  Reply With Quote
Old 09-22-2003, 05:47 PM   #3
Acciduzzu
 
Posts: n/a
Default Re: Integers only as generics?
Ralf,

converting them to integers is a good solution, but it only works for
parameters that are less than 32-bit wide! I heard, however, that the
new VHDL standard - 2004? - will allow integers with unlimited size.
Until then... waiting for some practical solutions


Acciduzzu
  Reply With Quote
Old 09-22-2003, 07:25 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: Integers only as generics?

> converting them to integers is a good solution, but it only works for
> parameters that are less than 32-bit wide! I heard, however, that the
> new VHDL standard - 2004? - will allow integers with unlimited size.
> Until then... waiting for some practical solutions


Consider passing just the vector lengths as generic
and use that in the architecture or process to declare
the vector or natural type you really want.

-- Mike Treseler



Mike Treseler
  Reply With Quote
Old 09-23-2003, 01:45 AM   #5
Allan Herriman
 
Posts: n/a
Default Re: Integers only as generics?
On 22 Sep 2003 05:59:52 -0700, (Acciduzzu) wrote:

[snip]
>The above code compiles with no problems under ModelSim with "check
>for synthesis" enabled,


Modelsim's "check for synthesis" doesn't actually do many useful
checks.

>yet it makes Synopsys Design Compiler issue an
>error. The error message I get is:
> "Only generics of type INTEGER are supported for synthesys
>(VHDL-2024)".
>Is that really a limitation of Synopsys DC? If so, I am really
>disappointed... I had the impression DC is the best synth tool around
>.


It's not a very good tool in terms of language coverage.

>Did you guys have this problem with other tools? Is any workaround
>possible?


Your code should work well in other synth tools, e.g. Leonardo,
Synplify.

Regards,
Allan.


Allan Herriman
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
constants as of array of integers, for loops octavsly Hardware 0 04-25-2009 11:53 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46