Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > component instantiation with generic parameter defined within a file

Reply
Thread Tools

component instantiation with generic parameter defined within a file

 
 
Louis Dupont
Guest
Posts: n/a
 
      08-31-2004
Hi!

I'd like to instantiate a component with generic parameters within a
test bench. I would like one of the generic pameters to be defined
within a file. Unfortunately, I can't declare a variable within a
generate statement and I can't declare it as a signal neither. And I
can't instantiate a component within a process statement. Any thoughts
about it can be done? Thanks
 
Reply With Quote
 
 
 
 
Allan Herriman
Guest
Posts: n/a
 
      08-31-2004
On 30 Aug 2004 17:13:14 -0700, (Louis Dupont)
wrote:

>Hi!
>
> I'd like to instantiate a component with generic parameters within a
>test bench. I would like one of the generic pameters to be defined
>within a file. Unfortunately, I can't declare a variable within a
>generate statement and I can't declare it as a signal neither. And I
>can't instantiate a component within a process statement. Any thoughts
>about it can be done? Thanks


The "generic parameters" must be known at elaboration time. This
happens before you can perform file I/O. Therefore this can't be done
directly in VHDL.

There are probably many ways to work around your problem though, one
of which would be using a scripting language to read the file and
write some VHDL (with the generic values read from the file). This
VHDL would then be compiled, elaborated and run (possibly by the same
script).

Regards,
Allan
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      08-31-2004
Louis Dupont wrote:

> Hi!
>
> I'd like to instantiate a component with generic parameters within a
> test bench. I would like one of the generic pameters to be defined
> within a file.


A package body containing deferred constants could be
stored in a file.

Or a script file could supply the constants
via a command line option to the sim or synth program.

-- Mike Treseler
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generic Component Instantiation minhajhassan VHDL 0 09-26-2008 10:36 AM
Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. krunalbauskar@gmail.com C++ 1 12-25-2006 03:51 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM
Instantiation of lots of the some component Cor van Loos VHDL 2 12-09-2004 05:53 AM
Questions about Timing analysis and Component Instantiation. systolic VHDL 1 11-29-2004 03:18 PM



Advertisments