Shorthand Subprogram Declarations

Proposal Editing Information

  • Who Updates: JimLewis, <Add YourName >, ...
  • Date Proposed: 2012-08-19
  • Date Last Updated: 2012-08-19
  • Priority:
  • Complexity:
  • Focus: Testbench

Requirement Summary

Simplify related subprogram declarations.

Related and/or Competing Issues: None

Current Issues:

It is common to have subprograms of the following form:

function GenBin (
    AtLeast : integer ;  
    Min, Max, NumBin : integer 
) return CovBinType is
begin
    return  GenBin(
                   AtLeast  => AtLeast,
                   Weight   => 1,
                   Min      => Min,
                   Max      => Max,
                   NumBin   => NumBin
                ) ;
end function GenBin ; 

Use Model 1:

function GenBin is new GenBin 
    parameter (
        AtLeast => AtLeast, 
        Weight => 0, 
        Min => Min, 
        Max => Max, 
        NumBin => NumBin
    ) ;  

Alternately with alias:

alias GenBin is GenBin [
        AtLeast => AtLeast, 
        Weight => 0, 
        Min => Min, 
        Max => Max, 
        NumBin => NumBin return ]

Use Model 2:

Syntax is not complete yet.

Function "+" (L: unresolved_unsigned; R : std_ulogic) return unresolved_unsigned; 
Function "+" (L : std_ulogic; R: unresolved_unsigend) return unsigned is 
    new "+"[unresolved_unsigned, std_ulogic return unresolved_unsigned] 
        parameter (L => R, R =>L) ; 

Proposal

Questions

General Comments

Supporters

Add your signature here to indicate your support for the proposal

-- PatrickLehmann - 2016-02-19

Topic revision: r4 - 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