diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-06 08:35:50 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-06 08:35:50 +0200 |
commit | 825099cdda3cbfbe5210570d6c2f0bb6abb360e2 (patch) | |
tree | 3bd3c9d6a1cfc0c63df48d48fa44ddeb54fa129d /src/synth/elab-vhdl_values.adb | |
parent | 26d9756273a66c4bd359b89db4829edcdb30e522 (diff) | |
download | ghdl-825099cdda3cbfbe5210570d6c2f0bb6abb360e2.tar.gz ghdl-825099cdda3cbfbe5210570d6c2f0bb6abb360e2.tar.bz2 ghdl-825099cdda3cbfbe5210570d6c2f0bb6abb360e2.zip |
synth-vhdl_stmts: handle alias in assignment expression
Diffstat (limited to 'src/synth/elab-vhdl_values.adb')
-rw-r--r-- | src/synth/elab-vhdl_values.adb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_values.adb b/src/synth/elab-vhdl_values.adb index 35dd113a7..c5485c400 100644 --- a/src/synth/elab-vhdl_values.adb +++ b/src/synth/elab-vhdl_values.adb @@ -69,6 +69,25 @@ package body Elab.Vhdl_Values is return (V.Typ, Strip_Alias_Const (V.Val)); end Strip_Alias_Const; + function Get_Memory (V : Value_Acc) return Memory_Ptr is + begin + case V.Kind is + when Value_Const => + return Get_Memory (V.C_Val); + when Value_Alias => + return Get_Memory (V.A_Obj) + V.A_Off.Mem_Off; + when Value_Memory => + return V.Mem; + when others => + raise Internal_Error; + end case; + end Get_Memory; + + function Get_Memory (V : Valtyp) return Memory_Ptr is + begin + return Get_Memory (V.Val); + end Get_Memory; + function Is_Equal (L, R : Valtyp) return Boolean is begin return Is_Equal (Get_Memtyp (L), Get_Memtyp (R)); |