TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
CompositesProtectedTypes
(revision 12) (raw view)
Edit
Attach
---+ Composites of Protected Types %TOC% ---++ Proposal Information * State of this Proposal: Raw / Stream of Conscious * Current Owner: JimLewis, ... * Contributors: JimLewis, ... * Date Proposed: 2012-Jan-05 * Date Last Updated: 2013-October-27 * Priority: * Complexity: * Focus: Testbench * Related Issues: None * Competing Issues: None ---++ Language Change Specification Link [[LCS2016_014]] ---++ Requirement Summary Allow composites to have elements that are protected types. If a composite contains a protected type, a composite of a protected type, or an access type to a protected type or a composite of a protected type [will need a proposal for this if we want it], then all elements of the composite shall be either a protected type, a composites of a protected type, or an access type to a protected type or to composites of a protected type. ---++ Applications Arrays of Scoreboards, Arrays of Coverage Models, Arrays of Interfaces, .... ---++ Related and/or Competing Issues ---+++ [[GenericTypes][Adding Generics to protected types]] Impact where the array type declaration is needed and raises the importance of being able to use "array" as a constraint in the declaration. ---+++ Bugzilla 291 Main.RichardHead suggests allowing arrays of protected types. ---++ Basic Capability (LCS_2016_14) ---+++ Protected Types ---++++ Current Situation When using a protected type, we cannot create arrays of the the protected type. As a result, in situations where they are needed, instead we are obligated to use individually declared shared variables. <verbatim>shared variable enet1 : ScoreboardPType ; shared variable enet2 : ScoreboardPType ; shared variable enet3 : ScoreboardPType ; shared variable enet4 : ScoreboardPType ; shared variable enet5 : ScoreboardPType ; </verbatim> Within the code it is natural to dispatch a transaction to a scoreboard using an integer reference (1, 2, 3, 4, 5). <verbatim>process ... Get_Next_Stim (EnetCov, PortNum, TVal, ...) ; case PortNum is when 1 => enet1.push(TVal) ; when 2 => enet2.push(Tval) ; when 3 => enet3.push(TVal) ; when 4 => enet4.push(Tval) ; when 5 => enet5.push(TVal) ; when others => report "Unknown port" severity failure ; end case ; DoTransaction(TRec, PortNum, TVal, ...) ; </verbatim> ---++++ Use Model 1: Basic Arrays Creating the array type. Potentially done in a package: <verbatim>type ScoreboardArrayPType is array (natural range <>) of ScoreboardPType ; </verbatim> Declaring the shared variable - typically in an architecture declarative region. <verbatim>shared variable enet : ScoreboardArrayPType (1 to 5); </verbatim> Within the testbench stimulus creation code: <verbatim>process ... Get_Next_Stim (EnetCov, TVal, PortNum....) ; enet(PortNum).push(TVal) ; DoTransaction(TRec, PortNum, TVal, ...) ; </verbatim> ---+++ FileTypes Example using an array of files. Note that the array of files cannot be opened in the file declaration and instead need to be opened using file_open. <verbatim> ... type text_array is array (integer range <>) of text ; ... -- Note array of files cannot be opened in the declaration file TranscriptChannel : text_array(1 to 6) ; ... TestSetup: Process begin file_open(TranscriptChannel (1), "./Test1_general.txt", WRITE_MODE) ; file_open(TranscriptChannel (2), "./Test1_cpumodel.txt", WRITE_MODE) ; file_open(TranscriptChannel (3), "./Test1_uarttxtlm.txt", WRITE_MODE) ; . . . </verbatim> ---++ Pointers to Protected Types (LCS_2016_14A) -- To be added ---++ Pointers to File Types (LCS_2016_14A) -- To be added ---++ Advanced Capability - not in current LCS ---+++ Use Model 2: Arrays Created in Declaration Protected types are not used in an assignment. As a result, it is uncommon to need one array to be subtype related to another. As a result, it would be nice to be able to use "array" as a subtype constraint: <verbatim>shared variable enet: array (1 to 5) of ScoreboardPType ; </verbatim> For a protected type that places generics on the type (see proposal [[GenericTypes][Generics to protected types]]), the type declaration for ScoreboardArrayPType is no longer part of the type, and hence, would either need to be locally created (as in part 1), or use that array as a constraint on the type declaration. This is shown in the following example: <verbatim>shared variable enet: array (1 to 5) of ScoreboardPType (std_logic_vector, std_logic_vector, "=", to_hstring, to_hstring) ; </verbatim> ---+++ Use Model 3: PT as an Interface If we use a PT as an interface and we have multiple instances of a design, allowing arrays will allow the design to be instanced using generate. <verbatim>-- Example of PT as an interface to be developed or referenced -- </verbatim> ---++ Questions ---++ Proposal ---++ Issues Need more developed on records of protected types. ---++ General Comments I don't see any implementation issues with that. Of course, you cannot assign arrays and record if one of its subelements is a protected type. Of course such composite types are passed by reference in interfaces. And of course you cannot declare signals of such composite types. -- Main.TristanGingold - 2014-10-21 Essential/required for testbenches with advanced structures (scoreboards, ...). ---++ Supporters _Add your signature here to indicate your support for the proposal_ _-- Main.JimLewis - 2014-12-03_ -- [[Main.BrentHahoe][Brent Hayhoe]] - 2014-12-23 -- Main.MortenZilmer - 2015-01-21 -- Main.PatrickLehmann - 2016-02-18 -- Main.TorstenMeissner - 2016-05-25 -- Main.SharadSinha - 2016-12-22
Edit
|
Attach
|
P
rint version
|
H
istory
:
r16
|
r14
<
r13
<
r12
<
r11
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-02-17 - 15:34:28 -
TWikiGuest
P1076
Log In
or
Register
P1076 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Main
P1076
Ballots
LCS2016_080
P10761
P1647
P16661
P1685
P1734
P1735
P1778
P1800
P1801
Sandbox
TWiki
VIP
VerilogAMS
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback