TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
GenericTypes
(2020-02-17,
JimLewis
)
(raw view)
E
dit
A
ttach
---+ Generics on Protected Types %TOC% ---++ Proposal Editing Information * Who Updates: Main.JimLewis, <Add YourName >, ... * Date Proposed: 2012-08-17 * Date Last Updated: 2012-08-17 * Priority: * Complexity: * Focus: Testbench ---++ Requirement Summary Add generics to protected types. Allow generics to be specified on usage of the type - in a similar way to subtype constraints. ---++ Current Situation When using package generics to create a data structure, the process is instantiate a package, reference the package, and then reference a type from the package. When multiple different parameterized data structures are created from the same generic package, the type names need to be instanced with fully selected path names. ---++ Related and/or Competing Issues: Protected Type Updates ---++ Proposed Extension, Part 1: Add Generics to protected types to streamline parameterization of data structures. Declaration of protected type interface <verbatim>type ScoreBoardGenericPType is protected generic ( type ExpectedType ; type ActualType ; function check(Actual : ActualType ; Expected : ExpectedType) return boolean ) ; ... end protected ScoreBoardGenericPType ;</verbatim> Protected type instance: <verbatim>type ScoreBoardPType_slv is new ScoreBoardGenericPType generic map ( ExpectedType => std_logic_vector, ActualType => std_logic_vector, check => std_match ) ; </verbatim> Usage of the object <verbatim>shared variable UartTxScoreboard : ScoreBoardPType_slv ; </verbatim> ---++ Proposed Extension, Part 2: Allow generics to be specified during an object declaration in a similar manner to a subtype constraint. Combine protected type instance and shared variable declaration <verbatim>shared variable UartTxScoreboard : ScoreBoardGenericPType generic map ( ExpectedType => std_logic_vector, ActualType => std_logic_vector, check => std_match ) ; </verbatim> ---++ Observation Part 1 without part 2 gives us a solution that does not have any advantage over package generics. ---++ Questions Would there be restrictions on generic types that are locally instanced with respect to hierarchical references? Can I use the generic type on an interface and have the actual specify the generics without it being on the formal? ---++ General Comments Important for testbench data structures ---++ 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-19 -- Main.DanielKho - 2016-10-01
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r14
<
r13
<
r12
<
r11
<
r10
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r14 - 2020-02-17 - 15:34:32 -
JimLewis
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-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback