title: Where to declare a constant or type used in an entity declaration?
body: <p>If I haven't misunderstood this completely, a constant or type can not be declared at the top level of a file. Only packages, entities, architectures et.c. can be declared there. They can be declared in the entity but not before the port and generic clauses.</p>
  
  <p>Often you would want to define a type or constant for use in the port or generic clause of an entity but since this can't be declared at the top level of the file and not inside the entity either, where should this be declared?</p>