TWiki
>
P1076 Web
>
VHDL2017
>
LCS2016_I16
(revision 11) (raw view)
Edit
Attach
---+ Language Change Specification for Repair Example in Section 23.21 Proposal <table border="1" cellpadding="0" cellspacing="0" id="table1" rules="all"> <tbody> <tr> <td bgcolor="#ffffff" valign="top"> *LCS Number:* </td> <td bgcolor="#ffffff" valign="top">LCS-2016-I16</td> </tr> <tr> <td bgcolor="#edf4f9" valign="top"> *Version:* </td> <td bgcolor="#edf4f9" valign="top">2</td> </tr> <tr> <td bgcolor="#ffffff" valign="top"> *Date:* </td> <td bgcolor="#ffffff" valign="top">Feb-16-2017</td> </tr> <tr> <td bgcolor="#edf4f9" valign="top"> *Status:* </td> <td bgcolor="#edf4f9" valign="top"> Voting</td> </tr> <tr> <td bgcolor="#ffffff" valign="top"> *Author:* </td> <td bgcolor="#ffffff" valign="top">Peter LaDow </td> </tr> <tr> <td bgcolor="#edf4f9" valign="top"> *Email:* </td> <td bgcolor="#edf4f9" valign="top"> [[http://www.eda-twiki.org/cgi-bin/view.cgi/Main/PeterLadow][Peter LaDow]]</td> </tr> <tr> <td bgcolor="#ffffff" valign="top"> *Source Doc:* </td> <td bgcolor="#ffffff" valign="top"> [[RepairExampleInSection2321Proposal][Repair Example in Section 23.21]]</td> </tr> <tr> <td bgcolor="#edf4f9" valign="top"> *Summary:* </td> <td bgcolor="#edf4f9" valign="top">Repair Example in Section 23.21</td> </tr> </tbody> </table> ---+++ Voting Results: Cast your votes here Yes: 1 %USERSIG{PeterLadow - 2016-02-16}% <p> </p> No: <p> </p> <p> </p> Abstain: 1 <span data-mce-mark="1">%USERSIG{KevinJennings - 2016-12-01}%</span> 1 <span data-mce-mark="1">%USERSIG{PatrickLehmann - 2016-12-09}%</span> 1 %USERSIG{MartinThompson - 2016-12-12}% 1 %USERSIG{RyanHinton - 2016-12-19}% 1 %USERSIG{MartinZabel - 2017-01-19}% <p> </p> 1 %USERSIG{BrentHahoe - 2017-02-16}% Version 1 - Abstain due to lack of personal time for review. <p> </p> ---+++ Details of Language Change: Key: * Existing LRM text is shown in BLACK font * Additional LRM text is shown in %RED%RED font%ENDCOLOR% * Deleted LRM text is shown in %RED%<del>RED with strike-through</del>%ENDCOLOR% <p> </p> ---++++ LRM 23.21 page 407 near middle <pre>%BLACK%void exec_proc(vhpiCbDataT cbDatap) {<br /> vhpiHandleT subpCallHdl, formal1, formalIt;<br /> %RED%<del>int val = 0;</del>%ENDCOLOR%<br /> vhpiValueT value; value.format = vhpiIntVal; value.value%RED%<del>->integer</del>.intg%ENDCOLOR% = %RED%<del>&val</del>0%ENDCOLOR%;<br /> subpCallHdl = cbDatap->obj; /* get a handle to the first formal parameter of the subprogram call */<br /> formal1 = vhpi_handle_by_index(vhpiParamDecls, subpCallHdl, 0); switch(vhpi_get(vhpiModeP, formal1)) { case vhpiIN:<br /> vhpi_get_value(formal1, &value);<br /> break;<br /> case vhpiOUT:<br /> vhpi_put_value(formal1, &value%RED%, vhpiDepositPropagate%ENDCOLOR%);<br /> break;<br /> default:<br /> break;<br /> }<br />}<br />%ENDCOLOR%</pre> ---++ Comments I am unhappy about setting the integer value to an address on the stack. 1. %USERSIG%{PeterFlake - 2017-02-08} The LRM is not explicit for the given example since it does not give the corresponding subprogram signature. Regardless, neither the original nor the edit are correct. Nor is the example particularly meaningful for the vhpi_put_value case Now, based on the type, 'vhpiIntVal' this is a subprogram where the first formal parameter is an integer, something like: procedure myproc(variable val : in integer); In the orignal, the 'value' union in 'vhpiValueT' does not have a member named 'integer'. And in the edit, 'intg' is an int, not an int*. The local 'val' is not necessary, but if one wanted to be explicit, one would do 'value.value.intg = val;' (As a side not, there are '*s' versions, such as 'intgs' which are pointers. But these are used for array of values. So if the formal were an array of integers, the format would be vhpiIntVecVal and intgs would be used. In that case, a pointer to an array of integers is necessary. And it is safe to use value allocated on the stack.) The addition of the 3rd argument to vhpi_put_value is appropriate (though vhpiDepositPropagate is only meaningful if the formal is a signal--the missing subprogram signature would make this more clear). I'm not sure if I can edit the change directly, or if the original LCS author should do so. -- %BUBBLESIG{PeteLadow - 2017-02-13}% %COMMENT%
Edit
|
Attach
|
P
rint version
|
H
istory
:
r15
|
r13
<
r12
<
r11
<
r10
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2017-04-02 - 16:30:51 -
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