aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-03 17:25:39 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-04 19:04:09 +0200
commit683fbcde25efed81aac4d659d89bc4a8421a7b26 (patch)
treeb5720b6e9ae24f0d90e4d85474bcce4811022b84 /src/synth/synth-stmts.adb
parentd3670fb86dc7ccd39d2e6738d90d268da3308713 (diff)
downloadghdl-683fbcde25efed81aac4d659d89bc4a8421a7b26.tar.gz
ghdl-683fbcde25efed81aac4d659d89bc4a8421a7b26.tar.bz2
ghdl-683fbcde25efed81aac4d659d89bc4a8421a7b26.zip
synth: minor refactoring for clean-up.
Diffstat (limited to 'src/synth/synth-stmts.adb')
-rw-r--r--src/synth/synth-stmts.adb49
1 files changed, 2 insertions, 47 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 88fa1df4c..0ebdf073f 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -1066,54 +1066,9 @@ package body Synth.Stmts is
-- 3) The default value is unused *or* it is static
-- 4) All the values are equal.
-- then assign directly.
- Sval := Null_Memtyp;
- declare
- Prev_Val : Memtyp;
- begin
- Prev_Val := Null_Memtyp;
- for I in Pasgns'Range loop
- case Pasgns (I).Is_Static is
- when False =>
- Sval := Null_Memtyp;
- -- It's over.
- exit;
- when Unknown =>
- if Prev_Val = Null_Memtyp then
- if not Is_Static_Wire (Wi) then
- Sval := Null_Memtyp;
- -- It's over.
- exit;
- end if;
- Prev_Val := Get_Static_Wire (Wi);
- end if;
- if Sval /= Null_Memtyp
- and then not Is_Equal (Sval, Prev_Val)
- then
- Sval := Null_Memtyp;
- -- It's over.
- exit;
- end if;
- when True =>
- if Sval = Null_Memtyp then
- Sval := Pasgns (I).Val;
- if Prev_Val /= Null_Memtyp
- and then not Is_Equal (Sval, Prev_Val)
- then
- Sval := Null_Memtyp;
- -- It's over.
- exit;
- end if;
- else
- if not Is_Equal (Sval, Pasgns (I).Val) then
- Sval := Null_Memtyp;
- -- It's over.
- exit;
- end if;
- end if;
- end case;
- end loop;
- end;
+ Sval := Is_Assign_Value_Array_Static (Wi, Pasgns.all);
if Sval /= Null_Memtyp then
+ -- Use static assignment.
Phi_Assign_Static (Wi, Sval);
else
-- Compute the final value for each partial part of the wire.