TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
PathnameSharedVarSubprograms
(revision 1) (raw view)
Edit
Attach
---+ PATH_NAME and INSTANCE_NAME for Protected Types and Subprograms %TOC% ---++ Proposal Information * State of this Proposal: * Current Owner: JimLewis, ... * Contributors: JimLewis, Main.PatrickLehmann, ... * Date Proposed: 2012-Jan-05 * Date Last Updated: 2016-Feb-19 (split out from [[ProtectedTypeUpdates]]) * Priority: * Complexity: * Focus: Testbench * Related Issues: None * Competing Issues: None ---++ Requirement Summary Within a protected type and subprogram, the path name of the shared variable declaration (protected type) and subprogram give the package context and nothing about the instance or calling context. Perhaps this requires an additional pre-defined attribute. Many data and control structures require a name to produce a useful error message. Rather than requiring a user to set an internal name, it would be preferrable to set that name (at least by default) to be something that is based on the shared variable name itself.<br /><br />Usage of instance_name and path_name within a protected type currently returns a name that is based on a name being in a package. Instead what I need is the name of the variable that creates the protected type object. 6/30/2016 see also [[ReportCallingPath]] as it may satisfy this requirement. ---++ Current Situation When using RandomPkg, we would like to give each randomization object its own seed value. One way to do this is: <verbatim>UartStimGenProc : process variable RV : RandomPType ; begin RV.InitSeed(RV'instance_name) ; -- generates unique seed for different processes </verbatim> ---++ Proposal 6/30/2016 - alternately, the format should be this'instance_name and this'path_name 6/30/2016 -rather than CALL_* use ELABORATED_INSTANCE_NAME and ELABORATED_PATH_NAME. ELABORATED_SIMPLE_NAME should be the same as SIMPLE_NAME and should not be needed. Add attributes, CALL_INSTANCE_NAME and CALL_PATH_NAME. For protected types, these determine the paths relative to the shared variable declaration. For subprograms these determine the calling path of the subprogram. Within a protected type, it would make sense to use this'instance_name. Within a general subprogram, "this" syntax would not be applicable. <verbatim> E'CALL_SIMPLE_NAME Kind: Value. Prefix: A protected type name, protected type method name, or subprogram name. Result type: Type STRING. Result: A string describing the declared name of . E'CALL_INSTANCE_NAME Kind: Value. Prefix: A protected type name, protected type method name, or subprogram name. Result type: Type STRING. Result: A string describing the hierarchical path starting at the root of the design hierarchy and descending to the named entity, including the names of instantiated design entities. In particular, for objects and methods of a protected type, it shall return a instance name that includes the variable/shared variable that references the protected type. E'CALL_PATH_NAME Kind: Value. Prefix: A protected type name, protected type method name, or subprogram name. Result type: Type STRING. Result: A string describing the hierarchical path starting at the root of the design hierarchy and descending to the named entity, including the names of instantiated design entities. In particular, for objects and methods of a protected type, it shall return a path name that includes the variable/shared variable that references the protected type. </verbatim> ---++ Use Model ---+++ Initializing RandomSeed in RandomPType As a result, rather than initializing each randomization object, the variable internal to the protected type shall be initialized. As a result, every randomization object shall be initialized with a different seed that is determined by the path name to the variable. <verbatim> type RandomPType is protected body variable RandomSeed : RandomSeedType := GenRandSeed(RandomPType'CALL_INSTANCE_PATH) ;</verbatim> ---+++ Default Name for Data Structures <verbatim> type ScoreboardPType is protected body variable Name : line := new string'(ScoreboardPType'CALL_SIMPLE_NAME) ;</verbatim> ---++ Questions -- Main.JimLewis - 2014-11-13 Anyone have a better name than CALL_INSTANCE_NAME? I was also thinking about ROOT_ or REF_. Looking for something more appropriate. -- Main.PatrickLehmann - 2016-02-18 I think it's related to [[http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/ReportCallingPath][extending the report statement]] to report the calling path. ---++ General Comments -- Main.RobGaddi - 2015-02-20 In C++/Java, you'd get to the properties of the actual instance rather than the class itself with =this=. Maybe keep that idea, do something like a ScoreboardPType 'this'SIMPLE_NAME? There may be some other handy tricks you can play with access to a =this=. See meeting minutes [[2016_MeetingFebruary18]] ---++ Supporters _Add your signature here to indicate your support for the proposal_ _-- Main.JimLewis - 2014-12-04_ -- Main.PatrickLehmann - 2016-02-18
Edit
|
Attach
|
P
rint version
|
H
istory
:
r7
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-02-17 - 15:34:36 -
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-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