Hello,

you provided 2 GHDL commands:
ghdl -a adder.vhdl
ghdl -e adder_tb

but the example in the GHDL documentation lists 4 commands:
ghdl -a adder.vhdl
ghdl -a adder_tb.vhdl
ghdl -e adder_tb
ghdl -r adder_tb

At first, it analyzes both source files;
at second it elaborates the top-level (adder_tb - found in the second file)
and
at third it runs the top-level design (simulation).

You can combine elaboration (-e) and run (-r) in one step called elab-run,
but
you can't skip analyzing adder_tb.vhdl, unless you changed the example and
copied all source snippets into one file called adder.vhdl


Btw. the solution to change:

--  Component instantiation.adder_0: adder  port map (    i0 => i0,
i1 => i1,    ci => ci,    s  => s,    co => co  );

to

--  Direct entity instantiation.adder_0: entity work.adder  port map (
   i0 => i0,    i1 => i1,    ci => ci,    s  => s,    co => co  );

is correct. But you should also remove the component and binding from the
architectures deklarative region.


Kind regards
    Patrick



2017-05-13 14:12 GMT+02:00 Тихомиров Валентин <intel...@yandex.ru>:

> > ports
> > provide a
> Minimal, Complete, and Verifiable example
> <https://stackoverflow.com/help/mcve> instead of snippets then complain
> when you can't get a quality answer without sufficient information
>
> The full code is the same. I took it from your "getting started" part of
> User Guide, http://ghdl.readthedocs.io/en/latest/Starting_with_GHDL.
> html#a-full-adder
> All I did, I prepended the adder reference with "entity" keyword. I did
> not touch any port mappings.
>
>
> 13.05.2017, 14:58, "David Koontz" <diogra...@gmail.com>:
>
>
> On May 13, 2017, at 11:48 PM, Тихомиров Валентин <intel...@yandex.ru>
> wrote:
>
> The command is
>
> ghdl -a adder.vhdl && ghdl --elab-run adder_tb
>
> and it analyzes the correct file which I prove by injecting a terrible
> syntactic error and it fails to parse.
>
>
> In addition to a selected or directly visible named entity with the same
> simple name as the entity that has been analyzed into either the same
> working library or a reference library there's something called a default
> binding indication, which requires that the port declarations match formals
> in the port map and the port map obeys semantic rules for association lists.
>
> If this were Stackoverflow someone would pop up and suggest you provide a
> Minimal, Complete, and Verifiable example
> <https://stackoverflow.com/help/mcve> instead of snippets then complain
> when you can't get a quality answer without sufficient information.
>
>
>
> 13.05.2017, 14:38, "Paebbels" <paebb...@gmail.com>:
>
> Hello,
>
> have you analyzed adder before that component?
> Please provide the executed GHDL commands.
>
> Am 13.05.2017 1:34 nachm. schrieb "Тихомиров Валентин" <intel...@yandex.ru
> >:
>
> >        adder_0: entity work.adder port map (i0 => i0, i1 => i1, ci =>
> ci,
>                                  s => s, co => co);
>
> > adder is not directly visible.
>
> Thanks but "work" does not improve anything. I am still getting the same
> "no declaration for adder" error.
>
> _______________________________________________
> Ghdl-discuss mailing list
> Ghdl-discuss@gna.org
> https://mail.gna.org/listinfo/ghdl-discuss
>
>
> ,
>
> _______________________________________________
> Ghdl-discuss mailing list
> Ghdl-discuss@gna.org
> https://mail.gna.org/listinfo/ghdl-discuss
>
> _______________________________________________
> Ghdl-discuss mailing list
> Ghdl-discuss@gna.org
> https://mail.gna.org/listinfo/ghdl-discuss
>
>
> ,
>
> _______________________________________________
> Ghdl-discuss mailing list
> Ghdl-discuss@gna.org
> https://mail.gna.org/listinfo/ghdl-discuss
>
>
> _______________________________________________
> Ghdl-discuss mailing list
> Ghdl-discuss@gna.org
> https://mail.gna.org/listinfo/ghdl-discuss
>
>
_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to