diff options
author | Tristan Gingold | 2014-06-30 02:40:31 +0200 |
---|---|---|
committer | Tristan Gingold | 2014-06-30 02:40:31 +0200 |
commit | d6f65268ff859a80667978af2d4f4f1623ff6c66 (patch) | |
tree | d7dcf93413083cf2265342be0675736bcd5e8225 /libraries | |
parent | f2ece9d895747a95453add597cad3e6d6b1cd2f2 (diff) | |
download | ghdl-d6f65268ff859a80667978af2d4f4f1623ff6c66.tar.gz ghdl-d6f65268ff859a80667978af2d4f4f1623ff6c66.tar.bz2 ghdl-d6f65268ff859a80667978af2d4f4f1623ff6c66.zip |
Add many vhdl08 predefined operators and functions. Add std.env
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/Makefile.inc | 2 | ||||
-rw-r--r-- | libraries/std/env.vhdl | 28 | ||||
-rw-r--r-- | libraries/std/env_body.vhdl | 65 |
3 files changed, 94 insertions, 1 deletions
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc index fed7457..5d1cc76 100644 --- a/libraries/Makefile.inc +++ b/libraries/Makefile.inc @@ -70,7 +70,7 @@ ieee2008/fixed_pkg.vhdl STD87_BSRCS := $(STD_SRCS:.vhdl=.v87) STD93_BSRCS := $(STD_SRCS:.vhdl=.v93) -STD08_BSRCS := $(STD_SRCS:.vhdl=.v08) +STD08_BSRCS := $(STD_SRCS:.vhdl=.v08) std/env.vhdl std/env_body.vhdl IEEE87_BSRCS := $(IEEE_SRCS:.vhdl=.v87) IEEE93_BSRCS := $(IEEE_SRCS:.vhdl=.v93) $(MATH_SRCS) SYNOPSYS87_BSRCS := $(SYNOPSYS_BSRCS) diff --git a/libraries/std/env.vhdl b/libraries/std/env.vhdl new file mode 100644 index 0000000..35cbb02 --- /dev/null +++ b/libraries/std/env.vhdl @@ -0,0 +1,28 @@ +-- Std.Env package declaration. This file is part of GHDL. +-- This file was written from the clause 14.3 of the VHDL LRM. +-- Copyright (C) 2014 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. + +package Env is + procedure Stop (Status : Integer); + procedure Stop; + + procedure Finish (status : Integer); + procedure Finish; + + function Resolution_Limit return Delay_Length; +end package Env; diff --git a/libraries/std/env_body.vhdl b/libraries/std/env_body.vhdl new file mode 100644 index 0000000..d36519f --- /dev/null +++ b/libraries/std/env_body.vhdl @@ -0,0 +1,65 @@ +-- Std.Env package declaration. This file is part of GHDL. +-- This file was written from the clause 14.3 of the VHDL LRM. +-- Copyright (C) 2014 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. + +package body Env is + procedure control_simulation (Is_Stop : Boolean; + Has_Status : Boolean; + Status : Integer); + attribute foreign of control_simulation : procedure is "GHDL intrinsic"; + + procedure control_simulation (Is_Stop : Boolean; + Has_Status : Boolean; + Status : Integer) is + begin + assert false report "must not be called" severity failure; + end control_simulation; + + procedure Stop (Status : Integer) is + begin + control_simulation (True, True, Status); + end Stop; + + procedure Stop is + begin + control_simulation (True, False, -1); + end Stop; + + procedure Finish (status : integer) is + begin + control_simulation (False, True, Status); + end Finish; + + procedure Finish is + begin + control_simulation (False, False, -1); + end Finish; + + function Get_Resolution_Limit return Delay_Length; + attribute foreign of Get_Resolution_Limit : function is "GHDL intrinsic"; + + function Get_Resolution_Limit return Delay_Length is + begin + assert false report "must not be called" severity failure; + end Get_Resolution_Limit; + + function Resolution_Limit return Delay_Length is + begin + return Get_Resolution_Limit; + end Resolution_Limit; +end package body Env; |