> On 27/11/2015, at 4:43 pm, Tristan Gingold <tging...@free.fr> wrote: > > I would simply add that this is one of vhdl pitfall. VHDL behaviour > is not very intuitive. > > This could be detected at elaboration time by using std_ulogic instead of > std_logic. > > (You'd better to always use std_ulogic and std_ulogic_vector. Unfortunately, > it was not possible to mix them without adding conversions and most of IP > blocks are using std_logic).
I'd claim the LRM could be re-written to make it clearer. Not likely to happen, verifying the standard would be a major undertaking at it's present thud factor (http://wordspy.com/index.php?word=thud-factor). See IEEE-Std 1800-2012 11.5.3 Longest static prefix: Informally, the longest static prefix of a select is the longest part of the select for which an analysis tool has known values following elaboration. This concept is used when describing implicit sensitivity lists (see 9.2.2.2) and when describing error conditions for drivers of logic ports (see 6.5). The remainder of this subclause defines what constitutes the “longest static prefix” of a select. A field select is defined as a hierarchical name where the right-hand side of the last “.” hierarchy separator identifies a field of a variable whose type is a struct or union declaration. The field select prefix is defined to be the left-hand side of the final “.” hierarchy separator in a field select. An indexing select is a single indexing operation. The indexing select prefix is either an identifier or, in the case of a multidimensional select, another indexing select. Array selects, bit-selects, part-selects, and indexed part-selects are examples of indexing selects. The definition of a static prefix is recursive and is defined as follows: — An identifier is a static prefix. — A hierarchical reference to an object is a static prefix. — A package reference to net or variable is a static prefix. — A field select is a static prefix if the field select prefix is a static prefix. — An indexing select is a static prefix if the indexing select prefix is a static prefix and the select expression is a constant expression. The definition of the longest static prefix is defined as follows: — An identifier that is not the field select prefix or indexing select prefix of an expression that is a static prefix. — A field select that is not the field select prefix or indexing select prefix of an expression that is a static prefix. — An indexing select that is not the field select prefix or indexing select prefix of an expression that is a static prefix. https://standards.ieee.org/getieee/1800/download/1800-2012.pdf (It's not just a VHDL pitfall). A search of "longest static prefix"[vhdl] on Stackoverflow and StackExchange returned no hits, nor is the string "longest static prefix" common in VHDL books. It's just not taught or presented so you can learn about it easily. (And ya, there are parts of the System Verilog LRM that are hard to read. On the other hand what do you want to bet the list of things described more or less explicitly as locally or globally static won't grow in the VHDL LRM?) _______________________________________________ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss