diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-03-31 18:23:32 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-03-31 18:29:05 +0200 |
commit | 86eb7790e833d2c93834901dcdf01aa89141c44c (patch) | |
tree | 160e7ed05d212e463710e7c12fdd4b8b1d3f3e6b | |
parent | d8afbddcf37ea68a19b6edfa4820ef3bdd0c5076 (diff) | |
download | ghdl-86eb7790e833d2c93834901dcdf01aa89141c44c.tar.gz ghdl-86eb7790e833d2c93834901dcdf01aa89141c44c.tar.bz2 ghdl-86eb7790e833d2c93834901dcdf01aa89141c44c.zip |
Makefile: Generate Param_Pval_* in ghdlsynth_gates.h
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | src/synth/ghdlsynth_gates.h | 10 | ||||
-rw-r--r-- | src/synth/netlists.ads | 9 |
3 files changed, 22 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 3052aec2c..d692ce123 100644 --- a/Makefile.in +++ b/Makefile.in @@ -411,6 +411,10 @@ $(srcdir)/src/synth/ghdlsynth_gates.h: $(srcdir)/src/synth/netlists.ads $(srcdir echo "enum Module_Id {" >> $@ grep -h "constant Module_Id :=" $^ | sed -e '/constant Module_Id :=/s/:.*://' -e 's/;/,/' -e 's/ *--.*//' >> $@ echo "};" >> $@ + echo "" >> $@ + echo "enum Param_Type {" >> $@ + grep ' Param_' $(srcdir)/src/synth/netlists.ads >> $@ + echo "};" >> $@ all.libghdl.true: $(libghdl_name) all.libghdl.false: diff --git a/src/synth/ghdlsynth_gates.h b/src/synth/ghdlsynth_gates.h index e22aa4713..fd45445a2 100644 --- a/src/synth/ghdlsynth_gates.h +++ b/src/synth/ghdlsynth_gates.h @@ -101,3 +101,13 @@ enum Module_Id { Id_Const_Bit = 120, Id_Const_Log = 121, }; + +enum Param_Type { + Param_Invalid, + Param_Uns32, + Param_Pval_Vector, + Param_Pval_String, + Param_Pval_Integer, + Param_Pval_Real, + Param_Pval_Time_Ps +}; diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads index 23f369596..c478cd961 100644 --- a/src/synth/netlists.ads +++ b/src/synth/netlists.ads @@ -169,14 +169,21 @@ package Netlists is subtype Param_Nbr is Param_Idx range 0 .. Param_Idx'Last - 1; + -- Type of a parameter. As this is defined in a module, this is valid for + -- all instances. + -- NOTE: the corresponding C enum is built from this type using the + -- 'Param_' prefix and indentation. type Param_Type is - (Param_Invalid, + ( + Param_Invalid, -- An unsigned 32 bit value. Param_Uns32, -- A Generic value (with a hint of the type). This is a bit/logic -- vector. + -- TODO: Replace Integer with Signed/Unsigned. + -- TODO: Add boolean. Param_Pval_Vector, Param_Pval_String, Param_Pval_Integer, |