ACOM: Error: COMP96_0153: Formal "<name>" of class variable must be associated with a variable

Description

The above error occurs when the actual parameter that is passed to a subprogram is not a variable but the formal parameter of the subprogram is.

The following section of code generates COMP96_0153 because the formal parameter v of procedure p is a variable, and the actual parameter s is a signal:

entity en is
end;

architecture ar of en is
  signal s: bit;

  procedure p (variable v: in bit) is
  begin
  end;

begin
  process
  begin
    p (s); --COMP96_0153
    wait;
  end process;
end;

The same error can be reported for subprograms from the standard packages, e.g. subprogram writeline from package std.textio.

library std;
use std.textio.all;
entity en is
end;

architecture ar of en is
  file f: text;
  signal v: line --COMP96_0108;
begin
process
begin
  writeline (f, v); --COMP96_0153
  wait;
end process;

end;

Solution

To avoid this error, make sure that the actual parameters match the formal parameter. This will require either a change in the subprogram declaration or the subprogram calls.

The example in the first listing will compile cleanly if the subprogram declaration is changed as follows:

procedure p (signal v: in bit) is
  begin
  end;

To correct the second listing, change the architecture as follows:

architecture ar of en is
  file f: text;
begin
  process
    variable v: line;
  begin
    writeline (f, v);
    wait;
  end process;
end;



Printed version of site: support.aldec.com/en/support/resources/documentation/faq/1726