Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Generate VHDL code from VHDL code

Hello,

I have been wondering for a while if it is possible to let some standard tool (like quartus, or ISE or maybe even a windows tool) generate a VHDL file from previous written VHDL code.

For example when you have some different VHDL files you have written before, and theyre all reusable. Is it possible to say; I want these 3 files working together and now try and make a toplevel for me?

Or do you have to write your own file in a different language that links them all together?

I hope it is somewhat clear, but I can understand that it might be too vague, so please ask questions that might help making my question clear.

Thanks in advance

34 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I just meant to say, that I don't have the information about what this exact component should do.

    --- Quote End ---

    Why not? Even if a component is a black-box component provided by someone else, you can still write a testbench to ensure that it adheres to its interface standard, eg., if I wanted to check that an Altera Avalon-MM slave component worked correctly, I would use the Avalon-MM verification IP suite to test it.

    --- Quote Start ---

    but wait, what if this component isn't doing the right thing, I must at least tell the user it will not work.

    --- Quote End ---

    Any how do you tell if the component isn't doing the right thing if you do not test it?

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    if I wanted to check that an Altera Avalon-MM slave component worked correctly, I would use the Avalon-MM verification IP suite to test it

    --- Quote End ---

    That sounds not so weird indeed. The interface should be able to be tested without knowing what the exact component does. But I would never know if the answer the component supplies is of any logical value, unless I have written the design myself and know when it should give output y with input x. Thats where I was thinking.

    --- Quote Start ---

    Any how do you tell if the component isn't doing the right thing if you do not test it?

    --- Quote End ---

    That was the line where I was thinking about when I can start thinking about that testbench. Since I am still a bit stuck to design the thing itself, I cannot write a testbench yet. Because than I would have to know the exact design and think about how to define my generated design works.

    How weird is it that I am thinking about using another language to read the entity inputs and outputs to know which ones I need to put in my toplevel?

    So at that point I know which files i need to include, so I also know which entities. But I don't know which inputs and outputs the entity has and how can I connect this component if I don't know the in or outputs?

    Or am I overseeing some features of VHDL? In my understandings I can use the generates when I already have instantiated the components and the same with configurations.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I thought I should say I have made my program very different than what I thought was possible.

    I think indeed it is not possible, or very hard, to generate such a project all with just VHDL.

    So I had made a program which could make such a design, I think that is possible in any software language.

    I am not quite sure if it would be possible if the designs dont have any relations with each other.

    Main point is indeed that you really need to know exactly what kind of designs need to be generated, otherwise you keep writing the wrong things and can't figure out whats the way to deal with it.

    I didn't have time to write a testbench, so it is only 'tested' via the RTL design.

    Thanks again Dave for the input you have given, maybe I haven't used the things you mentioned, but I sure learned a lot:)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I thought I should say I have made my program very different than what I thought was possible.

    --- Quote End ---

    To some degree this is why writing an example, or prototype, is a good idea ... your ideas evolve as you write code.

    --- Quote Start ---

    I didn't have time to write a testbench, so it is only 'tested' via the RTL design.

    --- Quote End ---

    Take the time to write a testbench for each module. If each module has a standardized interface, eg., Avalon-MM or AXI, then once you have written the first testbench, the others are very simple.

    --- Quote Start ---

    Thanks again Dave for the input you have given, maybe I haven't used the things you mentioned, but I sure learned a lot:)

    --- Quote End ---

    You're welcome. I'm not bothered if you do not follow my advice, but eventually you'll figure out that some of it is good :)

    Cheers,

    Dave