component instantiation with generic parameter defined within a file

Discussion in 'VHDL' started by Louis Dupont, Aug 31, 2004.

  1. Louis Dupont

    Louis Dupont Guest

    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
     
    Louis Dupont, Aug 31, 2004
    #1
    1. Advertising

  2. 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
     
    Allan Herriman, Aug 31, 2004
    #2
    1. Advertising

  3. 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
     
    Mike Treseler, Aug 31, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. systolic
    Replies:
    1
    Views:
    677
    Mike Treseler
    Nov 29, 2004
  2. Cor van Loos
    Replies:
    2
    Views:
    504
  3. Oodini
    Replies:
    1
    Views:
    1,796
    Keith Thompson
    Sep 27, 2005
  4. Replies:
    1
    Views:
    587
    Salt_Peter
    Dec 25, 2006
  5. minhajhassan

    Generic Component Instantiation

    minhajhassan, Sep 26, 2008, in forum: VHDL
    Replies:
    0
    Views:
    685
    minhajhassan
    Sep 26, 2008
Loading...

Share This Page