Dear René,

If I call 'ghdl -e test second', or add a top architecture which
explicitly instantiates test(second), the problem remains. However, if I
do as you suggested and replace all entity instantiations with
components, which are then bound via a configuration, the (equivalent of
the) minimal code I provided does compile.

Regards,
Sander

On Thu, 2015-08-27 at 08:31 +0300, René Doß wrote:
> Hallo,
> 
> what should GHDL do with your multiple architecture?
> There is no reference.
> 
> You have to use an top architecture. From there you can integrate with
> "component" more sub architecture.  Normaly only one architecture at
> on vhdl file.
> 
> 
> René
> 
> 
> Am 25.08.2015 um 16:28 schrieb Sander Vanheule:
> 
> > Dear all,
> > 
> > When trying to instantiate an architecture of an entity for which
> > multiple architectures are defined, linking will fail when
> > elaborating an architecture which does not refer to the full
> > collection of entities instantiated by all the architectures.
> > Searching for the suffixes (__LASTARCH__INSTSIZE etc.) in the error
> > message has not returned any useful result, so I'm assuming this
> > hasn't been reported yet.
> > 
> > For example, if you have two architectures ('first' and 'second')
> > where the first one refers to an entity ('internal') which the
> > second one does not refer to, linking to this entity will fail if
> > you try to elaborate the second architecture. However, linking to
> > this entity is not needed in the first place, so I'm guessing that's
> > why it doesn't exist and linking thus fails. In this case, the full
> > set of instantiated entities is {'internal', 'internal_bis'}.
> > 'test(second)' only refers to 'internal_bis' and therefore fails to
> > link 'internal' and vice versa for 'test(first)'.
> > 
> > Note also that if both provided architectures were to be
> > instantiated, no linking error occurs. This is particularly annoying
> > when I'm trying to include a stand-alone behavioural architecture in
> > a testbench, but not the RTL architecture (containing several
> > instantiated entities, intended for synthesis). A testbench that
> > includes both the behavioural and RTL architecture will compile
> > without error.
> > 
> > Steps to reproduce: 
> >         $ ghdl -a test.vhd && ghdl -e test
> >         test.o: In function 
> > `work__test__ARCH__first__test_instantiation__ELAB':
> >         test.vhd:(.text+0xa4): undefined reference to 
> > `work__internal__LASTARCH__INSTSIZE'
> >         test.vhd:(.text+0xdc): undefined reference to 
> > `work__internal__LASTARCH__ELAB'
> >         test.vhd:(.text+0xe8): undefined reference to 
> > `work__internal__LASTARCH__DEFAULT_CONFIG'
> >         collect2: error: ld returned 1 exit status
> >         ghdl: compilation error
> >         
> > When the instantiated entities are provided in a separate file, the
> > error message is a bit larger: 
> >         test.o: In function 
> > `work__test__ARCH__first__test_instantiation__ELAB':
> >         test.vhd:(.text+0x2a): undefined reference to 
> > `work__internal__LASTARCH__INSTSIZE'
> >         test.vhd:(.text+0x56): undefined reference to 
> > `work__internal__PKG_ELAB'
> >         test.vhd:(.text+0x62): undefined reference to 
> > `work__internal__LASTARCH__ELAB'
> >         test.vhd:(.text+0x6e): undefined reference to 
> > `work__internal__LASTARCH__DEFAULT_CONFIG'
> >         test.o:(.rodata+0xa0): undefined reference to `work__internal__RTI'
> >         collect2: error: ld returned 1 exit status
> >         ghdl: compilation error
> > 
> > GHDL version (from
> > http://launchpad.net/~pgavin/+archive/ubuntu/ghdl , on Ubuntu
> > 14.04.3): 
> >         $ ghdl -v
> >         GHDL 0.31 (20140108) [Dunoon edition]
> >          Compiled with GNAT Version: 4.8
> >          GCC back-end code generator
> >         [...]
> >         $ ld --version
> >         GNU ld (GNU Binutils for Ubuntu) 2.24
> >         [...]
> > 
> > Kind regards,
> > Sander Vanheule
> > 
> > 
> > 
> > _______________________________________________
> > Ghdl-discuss mailing list
> > [email protected]
> > https://mail.gna.org/listinfo/ghdl-discuss
> 
> _______________________________________________
> Ghdl-discuss mailing list
> [email protected]
> https://mail.gna.org/listinfo/ghdl-discuss


_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to