サブプログラムの仮パラメータがあり、サブプログラムに渡される実際のパラメータが変数ではないとき、上記エラーが発生します。
プロシージャ p の仮パラメータ v は変数であり、実際のパラメータ s は信号であるため、下記コードセクションではCOMP96_0153 を発生します。:
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;
スタンダードパッケージのサブプログラムで同じ問題が報告されます。例えば、std.textio パッケージのサブプログラム writeline メソッド。
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;
この問題を回避するためには、実際のパラメータと仮パラメータが一致していることを確認してください。これは、サブプログラムの宣言の変更またはサブプログラム·コールのどちらかが必要になります。
最初の例は、以下のようにサブプログラム宣言を変更すると問題なくにコンパイルされます:
procedure p (signal v: in bit) is begin end;
2番目の例を改善するため、次の様にアーキテクチャを変えてください:
architecture ar of en is file f: text; begin process variable v: line; begin writeline (f, v); wait; end process; end;