aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-gates.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-24 06:22:16 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-24 06:22:16 +0200
commit921398c1dac0979723374afc01b9feb6e01fa98e (patch)
tree2d4fa3122f13edba041eae0529f30951d3c1ef85 /src/synth/netlists-gates.ads
parent01c82f09be0baaa84cc189255b47fb1326da7424 (diff)
downloadghdl-921398c1dac0979723374afc01b9feb6e01fa98e.tar.gz
ghdl-921398c1dac0979723374afc01b9feb6e01fa98e.tar.bz2
ghdl-921398c1dac0979723374afc01b9feb6e01fa98e.zip
synth: fix handling of multi-dim ROM. Fix #1390
Document index order for memidx.
Diffstat (limited to 'src/synth/netlists-gates.ads')
-rw-r--r--src/synth/netlists-gates.ads9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/netlists-gates.ads b/src/synth/netlists-gates.ads
index 990331bf9..4acf9f6b4 100644
--- a/src/synth/netlists-gates.ads
+++ b/src/synth/netlists-gates.ads
@@ -257,12 +257,21 @@ package Netlists.Gates is
subtype Dyn_Insert_Module_Id is
Module_Id range Id_Dyn_Insert .. Id_Dyn_Insert_En;
+ -- Gate to compute dynamic insert or extract offsets.
+ -- Provides the scale (step) factor (needed for insert/extract wider than
+ -- 1 bit), also provides the maximum index value.
+ -- For multi-dimensional insert/extract, memidx needs to be combined with
+ -- addidx.
-- Inputs: 0: index
-- Params: 0: step
-- 1: max
-- OUT := IN0 * STEP, IN0 < MAX
Id_Memidx : constant Module_Id := 90;
+ -- Combine (simply add) indexes for dynamic insert or extract.
+ -- Despite the addition being commutative, the inputs are ordered.
+ -- Input 0 must be a memidx (the most significant one, so with the larger
+ -- step), and input 1 must be either a memidx or an addidx.
-- OUT := IN0 + IN1, size extension (max of inputs width).
-- Inputs: 0: a memidx
-- 1: chain (addidx or memidx).