Move the VHDL support package

This commit is contained in:
Nick Gasson 2008-07-07 15:36:13 +01:00
parent 4db5b9d7ed
commit 7f955cc070
2 changed files with 41 additions and 15 deletions

View File

@ -0,0 +1,41 @@
--
-- Support routines for Icarus Verilog VHDL output
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package Verilog_Support is
-- This routine implements $finish by terminating the simulation
-- It is implemented via the VHPI interface
procedure finish;
attribute foreign of finish : procedure is "VHPIDIRECT finish";
-- Routines to implement Verilog reduction operators
function Reduce_OR(X : unsigned) return std_logic;
end Verilog_Support;
package body Verilog_Support is
-- This is a dummy body to provide a default implementation
-- if VHPI is not supported
procedure finish is
begin
assert false severity failure;
end finish;
function Reduce_OR(X : unsigned) return std_logic is
begin
for I in X'range loop
if X(I) /= '1' then
return '0';
end if;
end loop;
return '1';
end function;
end Verilog_Support;

View File

@ -1,15 +0,0 @@
--
-- VHPI support routines for VHDL output.
--
package Verilog_Support is
procedure finish;
attribute foreign of finish : procedure is "VHPIDIRECT finish";
end Verilog_Support;
package body Verilog_Support is
procedure finish is
begin
assert false severity failure;
end finish;
end Verilog_Support;