VHDL Issue Number: 2022 Language_Version: VHDL-2002 Classification: Language Modeling Enhancement or Deficiency Summary: Elements of constant composite to be locally static Relevant_LRM_Sections: Section on what is locally static Related_Issues: Key_Words_and_Phrases: locally static array composite Authors_Name: ben cohen Authors_Phone_Number: 310 7214830 Authors_Fax_Number: Authors_Email_Address: vhdlcohen@aol.com Authors_Affiliation: Training / author Authors_Address1: Authors_Address2: Authors_Address3: Current Status: Forwarded Superseded By: ------------------------ Date Submitted: 28 February 2003 Date Analyzed: 14 December 2004 Author of Analysis: Chuck Swart Revision Number: 2 Date Last Revised: 05 January 2005 Description of Problem ---------------------- Currently if a constant is a composite, the elements of that constant are not locally static. Thus, one cannot write: case .. when constant_array(0) => ... That does not make sense, since the composite is a constant. ModelSim used to treat the elements as constant, until I pointed this LRM non-compliance as a result of someone pointing this out to me from an example in my book. > > > architecture CaseConstant_a of CaseConstant is > > > type AddrState_Typ is array(0 to 3) of Std_Logic_Vector(5 downto); > > > constant Gray : AddrState_Typ := ("000000", > > > "000001", > > > "000011", > > > "000010"); > > > > > > constant Gray0 : Std_Logic_Vector(5 downto 0) := "000000"; > > > signal Wa_s : Std_Logic_Vector(5 downto 0) := "000000"; > > > > > > begin > > > Test_Lbl: process > > > begin > > > case wa_s is > > > when Gray(0) => Wa_s <= Gray(1); > > > when Gray0 => Wa_s <= Gray(1); > > Indexing an array is not locally static (even if everything is locally > computable). So Gray(0) cannot be a choice in the case statement. > However, a constant is locally static (even if it's elaborated value is > not) so Gray0 is a valid choice. I'd say quickhdl is faulty here. Proposed Resolution ------------------- Make static the elements of a composite declared as a constant. VASG-ISAC Analysis & Rationale ------------------------------ This issue is resolved in VHDL 200X Fast Track proposal 22, titled "Allow aggregates, array operands, and array operators to be locally static." This proposal states, in part: "A locally static primary is ... A subelement or a slice of a locally static primary, provided that any index expressions are locally static expressions and any discrete ranges used in slice names are locally static discrete ranges. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- No change. VASG-ISAC Recommendation for Future Revisions ---------------------------------------- Implement extensions developed in FT 22. -------------END OF IR----------------