aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-29 18:44:11 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-29 18:44:11 +0200
commit1e90b56431dc5df5463a760555b1abc746f50958 (patch)
treea2f558d972f3d72817e5bf60087334cae6370838 /src/synth/netlists.adb
parent2068fb5a9eba5da625d2dd73fdcb47755487d9f3 (diff)
downloadghdl-1e90b56431dc5df5463a760555b1abc746f50958.tar.gz
ghdl-1e90b56431dc5df5463a760555b1abc746f50958.tar.bz2
ghdl-1e90b56431dc5df5463a760555b1abc746f50958.zip
synth: add support for memories.
Diffstat (limited to 'src/synth/netlists.adb')
-rw-r--r--src/synth/netlists.adb19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/synth/netlists.adb b/src/synth/netlists.adb
index 72ceac948..1bde22ac6 100644
--- a/src/synth/netlists.adb
+++ b/src/synth/netlists.adb
@@ -19,6 +19,7 @@
-- MA 02110-1301, USA.
with Netlists.Utils; use Netlists.Utils;
+with Netlists.Gates;
with Tables;
package body Netlists is
@@ -664,11 +665,19 @@ package body Netlists is
function Get_Param_Desc (M : Module; Param : Param_Idx) return Param_Desc
is
+ use Netlists.Gates;
pragma Assert (Is_Valid (M));
- pragma Assert (Param < Get_Nbr_Params (M));
begin
- return Param_Desc_Table.Table
- (Modules_Table.Table (M).First_Param_Desc + Param_Desc_Idx (Param));
+ case Get_Id (M) is
+ when Id_Const_Bit
+ | Id_Const_Log =>
+ return (No_Sname, Param_Uns32);
+ when others =>
+ pragma Assert (Param < Get_Nbr_Params (M));
+ return Param_Desc_Table.Table
+ (Modules_Table.Table (M).First_Param_Desc
+ + Param_Desc_Idx (Param));
+ end case;
end Get_Param_Desc;
function Get_Param_Idx (Inst : Instance; Param : Param_Idx) return Param_Idx
@@ -683,7 +692,7 @@ package body Netlists is
is
pragma Assert (Is_Valid (Inst));
M : constant Module := Get_Module (Inst);
- pragma Assert (Param < Get_Nbr_Params (M));
+ pragma Assert (Param < Get_Nbr_Params (Inst));
pragma Assert (Get_Param_Desc (M, Param).Typ = Param_Uns32);
begin
return Params_Table.Table (Get_Param_Idx (Inst, Param));
@@ -693,7 +702,7 @@ package body Netlists is
is
pragma Assert (Is_Valid (Inst));
M : constant Module := Get_Module (Inst);
- pragma Assert (Param < Get_Nbr_Params (M));
+ pragma Assert (Param < Get_Nbr_Params (Inst));
pragma Assert (Get_Param_Desc (M, Param).Typ = Param_Uns32);
begin
Params_Table.Table (Get_Param_Idx (Inst, Param)) := Val;