Repair Example in Section 23.21 Proposal


LCS

LCS-2016-I16

Proposal Details

  • Language Version: VHDL-2008

  • Classification: LRM Correction

  • Summary: One of the examples in LRM section 23.21 is incorrect.

  • Relevant_LRM_Sections: 23.21

  • Authors_Name: Radoslaw Nawrot

  • Authors_Fax_Number: +48 32 608 7693

  • Authors_Email_Address: Radoslaw.Nawrot@aldecNOSPAMNOSPAM.com.pl

  • Authors_Affiliation: Aldec

  • Authors_Address1: 2260 Corporate Circle

  • Authors_Address2: Henderson, NV 89074

  • Authors_Address3: USA

  • Date Submitted:November 14, 2014

  • Date Analyzed:

  • Author of Analysis:

  • Revision Number: 1

  • Date Last Revised:November 14, 2014

Current Situation

void exec_proc(vhpiCbDataT cbDatap) {
  vhpiHandleT subpCallHdl, formal1, formalIt;
  int val = 0;
  vhpiValueT value;

  value.format = vhpiIntVal;
  value.value->integer = &val;
  subpCallHdl = cbDatap->obj;

  /* get a handle to the first formal parameter
     of the subprogram call */
  formal1 = vhpi_handle_by_index(vhpiParamDecls, subpCallHdl, 0);

  switch(vhpi_get(vhpiModeP, formal1)) {
  case vhpiIN:
    vhpi_get_value(formal1, &value);
    break;
  case vhpiOUT:
    vhpi_put_value(formal1, &value);
    break;
  default:
    break;
  }
}

Proposed Resolution

void exec_proc(vhpiCbDataT cbDatap) {
  vhpiHandleT subpCallHdl, formal1, formalIt;
  int val = 0;
  vhpiValueT value;

  value.format = vhpiIntVal;
  value.value.intg = &val;
  subpCallHdl = cbDatap->obj;

  /* get a handle to the first formal parameter
     of the subprogram call */
  formal1 = vhpi_handle_by_index(vhpiParamDecls, subpCallHdl, 0);

  switch(vhpi_get(vhpiModeP, formal1)) {
  case vhpiIN:
    vhpi_get_value(formal1, &value);
    break;
  case vhpiOUT:
    vhpi_put_value(formal1, &value, vhpiDepositPropagate);
    break;
  default:
    break;
  }
}

General Comments

Place for general comments

Supporters

Add your signature here to indicate your support for the proposal

-- RadoslawNawrot - 2014-11-14

I Attachment Action Size Date Who Comment
PDFpdf Repair_Example_in_Section_23.21_Proposal.pdf manage 64.3 K 2014-11-14 - 08:14 RadoslawNawrot PDF version
Topic revision: r6 - 2020-02-17 - 15:34:38 - JimLewis
 
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback