diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-30 00:14:32 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-30 00:14:32 +0200 |
commit | f31e97f8113d0d50443a37f44b3f8b650aa60a34 (patch) | |
tree | 6025e1b025f48fcaffdb5d6c1b6e60f443f96c64 /src/synth/synth-expr.adb | |
parent | 33600b36bb0c3c10686047b006b47be660164095 (diff) | |
download | ghdl-f31e97f8113d0d50443a37f44b3f8b650aa60a34.tar.gz ghdl-f31e97f8113d0d50443a37f44b3f8b650aa60a34.tar.bz2 ghdl-f31e97f8113d0d50443a37f44b3f8b650aa60a34.zip |
synth: handle slice with index from a record.
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r-- | src/synth/synth-expr.adb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 4213ea506..7129eb90f 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1075,12 +1075,22 @@ package body Synth.Expr is if Get_Id (Linst) /= Get_Id (Rinst) then return False; end if; - if Get_Id (Linst) = Id_Uextend then - return Is_Same (Get_Input_Net (Linst, 0), - Get_Input_Net (Rinst, 0)); - end if; + case Get_Id (Linst) is + when Id_Uextend => + -- When index is extended from a subtype. + return Is_Same (Get_Input_Net (Linst, 0), + Get_Input_Net (Rinst, 0)); + when Id_Extract => + -- When index is extracted from a record. + if Get_Param_Uns32 (Linst, 0) /= Get_Param_Uns32 (Rinst, 0) then + return False; + end if; + return Is_Same (Get_Input_Net (Linst, 0), + Get_Input_Net (Rinst, 0)); + when others => + return False; + end case; end; - return False; end Is_Same; -- Identify LEFT to/downto RIGHT as: |