-- $Id: iob_keeper_gen.vhd 314 2010-07-09 17:38:41Z mueller $
|
-- $Id: iob_keeper_gen.vhd 314 2010-07-09 17:38:41Z mueller $
|
--
|
--
|
-- Copyright 2010- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2010- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
--
|
--
|
-- This program is free software; you may redistribute and/or modify it under
|
-- This program is free software; you may redistribute and/or modify it under
|
-- the terms of the GNU General Public License as published by the Free
|
-- 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.
|
-- Software Foundation, either version 2, or at your option any later version.
|
--
|
--
|
-- This program is distributed in the hope that it will be useful, but
|
-- This program is distributed in the hope that it will be useful, but
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- for complete details.
|
-- for complete details.
|
--
|
--
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Module Name: iob_keeper_gen - sim
|
-- Module Name: iob_keeper_gen - sim
|
-- Description: keeper for IOB, vector
|
-- Description: keeper for IOB, vector
|
--
|
--
|
-- Dependencies: -
|
-- Dependencies: -
|
-- Test bench: -
|
-- Test bench: -
|
-- Target Devices: generic Spartan, Virtex
|
-- Target Devices: generic Spartan, Virtex
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
-- 2010-06-03 299 1.1 add explicit R_KEEP and driver
|
-- 2010-06-03 299 1.1 add explicit R_KEEP and driver
|
-- 2008-05-22 148 1.0 Initial version
|
-- 2008-05-22 148 1.0 Initial version
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
|
|
use work.slvtypes.all;
|
use work.slvtypes.all;
|
use work.xlib.all;
|
use work.xlib.all;
|
|
|
entity iob_keeper_gen is -- keeper for IOB, vector
|
entity iob_keeper_gen is -- keeper for IOB, vector
|
generic (
|
generic (
|
DWIDTH : positive := 16); -- data port width
|
DWIDTH : positive := 16); -- data port width
|
port (
|
port (
|
PAD : inout slv(DWIDTH-1 downto 0) -- i/o pad
|
PAD : inout slv(DWIDTH-1 downto 0) -- i/o pad
|
);
|
);
|
end iob_keeper_gen;
|
end iob_keeper_gen;
|
|
|
-- Is't possible to directly use 'PAD<='H' in proc_pad. Introduced R_KEEP and
|
-- Is't possible to directly use 'PAD<='H' in proc_pad. Introduced R_KEEP and
|
-- the explicit driver 'PAD<=R_KEEP' to state the keeper function more clearly.
|
-- the explicit driver 'PAD<=R_KEEP' to state the keeper function more clearly.
|
|
|
architecture sim of iob_keeper_gen is
|
architecture sim of iob_keeper_gen is
|
signal R_KEEP : slv(DWIDTH-1 downto 0) := (others=>'W');
|
signal R_KEEP : slv(DWIDTH-1 downto 0) := (others=>'W');
|
begin
|
begin
|
|
|
proc_keep: process (PAD)
|
proc_keep: process (PAD)
|
begin
|
begin
|
for i in PAD'range loop
|
for i in PAD'range loop
|
if PAD(i) = '1' then
|
if PAD(i) = '1' then
|
R_KEEP(i) <= 'H';
|
R_KEEP(i) <= 'H';
|
elsif PAD(i) = '0' then
|
elsif PAD(i) = '0' then
|
R_KEEP(i) <= 'L';
|
R_KEEP(i) <= 'L';
|
elsif PAD(i)='X' or PAD(i)='U' then
|
elsif PAD(i)='X' or PAD(i)='U' then
|
R_KEEP(i) <= 'W';
|
R_KEEP(i) <= 'W';
|
end if;
|
end if;
|
end loop;
|
end loop;
|
PAD <= R_KEEP;
|
PAD <= R_KEEP;
|
end process proc_keep;
|
end process proc_keep;
|
|
|
end sim;
|
end sim;
|
|
|