title: VHDL component and outputs based on generic
body: <p>I have a system consisting out of several components that has to be attached to a bus. However to keep the system bus independent, I gave the system a generic bus port that I run through a bus specific module that translates between my system and a specific bus. Thus it is easy to connect the entire system to different buses by switching the translating module.</p>
  
  <p>However I don't want to go through the hassle of connecting the system with the translation module every time. Thus I wonder if it is possible to instantiate a module from a generic parameter, and use its types for the outputs of the architecture.</p>
  
  <p>The whole becomes clearer with a little illustration, my translator modules have the following "signature".</p>
  
  <pre><code>entity translate&lt;BusName&gt;
  port(toSystem: out toSystem_t,
    fromSystem: in fromSystem_t,
    toBus: out to&lt;BusName&gt;_t,
    fromBus: in from&lt;BusName&gt;_t
  end entity;
  </code></pre>
  
  <p>I now want to build an entity containing the system and a translator, based on a generic, somewhat like so:</p>
  
  <pre><code>entity entireSystem is
    generic(busType := translate&lt;BusName&gt;)
    port(toBus: out to&lt;BusName&gt;_t,
         fromBus: in from&lt;BusName&gt;_t)
  end entity
  
  architecture genArc of entireSystem is
     signal toTrans: fromSystem;
     signal fromTrans: toSystem;
  begin
     system: system(toTrans,fromTrans)
     translator: translate&lt;BusName&gt;(
         fromTrans,
         toTrans,
         toBus,
         fromBus
     )
  end architecture;
  </code></pre>
  
  <p>My problems are:
  Can I use a generic parameter to directly instantiate a component, or do I have to go the <code>if generic=xxx generate</code> path? Can I derive the type of ports from a generic parameter.
  It would be best if I can use one generic parameter to determine the ports and the entity, so that one can not pick wrong types for an entity by accidents. It would be fine to derive the types from the generic parameter with a function.</p>