diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-01 18:19:58 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-01 18:20:50 +0200 |
commit | 5e0504706780c0a803382b2722f30ef790d106b3 (patch) | |
tree | cb1157461fe659081f417234124b1780fc05f653 /src | |
parent | fa2d17a019c850e7d8d29783a0303850f5f0fee5 (diff) | |
download | ghdl-5e0504706780c0a803382b2722f30ef790d106b3.tar.gz ghdl-5e0504706780c0a803382b2722f30ef790d106b3.tar.bz2 ghdl-5e0504706780c0a803382b2722f30ef790d106b3.zip |
synth: add types_utils package.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-builders.adb | 1 | ||||
-rw-r--r-- | src/synth/synth-expr.adb | 4 | ||||
-rw-r--r-- | src/synth/types_utils.ads | 29 |
3 files changed, 31 insertions, 3 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb index 20626b2c3..462402948 100644 --- a/src/synth/netlists-builders.adb +++ b/src/synth/netlists-builders.adb @@ -18,6 +18,7 @@ -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. +with Types_Utils; use Types_Utils; with Name_Table; use Name_Table; with Std_Names; use Std_Names; diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index f48d881e8..0c7b636b4 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -20,6 +20,7 @@ with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; +with Types_Utils; use Types_Utils; with Std_Names; with Str_Table; with Vhdl.Ieee.Std_Logic_1164; @@ -943,9 +944,6 @@ package body Synth.Expr is end case; end Is_Const; - function To_Int32 is new Ada.Unchecked_Conversion - (Uns32, Int32); - function Get_Const (N : Net) return Int32 is Inst : constant Instance := Get_Parent (N); diff --git a/src/synth/types_utils.ads b/src/synth/types_utils.ads new file mode 100644 index 000000000..27245e7d5 --- /dev/null +++ b/src/synth/types_utils.ads @@ -0,0 +1,29 @@ +-- Utils for common types. +-- Copyright (C) 2019 Tristan Gingold +-- +-- GHDL 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, or (at your option) any later +-- version. +-- +-- GHDL 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 GHDL; see the file COPYING. If not, write to the Free +-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA +-- 02111-1307, USA. + +with Ada.Unchecked_Conversion; + +with Types; use Types; + +package Types_Utils is + function To_Int32 is new Ada.Unchecked_Conversion + (Uns32, Int32); + + function To_Uns32 is new Ada.Unchecked_Conversion + (Int32, Uns32); +end Types_Utils; |