Proper organization of function/procedures requiring global signals

Discussion in 'VHDL' started by Garrick, Sep 27, 2005.

  1. Garrick

    Garrick Guest

    I already have a system in place in Verilog, and now I'm trying to get
    everything ported smoothly to VHDL and am having some difficulty. Of
    course, perhaps my Verilog setup isn't smooth either.

    I have a test bench that I want to simulate higher level function calls
    down to my design. For instance, within my test bench, I have a DUT
    connected, clocks generate, resets, etc, but I also have a process that
    makes calls like:

    process
    begin
    -- SendValue(address, value)
    SendValue(x"00", x"1234");

    -- UpdateValue;
    UpdateValue;

    ....

    wait;
    end process;

    SendValue(...) and UpdateValue are procedure calls, but they are also
    designed to look and function similar to function calls one of our
    customers would make on a PC in C++, Python, Java, etc. On the PC, our
    API's and hardware/firmware make the connection to the FPGA world. In
    the simulation world, I need some behavioral procedures and functions to
    make the connection.

    Anyway, in Verilog, I was able to seperate a large list of functions and
    tasks into a Call.v file, that is then included at the bottom of the
    test bench with an `include "Call.v" directive. The functions and tasks
    in Call.v are included at compile time at this point. Not perfect, but
    it works. The functions and tasks in Call.v are able to utilize global
    signals like the clocks, resets, data busses, etc. in the test bench
    that aren't explicitly passed.

    However, in VHDL, it would be nice to put all my functions and
    procedures into a package. Unfortunatly, I can't get global access back
    and forth between this package and my other signals. I also don't want
    to spam the test bench, which is otherwise quite clean with hundreds of
    lines of procedures and functions.

    Any suggestions on how to organize this?

    Thanks,
    Garrick
    Garrick, Sep 27, 2005
    #1
    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. Alexander Grigoriev
    Replies:
    0
    Views:
    371
    Alexander Grigoriev
    Sep 12, 2003
  2. Replies:
    1
    Views:
    374
    Michael Ekstrand
    Aug 21, 2005
  3. Chris P
    Replies:
    2
    Views:
    491
  4. André Hänsel

    Code organization / initialize global array

    André Hänsel, Jul 18, 2010, in forum: C Programming
    Replies:
    15
    Views:
    956
    Keith Thompson
    Jul 26, 2010
  5. Tim McDaniel
    Replies:
    22
    Views:
    203
    Ben Morrow
    Sep 17, 2008
Loading...

Share This Page