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;

Ask Us a Question
x
Ask Us a Question
x
Captcha ImageReload Captcha
Incorrect data entered.
Thank you! Your question has been submitted. Please allow 1-3 business days for someone to respond to your question.
Internal error occurred. Your question was not submitted. Please contact us using Feedback form.
We use cookies to ensure we give you the best user experience and to provide you with content we believe will be of relevance to you. If you continue to use our site, you consent to our use of cookies. A detailed overview on the use of cookies and other website information is located in our Privacy Policy.