TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
MethodParametersAccessTypes
(2020-02-17,
JimLewis
)
(raw view)
E
dit
A
ttach
---+ Allow Protected Type Method Parameters to be Access Types, Protected Types (functions), and File 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 ---++ Requirement Summary Allow method parameters to be of an access type, protected type, or file type. ---++ Related: [[https://bugzilla.mentor.com/show_bug.cgi?id=290][Bugzilla 290]] Main.RichardHead suggests allowing method parameters to be of an access types. ---++ Use Model: Access Types ---+++ !TextIO inside of a Protected Type Textio builds up strings up into a write buffer that is of type line, which is access to string. As a result, textio is not feasible. <verbatim>shared variable PtObject : AProtectedType ; . . . PtObject.write(WriteBuf) ; </verbatim> ---+++ Data Structure Creation OSVVM coverage modeling uses protected type methods to create the coverage model. Currently a coverage bin is allowed to consist of a single range. SystemVerilog allows a point bin to be a collection of ranges. To implement this and keep OSVVM's simplified method for modeling cross coverage requires a ragged array structure - an array of arrays where the inner array of different indicies has a different number of elements. <verbatim>-- place holder for example of write</verbatim> ---+++ Issues with Access Types Permitting access type parmeters is both practical and extremely dangerous. It is dangerous since it potentially allows an application to hand out pointers to internal data structures, and hence, we loose atomicity and exclusive access to an object. On the other hand, disallowing it prevents simple things like a textio write procedure and more complex things like building complex irregular shaped data structures (ie: a coverage model). The things that it is preventing that are safe can be classed as handing off pointers that are to copies of objects. Currently the OSVVM coverage modeling limits a coverage bin to have only a single range. To be able to handle a bin that is a collection of ranges (and values) requires passing an array of pointers as each set of bins may have a different number of elements. In past discussions about extensions of this sort, it was suggested that protected type usage then give up on atomicity and exclusive access and only allow usage of regular types. This unfortunately would not satisfy the need for OSVVM as coverage models need to be accessed from separate processes (concurrent threads). ---++ Use Model: Protected Type To Be supplied. See Protected Types and regular functions. <pre>shared variable PtObject : AProtectedType ; . . . PtObject.write(WriteBuf) ; </pre> ---++ Use Model: File Type Motivation: Creating write methods for file io. Currently disallowed by the language. Anyone know why? In Coverage Modeling, we would like to be able to have the following as a public method: <verbatim>procedure WriteBin ( file f : text ) is variable PrintItemName : boolean := FALSE ; begin WriteBinName(f, "WriteBin: ") ; for i in 1 to NumBins loop -- CovBinPtr.all'range if CovBinPtr(i).count < 0 then write(f, "%%Illegal Bin:") ; write(f, CovBinPtr(i).BinVal.all) ; ... end procedure WriteBin ;</verbatim> ---++ Questions ---++ Proposal ---++ Issues ---++ General Comments Essential to improve testbench utility capabilities. ---++ 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-19 -- Main.TorstenMeissner - 2016-05-18
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r11
<
r10
<
r9
<
r8
<
r7
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r11 - 2020-02-17 - 15:34:35 -
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