abstract type signal

Discussion in 'VHDL' started by Ilya Kalistru, May 22, 2013.

  1. Hi everyone!

    I have a module, that makes some actions with signal S of the type myType. This actions with signal S is independent of its type.

    For using this modules for signals of various types I create a copies of module with another name and "Find and replace" myType to MyOtherType.
    I think that it is conceptually wrong way.

    Is there a way to define a signal of abstract data type and substitute the correct type in place abstract when I need use it? May I use "generic" for this purpose?
    Ilya Kalistru, May 22, 2013
    1. Advertisements

  2. Ilya Kalistru

    Rob Gaddi Guest

    That's a feature in VHDL-2008, and in my experience one that's not very widely supported yet.
    Rob Gaddi, May 22, 2013
    1. Advertisements

  3. Ilya Kalistru

    Andy Guest

    I agree with Rob, but notify your tool vendor(s) if they do not yet support it(generic types). This will help them prioritize implementation of 2008 features, and let the know that more customers want to use 2008 features.

    Andy, May 23, 2013
  4. I had the same experience recently in which I had to make four almost-identical modules so I tried passing in the type as a generic, which looks like this:

    entity delay is
    generic (type DATATYPE);
    port (...

    In my notes I see that this was supported by my synthesizer (Synplify Pro) but not by Modelsim 10.1d, which despite being sold for ridiculous prices, does not support basic features from a standard from 2008, which if I calculate correctly, was FIVE YEARS AGO.

    Even if this feature is supported, it's not really that great. It would bepreferable to have an unconstrained type, so you could do something like this:

    signal internal_sig : data_in'type(data_in'range);

    Your other option is to use Verilog.
    kevin.neilson, May 23, 2013
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.