aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-gates.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-21 17:16:08 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-21 17:16:08 +0100
commit134c6ed91339538eeb0c62b25de4c2ea79e89e37 (patch)
tree9b3da160a0b299533ee8a5c0c7553ff29be0469b /src/synth/netlists-gates.ads
parente63bc8249ddfca1176b72f038ba8b9fa12b0f38c (diff)
downloadghdl-134c6ed91339538eeb0c62b25de4c2ea79e89e37.tar.gz
ghdl-134c6ed91339538eeb0c62b25de4c2ea79e89e37.tar.bz2
ghdl-134c6ed91339538eeb0c62b25de4c2ea79e89e37.zip
synth: handle numeric_std minimum/maximum. Fix #1168
Diffstat (limited to 'src/synth/netlists-gates.ads')
-rw-r--r--src/synth/netlists-gates.ads92
1 files changed, 48 insertions, 44 deletions
diff --git a/src/synth/netlists-gates.ads b/src/synth/netlists-gates.ads
index c6c1c4815..b60420c22 100644
--- a/src/synth/netlists-gates.ads
+++ b/src/synth/netlists-gates.ads
@@ -33,72 +33,76 @@ package Netlists.Gates is
Id_Add : constant Module_Id := 9;
Id_Sub : constant Module_Id := 10;
- Id_Umul : constant Module_Id := 11;
- Id_Smul : constant Module_Id := 12;
- Id_Udiv : constant Module_Id := 13;
- Id_Sdiv : constant Module_Id := 14;
- Id_Umod : constant Module_Id := 15;
- Id_Smod : constant Module_Id := 16;
- Id_Srem : constant Module_Id := 17;
+ Id_Umin : constant Module_Id := 11;
+ Id_Smin : constant Module_Id := 12;
+ Id_Umax : constant Module_Id := 13;
+ Id_Smax : constant Module_Id := 14;
+ Id_Umul : constant Module_Id := 15;
+ Id_Smul : constant Module_Id := 16;
+ Id_Udiv : constant Module_Id := 17;
+ Id_Sdiv : constant Module_Id := 18;
+ Id_Umod : constant Module_Id := 19;
+ Id_Smod : constant Module_Id := 20;
+ Id_Srem : constant Module_Id := 21;
subtype Dyadic_Module_Id is Module_Id range Id_And .. Id_Srem;
- Id_Not : constant Module_Id := 18;
- Id_Neg : constant Module_Id := 19;
- Id_Abs : constant Module_Id := 20;
+ Id_Not : constant Module_Id := 22;
+ Id_Neg : constant Module_Id := 23;
+ Id_Abs : constant Module_Id := 24;
subtype Monadic_Module_Id is Module_Id range Id_Not .. Id_Abs;
-- Logical and arithmetic shifts.
-- FIXME: clarify right operand: width, large values
- Id_Lsl : constant Module_Id := 22;
- Id_Lsr : constant Module_Id := 23;
- Id_Asr : constant Module_Id := 24;
+ Id_Lsl : constant Module_Id := 25;
+ Id_Lsr : constant Module_Id := 26;
+ Id_Asr : constant Module_Id := 27;
subtype Shift_Module_Id is Module_Id range Id_Lsl .. Id_Asr;
-- Rotations.
-- FIXME: clarify right operand.
- Id_Rol : constant Module_Id := 25;
- Id_Ror : constant Module_Id := 26;
+ Id_Rol : constant Module_Id := 28;
+ Id_Ror : constant Module_Id := 29;
subtype Rotate_Module_Id is Module_Id range Id_Lsl .. Id_Asr;
subtype Shift_Rotate_Module_Id is Module_Id range Id_Lsl .. Id_Ror;
- Id_Eq : constant Module_Id := 27;
- Id_Ne : constant Module_Id := 28;
- Id_Ule : constant Module_Id := 29;
- Id_Sle : constant Module_Id := 30;
- Id_Ult : constant Module_Id := 31;
- Id_Slt : constant Module_Id := 32;
- Id_Uge : constant Module_Id := 33;
- Id_Sge : constant Module_Id := 34;
- Id_Ugt : constant Module_Id := 35;
- Id_Sgt : constant Module_Id := 36;
+ Id_Eq : constant Module_Id := 30;
+ Id_Ne : constant Module_Id := 31;
+ Id_Ule : constant Module_Id := 32;
+ Id_Sle : constant Module_Id := 33;
+ Id_Ult : constant Module_Id := 34;
+ Id_Slt : constant Module_Id := 35;
+ Id_Uge : constant Module_Id := 36;
+ Id_Sge : constant Module_Id := 37;
+ Id_Ugt : constant Module_Id := 38;
+ Id_Sgt : constant Module_Id := 39;
subtype Compare_Module_Id is Module_Id range Id_Eq .. Id_Sgt;
- Id_Red_And : constant Module_Id := 37;
- Id_Red_Or : constant Module_Id := 38;
+ Id_Red_And : constant Module_Id := 40;
+ Id_Red_Or : constant Module_Id := 41;
subtype Reduce_Module_Id is Module_Id range Id_Red_And .. Id_Red_Or;
- Id_Concat2 : constant Module_Id := 40;
- Id_Concat3 : constant Module_Id := 41;
- Id_Concat4 : constant Module_Id := 42;
+ Id_Concat2 : constant Module_Id := 42;
+ Id_Concat3 : constant Module_Id := 43;
+ Id_Concat4 : constant Module_Id := 44;
subtype Concat_Module_Id is Module_Id range Id_Concat2 .. Id_Concat4;
-- Concatenation with N inputs.
- Id_Concatn : constant Module_Id := 43;
+ Id_Concatn : constant Module_Id := 45;
-- Inputs: s, i0, i1
-- Output: o
- Id_Mux2 : constant Module_Id := 44;
+ Id_Mux2 : constant Module_Id := 46;
-- Inputs: s, i0, i1, s2, s3
-- Output: o
- Id_Mux4 : constant Module_Id := 45;
+ Id_Mux4 : constant Module_Id := 47;
subtype Mux_Module_Id is Module_Id range Id_Mux2 .. Id_Mux4;
@@ -110,11 +114,11 @@ package Netlists.Gates is
-- by a gate (and thus the value of the output could be read), but that
-- driving value may not be available early enough.
-- Id_Ioutput is an output with an initial value.
- Id_Signal : constant Module_Id := 46;
- Id_Isignal : constant Module_Id := 47;
- Id_Output : constant Module_Id := 48;
- Id_Ioutput : constant Module_Id := 49;
- Id_Port : constant Module_Id := 50;
+ Id_Signal : constant Module_Id := 48;
+ Id_Isignal : constant Module_Id := 49;
+ Id_Output : constant Module_Id := 50;
+ Id_Ioutput : constant Module_Id := 51;
+ Id_Port : constant Module_Id := 52;
-- Note: initial values must be constant nets.
--
@@ -124,7 +128,7 @@ package Netlists.Gates is
-- Inputs: 0: CLK
-- 1: D
-- Output: 0: Q
- Id_Dff : constant Module_Id := 52;
+ Id_Dff : constant Module_Id := 56;
-- A DFF with an asynchronous reset. Note that the asynchronous reset
-- has priority over the clock. When RST is asserted, the value is
@@ -134,7 +138,7 @@ package Netlists.Gates is
-- 2: RST
-- 3: RST_VAL
-- Output: 0: Q
- Id_Adff : constant Module_Id := 53;
+ Id_Adff : constant Module_Id := 57;
-- A simple DFF with an initial value (must be constant). This is
-- for FPGAs.
@@ -142,7 +146,7 @@ package Netlists.Gates is
-- 1: D
-- 2: INIT (initial value)
-- Output: 0: Q
- Id_Idff : constant Module_Id := 54;
+ Id_Idff : constant Module_Id := 58;
-- A DFF with an asynchronous reset and an initial value.
-- Inputs: 0: CLK
@@ -151,14 +155,14 @@ package Netlists.Gates is
-- 3: RST_VAL
-- 4: INIT (initial value)
-- Output: 0: Q
- Id_Iadff : constant Module_Id := 55;
+ Id_Iadff : constant Module_Id := 59;
-- Multi clock dff. ELSE is the output of the next DFF.
-- Inputs: 0: CLK
-- 1: D
-- 2: ELSE
-- Output: 0: Q
- Id_Mdff : constant Module_Id := 56;
+ Id_Mdff : constant Module_Id := 60;
-- Multi clock dff with initial value. ELSE is the output of the next DFF.
-- Inputs: 0: CLK
@@ -166,7 +170,7 @@ package Netlists.Gates is
-- 2: ELSE
-- 3: Init
-- Output: 0: Q
- Id_Midff : constant Module_Id := 57;
+ Id_Midff : constant Module_Id := 61;
-- Width change: truncate or extend. Sign is know in order to possibly
-- detect loss of value.