Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

backups: always in season, never out of style.


devel / comp.lang.vhdl / Re: How entity name is resolved in architecture body

SubjectAuthor
* How entity name is resolved in architecture bodyTomas Whitlock
`* How entity name is resolved in architecture bodyVraj Patel
 `* How entity name is resolved in architecture bodyTomas Whitlock
  `* How entity name is resolved in architecture bodyVraj Patel
   `* How entity name is resolved in architecture bodyTomas Whitlock
    `* How entity name is resolved in architecture bodyCharles Bailey
     `* How entity name is resolved in architecture bodyTomas Whitlock
      `* How entity name is resolved in architecture bodyTomas Whitlock
       `* How entity name is resolved in architecture bodyTomas Whitlock
        `- How entity name is resolved in architecture bodyTomas Whitlock

1
How entity name is resolved in architecture body

<f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=149&group=comp.lang.vhdl#149

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:620a:2947:b0:6a3:a317:fa08 with SMTP id n7-20020a05620a294700b006a3a317fa08mr26017016qkp.746.1653935193216;
Mon, 30 May 2022 11:26:33 -0700 (PDT)
X-Received: by 2002:a81:49c7:0:b0:30c:3050:345a with SMTP id
w190-20020a8149c7000000b0030c3050345amr9872761ywa.29.1653935193019; Mon, 30
May 2022 11:26:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Mon, 30 May 2022 11:26:32 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
Subject: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Mon, 30 May 2022 18:26:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2608
 by: Tomas Whitlock - Mon, 30 May 2022 18:26 UTC

Hi all,

I'm working on a tool that is supposed to read VHDL and create an abstract representation of a design unit.

I have run into a problem where I'm trying to understand how this common form of an entity declaration + architecture body is accepted by VHDL compilers such as Vivado Simulator / Synthesis, ModelSim / Questa and no doubt others:

entity e is
...
end entity;

architecture a of e is
...
begin
...
end architecture;

After repeatedly reading the VHDL LRMs of '93, 2002, 2008 etc., it seems to me that, if the rules are interpreted literally, the entity 'e' should not be visible to at the point where the architecture body declaration references it.

Yet all of the VHDL compilers that I've ever encountered will happily accept the above VHDL as valid.

The LRM mentions a "library declarative region", in which primary design units of that library are visible, but it doesn't say where it applies. The LRM doesn't seem to leave much room for the library declarative region to be nested within some other declarative region, so I don't know what to make of it.

So my question is:

Do most VHDL compilers bend the rules and add some additional rules of their own (for example, adding "use work.all;" to the predefined language environment), or am I missing something in the LRM that makes the entities of the work library visible to an architecture body declaration (when being compiled into the same work library)?

Thanks in advance for any insights.

Re: How entity name is resolved in architecture body

<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=150&group=comp.lang.vhdl#150

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:6214:1949:b0:462:4a9d:3280 with SMTP id q9-20020a056214194900b004624a9d3280mr30343357qvk.130.1653948103558;
Mon, 30 May 2022 15:01:43 -0700 (PDT)
X-Received: by 2002:a81:38c:0:b0:2f4:d0e2:dc2a with SMTP id
134-20020a81038c000000b002f4d0e2dc2amr59961150ywd.102.1653948103306; Mon, 30
May 2022 15:01:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Mon, 30 May 2022 15:01:43 -0700 (PDT)
In-Reply-To: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8800:7d00:c600:a86b:9806:3bec:157b;
posting-account=9dfnKAkAAAASO1bBMwoz4pZw_aDCPDw1
NNTP-Posting-Host: 2600:8800:7d00:c600:a86b:9806:3bec:157b
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: patelvrajn@gmail.com (Vraj Patel)
Injection-Date: Mon, 30 May 2022 22:01:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Vraj Patel - Mon, 30 May 2022 22:01 UTC

Wouldn't that code be valid under the specification when you look at default binding indication?

For the VHDL 2000 standard which I just looked thru that would be Section 5..2.2.

The VHDL reference guide webpages (https://www.ics.uci.edu/~jmoorkan/vhdlref/confspec.html - I believe this site is for the 93 standard) sums it up nicely as follows:
"In the absence of an explicit configuration for any part of a model, default binding will occur. For each unbound instance of every component, an entity will be selected whose name, port names and port types etc. match those in the corresponding component declaration. Where an entity has more than one architecture, the last analysed architecture will be used."

This answer is not to imply that the current tools don't bend rules when it comes to following the written standard. I cannot answer with confidence if they do or don't.

Re: How entity name is resolved in architecture body

<99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=151&group=comp.lang.vhdl#151

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:6214:3003:b0:462:1c15:772c with SMTP id ke3-20020a056214300300b004621c15772cmr40147562qvb.71.1653951619909;
Mon, 30 May 2022 16:00:19 -0700 (PDT)
X-Received: by 2002:a5b:312:0:b0:633:75de:5ab4 with SMTP id
j18-20020a5b0312000000b0063375de5ab4mr59407478ybp.124.1653951619636; Mon, 30
May 2022 16:00:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Mon, 30 May 2022 16:00:19 -0700 (PDT)
In-Reply-To: <1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com> <1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Mon, 30 May 2022 23:00:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3357
 by: Tomas Whitlock - Mon, 30 May 2022 23:00 UTC

On Monday, 30 May 2022 at 23:01:56 UTC+1, patel...@gmail.com wrote:
> Wouldn't that code be valid under the specification when you look at default binding indication?
>
> For the VHDL 2000 standard which I just looked thru that would be Section 5.2.2.
>
> The VHDL reference guide webpages (https://www.ics.uci.edu/~jmoorkan/vhdlref/confspec.html - I believe this site is for the 93 standard) sums it up nicely as follows:
> "In the absence of an explicit configuration for any part of a model, default binding will occur. For each unbound instance of every component, an entity will be selected whose name, port names and port types etc. match those in the corresponding component declaration. Where an entity has more than one architecture, the last analysed architecture will be used."
>
> This answer is not to imply that the current tools don't bend rules when it comes to following the written standard. I cannot answer with confidence if they do or don't.

Hi Patel,

I appreciate you taking the time to reply, but I don't think that section of the standard is relevant to this question, and maybe I haven't stated by question clearly enough.

I'm not trying to understand out how VHDL chooses an architecture for an instantation, but rather: how is entity 'e' even visible when the compiler encounters 'architecture a of e'. There are no use clauses in the example I've used and according to the LRM, the only predefined context is "library std, work; use std.standard.all;".

So the Root Declarative Region shouldn't contain 'e', and therefore according to the visibilty, scope etc. rules, 'e' shouldn't even be visible and the compiler should error and say so (by my interpretation of the LRM, at least).

It occurs to me that maybe for an architecture declaration, all existing VHDL compilers have a special case *for architecture bodies only* in which the entity's name is looked up in the Library Declarative Region as opposed to the Root Declarative Region, and hence 'e' is visible.

Re: How entity name is resolved in architecture body

<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=152&group=comp.lang.vhdl#152

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:6214:d0e:b0:462:6d8a:fab4 with SMTP id 14-20020a0562140d0e00b004626d8afab4mr20128167qvh.85.1653960188054;
Mon, 30 May 2022 18:23:08 -0700 (PDT)
X-Received: by 2002:a25:f510:0:b0:65b:b324:23f with SMTP id
a16-20020a25f510000000b0065bb324023fmr16516392ybe.220.1653960187824; Mon, 30
May 2022 18:23:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Mon, 30 May 2022 18:23:07 -0700 (PDT)
In-Reply-To: <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8800:7d00:c600:a86b:9806:3bec:157b;
posting-account=9dfnKAkAAAASO1bBMwoz4pZw_aDCPDw1
NNTP-Posting-Host: 2600:8800:7d00:c600:a86b:9806:3bec:157b
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: patelvrajn@gmail.com (Vraj Patel)
Injection-Date: Tue, 31 May 2022 01:23:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1916
 by: Vraj Patel - Tue, 31 May 2022 01:23 UTC

Hi,

I have a better grasp of the question you are asking however, do you mind explaining how you get to this assertion you state as true using quotes of the standard to support the assertion:

"So the Root Declarative Region shouldn't contain 'e', and therefore according to the visibilty, scope etc. rules, 'e' shouldn't even be visible and the compiler should error and say so (by my interpretation of the LRM, at least)."

It would make the question more clear to me and perhaps to others. Specifically, I am interested as to how you think there would be no visibility of ''e" to the compiler.

Re: How entity name is resolved in architecture body

<fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=153&group=comp.lang.vhdl#153

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:622a:ca:b0:2f9:3f2c:c463 with SMTP id p10-20020a05622a00ca00b002f93f2cc463mr30726447qtw.386.1653986548379;
Tue, 31 May 2022 01:42:28 -0700 (PDT)
X-Received: by 2002:a05:6902:1106:b0:64f:4e18:2c23 with SMTP id
o6-20020a056902110600b0064f4e182c23mr59140219ybu.168.1653986548243; Tue, 31
May 2022 01:42:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Tue, 31 May 2022 01:42:27 -0700 (PDT)
In-Reply-To: <3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Tue, 31 May 2022 08:42:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Tomas Whitlock - Tue, 31 May 2022 08:42 UTC

On Tuesday, 31 May 2022 at 02:23:09 UTC+1, patel...@gmail.com wrote:
> Hi,
>
> I have a better grasp of the question you are asking however, do you mind explaining how you get to this assertion you state as true using quotes of the standard to support the assertion:
> "So the Root Declarative Region shouldn't contain 'e', and therefore according to the visibilty, scope etc. rules, 'e' shouldn't even be visible and the compiler should error and say so (by my interpretation of the LRM, at least)."
> It would make the question more clear to me and perhaps to others. Specifically, I am interested as to how you think there would be no visibility of ''e" to the compiler.

Hi Patel,

Ok, here goes with my interpretation of the rules that matter for this case (from VHDL-2002 LRM):

10.1 "In addition to the above declarative regions, there is a root declarative region, not associated with a portion
of the text of the description, but encompassing any given primary unit. At the beginning of the analysis of a
given primary unit, there are no declarations whose scopes (see 10.2) are within the root declarative region."

So this is saying that when starting to parse a VHDL file, the root declarative region has no declarations. Seems pretty obvious. But this is supposed to apply to primary units - but how does the compiler know if it's looking at a primary or secondary unit until it has successfully parsed part of it? Surely this applies to all design units, primary & secondary.

It says in 11.2:

"Every design unit except package STANDARD is assumed to contain the following implicit context items as
part of its context clause:

library STD, WORK ; use STD.STANDARD.all ;"

So this is how the predefined stuff gets into the root declarative region and is visible. Before the compiler gets to parsing any VHDL code, even context clauses, the root declarative region has only the following visible in it: std (library), work (library) and everything in std.standard.* . Notably, this does not include any entities of the work library such as entity 'e' from my example.

I believe that if a VHDL file has multiple design units, whether primary or secondary, parsing of each design unit begins with a fresh new root declarative region with nothing in it except the predefined stuff. So after 'end entity;' of my example, the compiler begins a fresh new root declarative region (not containing 'e').

I haven't found any special case treatment of the entity_name of an architecture body in the LRM, so I conclude that in a literal interpretation of the rules, you should actually need

architecture a of work.e is -- OK: 'e' visible by selection
....
begin
....
end architecture;

OR

use work.e;

architecture a of e -- OK: 'e' made visible by use clause
....
begin
....
end architecture;

I guess that in most VHDL compilers, there is a special case where the entity_name lookup for an architecture body is not done within the root declarative region but instead goes to the library declarative region (which certainly does have 'e' visible). The library declarative region is mentioned in a couple of places in the LRM and nowhere else, so it's not exactly obvious what its purpose is or why the LRM even mentions it.

Re: How entity name is resolved in architecture body

<t75ti7$8vf$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=154&group=comp.lang.vhdl#154

  copy link   Newsgroups: comp.lang.vhdl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: logicguy76@gmail.com (Charles Bailey)
Newsgroups: comp.lang.vhdl
Subject: Re: How entity name is resolved in architecture body
Date: Tue, 31 May 2022 15:24:38 -0500
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <t75ti7$8vf$1@dont-email.me>
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com>
<99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com>
<fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 May 2022 20:24:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="bb3e477f31d1e181cd4dfe6aed7e6229";
logging-data="9199"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/w/0cIBjvVX6F+Lmh754n/e8RiLS2F9p0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101
Thunderbird/38.7.2
Cancel-Lock: sha1:75hHr2bjt2YykXfg4/0rvlq9mvM=
In-Reply-To: <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
 by: Charles Bailey - Tue, 31 May 2022 20:24 UTC

On 2022-05-31 03:42, Tomas Whitlock wrote:
> On Tuesday, 31 May 2022 at 02:23:09 UTC+1, patel...@gmail.com wrote:
>> Hi,
>>
>> I have a better grasp of the question you are asking however, do you mind explaining how you get to this assertion you state as true using quotes of the standard to support the assertion:
>> "So the Root Declarative Region shouldn't contain 'e', and therefore according to the visibilty, scope etc. rules, 'e' shouldn't even be visible and the compiler should error and say so (by my interpretation of the LRM, at least)."
>> It would make the question more clear to me and perhaps to others. Specifically, I am interested as to how you think there would be no visibility of ''e" to the compiler.
>
> Hi Patel,
>
> Ok, here goes with my interpretation of the rules that matter for this case (from VHDL-2002 LRM):
>
> 10.1 "In addition to the above declarative regions, there is a root declarative region, not associated with a portion
> of the text of the description, but encompassing any given primary unit. At the beginning of the analysis of a
> given primary unit, there are no declarations whose scopes (see 10.2) are within the root declarative region."
>
> So this is saying that when starting to parse a VHDL file, the root declarative region has no declarations. Seems pretty obvious. But this is supposed to apply to primary units - but how does the compiler know if it's looking at a primary or secondary unit until it has successfully parsed part of it? Surely this applies to all design units, primary & secondary.
>
> It says in 11.2:
>
> "Every design unit except package STANDARD is assumed to contain the following implicit context items as
> part of its context clause:
>
> library STD, WORK ; use STD.STANDARD.all ;"
>
> So this is how the predefined stuff gets into the root declarative region and is visible. Before the compiler gets to parsing any VHDL code, even context clauses, the root declarative region has only the following visible in it: std (library), work (library) and everything in std.standard.* . Notably, this does not include any entities of the work library such as entity 'e' from my example.
>
> I believe that if a VHDL file has multiple design units, whether primary or secondary, parsing of each design unit begins with a fresh new root declarative region with nothing in it except the predefined stuff. So after 'end entity;' of my example, the compiler begins a fresh new root declarative region (not containing 'e').
>
> I haven't found any special case treatment of the entity_name of an architecture body in the LRM, so I conclude that in a literal interpretation of the rules, you should actually need
>
> architecture a of work.e is -- OK: 'e' visible by selection
> ...
> begin
> ...
> end architecture;
>
> OR
>
> use work.e;
>
> architecture a of e -- OK: 'e' made visible by use clause
> ...
> begin
> ...
> end architecture;
>
> I guess that in most VHDL compilers, there is a special case where the entity_name lookup for an architecture body is not done within the root declarative region but instead goes to the library declarative region (which certainly does have 'e' visible). The library declarative region is mentioned in a couple of places in the LRM and nowhere else, so it's not exactly obvious what its purpose is or why the LRM even mentions it.
>
The WORK library is always visible without it needing to be declared.
Entity 'e' was compiled into library WORK so it is visible when the
architecture is compiled. I've never seen the USE statement used for
anything other than pulling in packages. 'e' is an entity, not a
package. I don't think the tools are bending the rules in this case.

Charles Bailey

Re: How entity name is resolved in architecture body

<3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=155&group=comp.lang.vhdl#155

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:ac8:6ed0:0:b0:2f9:4564:97b5 with SMTP id f16-20020ac86ed0000000b002f9456497b5mr31880495qtv.669.1654074508160;
Wed, 01 Jun 2022 02:08:28 -0700 (PDT)
X-Received: by 2002:a81:5543:0:b0:30c:1e9f:c027 with SMTP id
j64-20020a815543000000b0030c1e9fc027mr22131864ywb.355.1654074508018; Wed, 01
Jun 2022 02:08:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Wed, 1 Jun 2022 02:08:27 -0700 (PDT)
In-Reply-To: <t75ti7$8vf$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com> <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
<t75ti7$8vf$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Wed, 01 Jun 2022 09:08:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Tomas Whitlock - Wed, 1 Jun 2022 09:08 UTC

On Tuesday, 31 May 2022 at 21:24:43 UTC+1, Charles Bailey wrote:
> On 2022-05-31 03:42, Tomas Whitlock wrote:
> > On Tuesday, 31 May 2022 at 02:23:09 UTC+1, patel...@gmail.com wrote:
*snip* for brevity
> > I guess that in most VHDL compilers, there is a special case where the entity_name lookup for an architecture body is not done within the root declarative region but instead goes to the library declarative region (which certainly does have 'e' visible). The library declarative region is mentioned in a couple of places in the LRM and nowhere else, so it's not exactly obvious what its purpose is or why the LRM even mentions it.
> >
> The WORK library is always visible without it needing to be declared.
> Entity 'e' was compiled into library WORK so it is visible when the
> architecture is compiled. I've never seen the USE statement used for
> anything other than pulling in packages. 'e' is an entity, not a
> package. I don't think the tools are bending the rules in this case.
>
> Charles Bailey

Hi Charles,

Respectfully, I don't agree. 'e' is only visible if the LRM's scope and visibility rules say it is. By my reading of the LRM, what is visible at the beginning of compilation of a design unit consists of only: work, std & std.standard.all. That excludes 'e'.

The VHDL grammar says this:

architecture_body :: architecture identifier of entity_name is
architecture_declarative_part
begin
architecture_statement_part
end [ architecture ] [ architecture_simple_name ] ;

The fact that the entity for the architecture is identified by 'entity_name' (as opposed to a 'simple_name') means that it must be subject to the scope & visibility rules like any other kind of name. I don't see anything in the LRM to indicate that there is a special case for this entity_name, though I might have missed something. ModelSim accepts 'work.e' as well as 'e', indicating that it does indeed treat entity_name as a 'name', and allows selected names etc.

In the absense of a use clause that makes 'e' visible, why would it be visible just prior to the architecture body declaration that I used as an example?

Can you explain why you think 'e' is visible according to the scope and visibility rules? Or do you know of a rule in the LRM that means the usual scope and visibility rules don't apply in this case, and instead the compiler just looks in the work library?

I'm not trying to be argumentative, merely trying to confirm that my understanding of the way the entity name is resolved is correct. I would agree as a practical matter that the way all known VHDL compilers work in treating 'e' as being visible is for the best.

Re: How entity name is resolved in architecture body

<92df06ec-2195-4cc9-9090-d0e7a97d7e5an@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=156&group=comp.lang.vhdl#156

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:ac8:4e52:0:b0:304:86c8:7b26 with SMTP id e18-20020ac84e52000000b0030486c87b26mr10927546qtw.684.1654075370753;
Wed, 01 Jun 2022 02:22:50 -0700 (PDT)
X-Received: by 2002:a81:38c:0:b0:2f4:d0e2:dc2a with SMTP id
134-20020a81038c000000b002f4d0e2dc2amr68299200ywd.102.1654075370604; Wed, 01
Jun 2022 02:22:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Wed, 1 Jun 2022 02:22:50 -0700 (PDT)
In-Reply-To: <3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com> <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
<t75ti7$8vf$1@dont-email.me> <3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <92df06ec-2195-4cc9-9090-d0e7a97d7e5an@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Wed, 01 Jun 2022 09:22:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2277
 by: Tomas Whitlock - Wed, 1 Jun 2022 09:22 UTC

Also, the following VHDL gives an error in ModelSim:

entity e is end entity;

package p is
alias e_alias is e;
end package;

** Error: entity_visibility.vhd(4): (vcom-1136) Unknown identifier "e".

On the other hand, ModelSim accepts either of the following without error:

entity e is end entity;

package p is
alias e_alias is work.e;
end package;

OR

entity e is end entity;

use work.e;

package p is
alias e_alias is e;
end package;

Which shows that according to the usual visibility and scope rules, 'e' is not visible except by selection or by a use clause. So architecture bodies appear to have special case handling for 'entity_name'.

Re: How entity name is resolved in architecture body

<9680ddce-75d2-4847-8e0f-dc384c1c48bfn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=157&group=comp.lang.vhdl#157

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:620a:956:b0:6a3:735f:f7ad with SMTP id w22-20020a05620a095600b006a3735ff7admr898895qkw.717.1654113295995;
Wed, 01 Jun 2022 12:54:55 -0700 (PDT)
X-Received: by 2002:a25:658b:0:b0:65d:4d94:17b0 with SMTP id
z133-20020a25658b000000b0065d4d9417b0mr1579042ybb.514.1654113295810; Wed, 01
Jun 2022 12:54:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Wed, 1 Jun 2022 12:54:55 -0700 (PDT)
In-Reply-To: <92df06ec-2195-4cc9-9090-d0e7a97d7e5an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.101.99.84; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 77.101.99.84
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com> <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
<t75ti7$8vf$1@dont-email.me> <3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>
<92df06ec-2195-4cc9-9090-d0e7a97d7e5an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9680ddce-75d2-4847-8e0f-dc384c1c48bfn@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Wed, 01 Jun 2022 19:54:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2223
 by: Tomas Whitlock - Wed, 1 Jun 2022 19:54 UTC

Update: I've now taken a look (I think) at what GHDL does for the 'entity_name' of 'architecture_body'. If understand the code correctly, it does this:

If the 'entity_name' string is syntactically equivalent to an 'identifier' (i.e. not a selected name or anything like that), then attempt to look it up in the 'work' library. The usual scope and visibility rules are not applied in this case.

Otherwise, attempt to look up the 'entity_name' string in the usual way, i.e. look it up in the current declarative region, which for an architecture_body must be a root declarative region. The usual scope and visibility rules are applied in this case.

This seems like a reasonable way to go.

Re: How entity name is resolved in architecture body

<55c0c4fd-805c-4088-8bbd-c61fd76b52c3n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=159&group=comp.lang.vhdl#159

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:620a:22c1:b0:6a3:9974:fd12 with SMTP id o1-20020a05620a22c100b006a39974fd12mr4304277qki.93.1654198553795;
Thu, 02 Jun 2022 12:35:53 -0700 (PDT)
X-Received: by 2002:a81:745:0:b0:30f:b172:9efb with SMTP id
66-20020a810745000000b0030fb1729efbmr7579658ywh.495.1654198553653; Thu, 02
Jun 2022 12:35:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Thu, 2 Jun 2022 12:35:53 -0700 (PDT)
In-Reply-To: <9680ddce-75d2-4847-8e0f-dc384c1c48bfn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.73.105.74; posting-account=L5aALwoAAABayKmTMw3DmKhnz7ueXhOm
NNTP-Posting-Host: 194.73.105.74
References: <f984b0ca-8ffb-47f3-9ff1-42b65611e113n@googlegroups.com>
<1eac2e9b-92f0-4b04-b17b-631dd953fbaan@googlegroups.com> <99099603-7028-4b9d-b8ad-f15ff46774e5n@googlegroups.com>
<3f0279e7-5f80-4db7-8a8e-39a1c04ec49en@googlegroups.com> <fe8b9495-a210-40fd-b0d6-426123410bd4n@googlegroups.com>
<t75ti7$8vf$1@dont-email.me> <3b65a45a-8134-4f32-ab3a-c31db9076b43n@googlegroups.com>
<92df06ec-2195-4cc9-9090-d0e7a97d7e5an@googlegroups.com> <9680ddce-75d2-4847-8e0f-dc384c1c48bfn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <55c0c4fd-805c-4088-8bbd-c61fd76b52c3n@googlegroups.com>
Subject: Re: How entity name is resolved in architecture body
From: tomas.whitlock@gmail.com (Tomas Whitlock)
Injection-Date: Thu, 02 Jun 2022 19:35:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2088
 by: Tomas Whitlock - Thu, 2 Jun 2022 19:35 UTC

@Charles Bailey - Having thought about this some more, I think you are correct to say that implementations are not bending the rules. They are implementing 'entity_name' resolution as per the rules, but the rules for that particular case are weird and the LRM doesn't explain the subtleties well.

I also think there's pretty much no way to implement this in a VHDL compiler without treating it as a special case, like the solution used in GHDL.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor