Dynamic instantiation/removal of TB components?

Discussion in 'VHDL' started by jjohnson@cs.ucf.edu, Aug 11, 2005.

  1. Guest

    Hello Gurus of VHDL,

    I have synthesizable VHDL code for a receiver (my DUT).

    In my VHDL testbench, I want to model an *arbitrary* number of
    overlapping transmitters in the area, each of which can generate a
    "long" waveform (2000 to 20000 clocked samples, depending on message
    format).

    Can I dynamically (and at random) instantiate (and destroy) instances
    of a transmitter model/component?

    I'd like to have transmitters randomly enter and leave the reception
    area, and while in range, independently of (and asynchronous to) each
    other, transmit their signal to my DUT. The input to my DUT comes from
    an A/D converter model, whose output should be the sum of all the
    currently active transmitter signals.

    ANY SUGGESTIONS ON THE BEST APPROACH? (Should I switch to SystemC?)

    Some considerations follow:

    If not multiple dynamic instantiations of a transmitter "component",
    might it be better to create ONE transmitter model that can generate an
    arbitrary number of signals itself?

    Since each transmitter's output is async wrt others, and the output
    waveforms vary between 2000 and 20000 clock cycles, a single model (one
    instance) would have to keep track of all state info (including time,
    or relative time) for each waveform being generated.

    If the number of overlapping transmitter waveforms is arbitrary, would
    I have to use dynamic memory allocation (access types?) to do this?

    Less elegant methods would include instantiating a fixed number of
    simple transmitters, or writing an arrayed implementation of a
    transmitter/summer. In either case, some upper limit on the number of
    transmitters would likely be hardcoded.

    Either way, I need to have ONE adder (with appropriate number of
    inputs) summing the transmitter outputs and producing one output to
    drive my A/D converter model.

    I currently use an ugly, standalone C program to generate text files
    that represent the summed (superimposed) overlapping waveforms. These
    files are read in by the A/D converter model in my testbench, and
    that's what drives the DUT.

    C does not model the concurrency well, and the limitations of reading a
    canned file (slow I/O, no dynamic adaptation of the transmitted
    signals, difficulty in self-checking) are my motivations do this all
    dynamically (in simulator memory).

    I did something like the dynamic multiple instantiations in an Ada
    project 15 years ago, but can't find the code or remember how I did it.

    Would something like SystemC (which I barely know) constructors and
    destructors make this easier, and integrate well into a VHDL (ModelSim)
    testbench?

    Thanks very much for any and all constructive feedback. I really do
    appreciate it.

    mj
     
    , Aug 11, 2005
    #1
    1. Advertising

  2. Hubble Guest

    I do not understand fully what you want, but it sounds to me that the
    following could help:

    >Can I dynamically (and at random) instantiate (and destroy) instances
    >of a transmitter model/component?


    No.

    use a GENERIC noofwaves: natural;

    In your testbench, use a generate statement to instantiate the
    waveforms

    signal outs: std_logic_vector(noofwaves-1 downto 0;
    Waves:
    for i in noofwaves-1 dowto 0 generate
    WF: wavefrom PORT MAP (N=> i; O=> outs(i));
    end generate;

    GenSum: process(outs)
    begin
    .. sum all outs
    end process;

    You can then generate waveform entities. Each of these could even read
    from an input file

    entity waveform is
    port (N: in integer; O: out std_logic);
    end entity;

    architecture reader of waveform is
    procedure waveform_from_file(no: integer; signal O: out std_logic) is
    file wavefile : text := "waveform_" & integer'image(no);
    begin
    ... -- read values and times from wavefile (waveform_0,
    waveform_1,..)
    end;
    begin
    waveform_from_file(N,O);
    end;

    You can define the generic and the architectures in a configuration.
    This will enable you to use an "arbitrary" number of different
    waveforms without defining a maximum at compile time.
     
    Hubble, Aug 15, 2005
    #2
    1. Advertising

  3. Neo Guest

    you can also try having fixed number of multiple transmitters each
    transmitting independently and so designed that each of them shut down
    randomly for a random duration of time.
     
    Neo, Aug 18, 2005
    #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. VHDL User

    Components instantiation in loop?

    VHDL User, Sep 5, 2004, in forum: VHDL
    Replies:
    1
    Views:
    4,024
    Egbert Molenkamp
    Sep 5, 2004
  2. kw
    Replies:
    4
    Views:
    1,304
    Edward
    Jul 14, 2004
  3. Mickey Segal
    Replies:
    0
    Views:
    899
    Mickey Segal
    Feb 2, 2004
  4. Martin
    Replies:
    1
    Views:
    386
    Mike Treseler
    Dec 13, 2006
  5. Replies:
    1
    Views:
    580
    Salt_Peter
    Dec 25, 2006
Loading...

Share This Page