aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-05-25 06:48:27 +0200
committerTristan Gingold <tgingold@free.fr>2022-05-25 06:48:27 +0200
commit1aea5cb51957a3dd0d715bfc7d59db3dda747665 (patch)
tree25aafdd471844e1952536bb0574ad97e3624abc9 /src/vhdl
parent0ceba3fdfbf42443a44a2b8ad4f601fb72add5a5 (diff)
downloadghdl-1aea5cb51957a3dd0d715bfc7d59db3dda747665.tar.gz
ghdl-1aea5cb51957a3dd0d715bfc7d59db3dda747665.tar.bz2
ghdl-1aea5cb51957a3dd0d715bfc7d59db3dda747665.zip
vhdl: move Is_Copyback_Parameter to vhdl-utils
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-utils.adb10
-rw-r--r--src/vhdl/vhdl-utils.ads4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb
index fecb0602c..300c082a5 100644
--- a/src/vhdl/vhdl-utils.adb
+++ b/src/vhdl/vhdl-utils.adb
@@ -676,6 +676,16 @@ package body Vhdl.Utils is
end case;
end Is_Parameter;
+ function Is_Copyback_Parameter (Inter : Iir) return Boolean is
+ begin
+ case Iir_Parameter_Modes (Get_Mode (Inter)) is
+ when Iir_In_Mode =>
+ return False;
+ when Iir_Out_Mode | Iir_Inout_Mode =>
+ return Get_Kind (Inter) = Iir_Kind_Interface_Variable_Declaration;
+ end case;
+ end Is_Copyback_Parameter;
+
function Find_Name_In_Flist (List : Iir_Flist; Lit : Name_Id) return Iir
is
El : Iir;
diff --git a/src/vhdl/vhdl-utils.ads b/src/vhdl/vhdl-utils.ads
index f51599cdf..01425a157 100644
--- a/src/vhdl/vhdl-utils.ads
+++ b/src/vhdl/vhdl-utils.ads
@@ -112,6 +112,10 @@ package Vhdl.Utils is
-- Return True iff interface INTER is a (subprogram) parameter.
function Is_Parameter (Inter : Iir) return Boolean;
+ -- Return True iff parameter INTER should be copied back (for out/inout
+ -- variable).
+ function Is_Copyback_Parameter (Inter : Iir) return Boolean;
+
-- Duplicate enumeration literal LIT.
function Copy_Enumeration_Literal (Lit : Iir) return Iir;