diff options
author | Tristan Gingold | 2015-12-03 21:04:42 +0100 |
---|---|---|
committer | Tristan Gingold | 2015-12-16 09:35:28 +0100 |
commit | 8d5c9a328a7285c5457bf8fdfcb403b87db1e263 (patch) | |
tree | 8b9898f2f82b1413040472476174e5ea7644064b /src | |
parent | 8cc62e1063ed2ba035e9ca7ed7667c8fca319e6b (diff) | |
download | ghdl-8d5c9a328a7285c5457bf8fdfcb403b87db1e263.tar.gz ghdl-8d5c9a328a7285c5457bf8fdfcb403b87db1e263.tar.bz2 ghdl-8d5c9a328a7285c5457bf8fdfcb403b87db1e263.zip |
openieee: add numeric_std and numeric_bit.
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/foreigns.adb | 38 | ||||
-rw-r--r-- | src/ghdldrv/foreigns.ads | 17 |
2 files changed, 54 insertions, 1 deletions
diff --git a/src/ghdldrv/foreigns.adb b/src/ghdldrv/foreigns.adb index 15e3dd0..0d6b19a 100644 --- a/src/ghdldrv/foreigns.adb +++ b/src/ghdldrv/foreigns.adb @@ -1,9 +1,41 @@ +-- GHDL driver - Foreign functions known by JIT. +-- Copyright (C) 2002 - 2015 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 GCC; see the file COPYING. If not, write to the Free +-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA +-- 02111-1307, USA. with Interfaces.C; use Interfaces.C; package body Foreigns is + function Ceil (Arg : double) return double; + pragma Import (C, Ceil); + + function Floor (Arg : double) return double; + pragma Import (C, Floor); + + function Round (Arg : double) return double; + pragma Import (C, Round); + + function Trunc (Arg : double) return double; + pragma Import (C, Trunc); + function Sin (Arg : double) return double; pragma Import (C, Sin); + function Cos (Arg : double) return double; + pragma Import (C, Cos); + function Log (Arg : double) return double; pragma Import (C, Log); @@ -37,10 +69,14 @@ package body Foreigns is Addr : Address; end record; - Foreign_Arr : constant array (Natural range <>) of Foreign_Record := ( + (new String'("ceil"), Ceil'Address), + (new String'("floor"), Floor'Address), + (new String'("round"), Round'Address), + (new String'("trunc"), Trunc'Address), (new String'("sin"), Sin'Address), + (new String'("cos"), Cos'Address), (new String'("log"), Log'Address), (new String'("exp"), Exp'Address), (new String'("sqrt"), Sqrt'Address), diff --git a/src/ghdldrv/foreigns.ads b/src/ghdldrv/foreigns.ads index 5759ae4..1598311 100644 --- a/src/ghdldrv/foreigns.ads +++ b/src/ghdldrv/foreigns.ads @@ -1,3 +1,20 @@ +-- GHDL driver - Foreign functions known by JIT. +-- Copyright (C) 2002 - 2015 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 GCC; see the file COPYING. If not, write to the Free +-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA +-- 02111-1307, USA. with System; use System; package Foreigns is |