Re: [vhdl-200x] conditional compilation response

From: David Koontz <diogratia@gmail.com>
Date: Sat Aug 27 2011 - 04:27:45 PDT

On 27/08/2011, at 5:27 AM, David Smith wrote:

> John,
> Another option is that the macros you are referring to are included in the libraries as a new element and access using standard library referencing mechanisms. This does not require file inclusion (so far an unknown concept) but the definition of a new kind of declaration that can be included in the library and the additional statements in the language that use the declaration. This could still be processed by a preprocessor that knows the library or by the front end of the compiler – that could be implementation dependent of where the “preprocessing” is done. I have no problems with the concepts of conditional compilation, macro definition, etc… It is just I would not like to add files as a structural item into VHDL. It doesn’t have it now and I think it is not needed.
>
> I accept the motivation of centrally defined code – that is what a library is all about J.
>

A lexical preprocessor as John proposed using tool directives wouldn't need to be aware of design libraries. Further tool directives are implementation defined implying the analyzer might not even be aware of any included files as when the preprocessor is external (prior to lexical analysis) for example.

Design libraries share this abstraction, library simple names are associated with an implementation dependent mechanism for storing analyzed design units. The mechanism that provides externally provided text to be included doesn't have to be defined, it can be implementation dependent.

No meaning is assigned to the various directives outside the scope of tool directives:
15.11 Tool directives

A tool directive directs a tool to analyze, elaborate, execute, or otherwise process a description in a specified manner. A tool directive starts with a grave accent character and extends up to the end of the line.

tool_directive ::= ` identifier { graphic_character }

The identifier determines the form of processing to be performed by the tool. Apart from the standard tool directives (see Clause 24), the requirements, if any, on the location of a tool directive and on the graphic characters are implementation defined, as is the effect of the tool directive.

A preprocessor would fall under the "otherwise process a description in a specified manner" category.

A directive for file (^H^H^H^H external text) inclusion could have no more meaning than as some portion of an array of graphic characters delimited by an end of line outside the scope of a tool directive. Analysis also doesn't cover tool directives, being restricted to context clauses, primary and secondary units in Clause 13.1, none of which include tool directive in any right hand side production or syntax description.

(analysis: The syntactic and semantic analysis of source code in a VHDL design file and the insertion of intermediate form representations of design units into a design library. (13.1, 13.2, 13.5))
The meaning of a tool directive is whatever you define it to be. We might expect that any conditional text tool directives would be included in Clause 24 as standard (if adopted). There'd be no reason they couldn't be implemented externally in any event.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Aug 27 04:28:21 2011

This archive was generated by hypermail 2.1.8 : Sat Aug 27 2011 - 04:28:57 PDT