diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-05 18:59:04 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-05 18:59:04 +0100 |
commit | 7359cb0eba5d395062bdb8dd587d09f1db544f05 (patch) | |
tree | 3d5be99c9570d3c38d766589f1ac3f26345260ea /src/synth/netlists-folds.ads | |
parent | ecc117b872aec5b4673de32028a7c36060d05eec (diff) | |
download | ghdl-7359cb0eba5d395062bdb8dd587d09f1db544f05.tar.gz ghdl-7359cb0eba5d395062bdb8dd587d09f1db544f05.tar.bz2 ghdl-7359cb0eba5d395062bdb8dd587d09f1db544f05.zip |
synth: extract netlists-folds from netlists-builders.
Diffstat (limited to 'src/synth/netlists-folds.ads')
-rw-r--r-- | src/synth/netlists-folds.ads | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/synth/netlists-folds.ads b/src/synth/netlists-folds.ads new file mode 100644 index 000000000..bd417162f --- /dev/null +++ b/src/synth/netlists-folds.ads @@ -0,0 +1,48 @@ +-- Highler level API to build a netlist - do some optimizations. +-- Copyright (C) 2019 Tristan Gingold +-- +-- This file is part of GHDL. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +-- MA 02110-1301, USA. + +with Netlists.Builders; use Netlists.Builders; + +package Netlists.Folds is + -- Build a const from VAL. Result is either a Const_UB32 or a Const_Bit. + function Build2_Const_Uns (Ctxt : Context_Acc; Val : Uns64; W : Width) + return Net; + + -- Build a const from VAL. Result is either a Const_SB32 or a Const_Bit. + function Build2_Const_Int (Ctxt : Context_Acc; Val : Int64; W : Width) + return Net; + + function Build2_Const_Vec (Ctxt : Context_Acc; W : Width; V : Uns32_Arr) + return Net; + + -- Concatenate nets of ELS in reverse order. So if ELS(L .. R), then + -- ELS(L) will be at offset 0. + function Build2_Concat (Ctxt : Context_Acc; Els : Net_Array) return Net; + + -- Zero extend, noop or truncate I so that its width is W. + function Build2_Uresize (Ctxt : Context_Acc; + I : Net; + W : Width; + Loc : Location_Type := No_Location) + return Net; + -- Same as Build_Extract, but return I iff extract all the bits. + function Build2_Extract + (Ctxt : Context_Acc; I : Net; Off, W : Width) return Net; +end Netlists.Folds; |