Forum Discussion

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

How do I connect two vhdl files

If I have two vhdl files for two blocks and I want to connect them to each other what do I do?

7 Replies

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

    You can use a block diagram file to connect them visually...

    In quartus, new file : block diagram file

    You can also make a third VHDL file an with PORT MAP you can connect them...

    But I am a beginner and I'm not sure...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thx for your reply

    I have to make sure because I'm short in time

    I saw they add a library file and use it in other files
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you dont even need a component decalration. Its alot safer to just use direct instantiation:

    my_inst : entity work.my_ent --this is the direct instantiation part

    port map (

    );

    Using this method, errors with the port map are picked up by the compiler instead of the simulator/synthesis (ie. you find errors alot quicker.)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I dont understand

    I make this port map in third file or in 1 of the files
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You better do it in 3rd vhdl file.

    This 3rd file will have proper input/outputs and be dedicated to declaring the other two modules inside as components and then connecting inputs/outputs of these internal two modules together and with top level inputs/outputs. i.e. just structural vhdl(nothing else).