diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-17 08:07:16 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-17 08:07:16 +0200 |
commit | 8f7685ca87f6fe05a3e8a5d3d1becc5e5e2d9b1f (patch) | |
tree | cede719012c5c3698ec10a0fcd1d36b372568446 /src/synth/synth-environment.adb | |
parent | a7cf3bd793fdbd9f5f03bc496040d4ce91931186 (diff) | |
download | ghdl-8f7685ca87f6fe05a3e8a5d3d1becc5e5e2d9b1f.tar.gz ghdl-8f7685ca87f6fe05a3e8a5d3d1becc5e5e2d9b1f.tar.bz2 ghdl-8f7685ca87f6fe05a3e8a5d3d1becc5e5e2d9b1f.zip |
synth: fix to get_current_assign_value.
Diffstat (limited to 'src/synth/synth-environment.adb')
-rw-r--r-- | src/synth/synth-environment.adb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/synth/synth-environment.adb b/src/synth/synth-environment.adb index 1d054d21b..33a38db0c 100644 --- a/src/synth/synth-environment.adb +++ b/src/synth/synth-environment.adb @@ -591,11 +591,7 @@ package body Synth.Environment is -- If no seq assign, return current value. if First_Seq = No_Seq_Assign then - if Off = 0 and then Wd = Get_Width (Wire.Gate) then - return Wire.Gate; - else - return Build_Extract (Ctxt, Wire.Gate, Off, Wd); - end if; + return Build2_Extract (Ctxt, Wire.Gate, Off, Wd); end if; -- If the range is the same as the seq assign, return the value. @@ -640,9 +636,10 @@ package body Synth.Environment is and then Pr.Offset + Pw > Cur_Off then -- Found. - if Pr.Offset = Cur_Off and then Pw = Cur_Wd then + if Pr.Offset = Cur_Off and then Pw <= Cur_Wd then -- No need to extract. Append (Vec, Pr.Value); + Cur_Wd := Pw; else Cur_Wd := Width'Min (Cur_Wd, Pw - (Cur_Off - Pr.Offset)); @@ -652,7 +649,7 @@ package body Synth.Environment is end if; exit; end if; - if Pr.Offset + Pw < Cur_Off then + if Pr.Offset + Pw <= Cur_Off then -- Next partial; P := Pr.Next; elsif Pr.Offset > Cur_Off |