-- $Author: rpaley_yid $
|
-- $Author: rpaley_yid $
|
-- $Date: 2003-01-14 21:48:11 $
|
-- $Date: 2003-01-14 21:48:11 $
|
-- $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/single_port/VHDL/tb_single_port.vhd,v 1.1.1.1 2003-01-14 21:48:11 rpaley_yid Exp $
|
-- $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/single_port/VHDL/tb_single_port.vhd,v 1.1.1.1 2003-01-14 21:48:11 rpaley_yid Exp $
|
-- $Locker
|
-- $Locker
|
-- $Revision: 1.1.1.1 $
|
-- $Revision: 1.1.1.1 $
|
-- $State: Exp $
|
-- $State: Exp $
|
|
|
-- --------------------------------------------------------------------------
|
-- --------------------------------------------------------------------------
|
--
|
--
|
-- Purpose: This file specifies test bench harness for the single_port
|
-- Purpose: This file specifies test bench harness for the single_port
|
-- Memory. It also contains the configuration files for all the
|
-- Memory. It also contains the configuration files for all the
|
-- tests.
|
-- tests.
|
--
|
--
|
--
|
--
|
-- References:
|
-- References:
|
-- 1. The Designer's Guide to VHDL by Peter Ashenden
|
-- 1. The Designer's Guide to VHDL by Peter Ashenden
|
-- ISBN: 1-55860-270-4 (pbk.)
|
-- ISBN: 1-55860-270-4 (pbk.)
|
-- 2. Writing Testbenches - Functional Verification of HDL models by
|
-- 2. Writing Testbenches - Functional Verification of HDL models by
|
-- Janick Bergeron | ISBN: 0-7923-7766-4
|
-- Janick Bergeron | ISBN: 0-7923-7766-4
|
--
|
--
|
-- Notes:
|
-- Notes:
|
--
|
--
|
-- --------------------------------------------------------------------------
|
-- --------------------------------------------------------------------------
|
LIBRARY IEEE;
|
LIBRARY IEEE;
|
LIBRARY WORK;
|
LIBRARY WORK;
|
USE IEEE.STD_LOGIC_1164.ALL;
|
USE IEEE.STD_LOGIC_1164.ALL;
|
USE IEEE.NUMERIC_STD.ALL;
|
USE IEEE.NUMERIC_STD.ALL;
|
USE WORK.linked_list_mem_pkg.ALL;
|
USE WORK.linked_list_mem_pkg.ALL;
|
USE WORK.single_port_pkg.all;
|
USE WORK.single_port_pkg.all;
|
USE STD.TEXTIO.ALL;
|
USE STD.TEXTIO.ALL;
|
|
|
ENTITY tb_single_port IS
|
ENTITY tb_single_port IS
|
END ENTITY tb_single_port;
|
END ENTITY tb_single_port;
|
|
|
ARCHITECTURE BHV of tb_single_port IS
|
ARCHITECTURE BHV of tb_single_port IS
|
|
|
COMPONENT single_port IS
|
COMPONENT single_port IS
|
GENERIC (
|
GENERIC (
|
rnwtQ : TIME := 1 NS
|
rnwtQ : TIME := 1 NS
|
);
|
);
|
PORT (
|
PORT (
|
d : IN data_inter_typ;
|
d : IN data_inter_typ;
|
q : OUT data_inter_typ;
|
q : OUT data_inter_typ;
|
a : IN addr_inter_typ;
|
a : IN addr_inter_typ;
|
rnw : IN STD_LOGIC;
|
rnw : IN STD_LOGIC;
|
dealloc_mem : BOOLEAN
|
dealloc_mem : BOOLEAN
|
);
|
);
|
END COMPONENT single_port;
|
END COMPONENT single_port;
|
|
|
COMPONENT tc_single_port IS
|
COMPONENT tc_single_port IS
|
PORT (
|
PORT (
|
to_srv : OUT to_srv_typ;
|
to_srv : OUT to_srv_typ;
|
frm_srv : IN frm_srv_typ
|
frm_srv : IN frm_srv_typ
|
);
|
);
|
END COMPONENT tc_single_port;
|
END COMPONENT tc_single_port;
|
|
|
SIGNAL d : data_inter_typ;
|
SIGNAL d : data_inter_typ;
|
SIGNAL q : data_inter_typ;
|
SIGNAL q : data_inter_typ;
|
SIGNAL a : addr_inter_typ;
|
SIGNAL a : addr_inter_typ;
|
SIGNAL rnw : STD_LOGIC;
|
SIGNAL rnw : STD_LOGIC;
|
SIGNAL dealloc_mem : BOOLEAN;
|
SIGNAL dealloc_mem : BOOLEAN;
|
SIGNAL to_srv : to_srv_typ;
|
SIGNAL to_srv : to_srv_typ;
|
SIGNAL frm_srv : frm_srv_typ;
|
SIGNAL frm_srv : frm_srv_typ;
|
SIGNAL tie_vdd : STD_LOGIC := '1';
|
SIGNAL tie_vdd : STD_LOGIC := '1';
|
BEGIN
|
BEGIN
|
dut : single_port
|
dut : single_port
|
PORT MAP (
|
PORT MAP (
|
d => d,
|
d => d,
|
a => a,
|
a => a,
|
q => q,
|
q => q,
|
rnw => rnw,
|
rnw => rnw,
|
dealloc_mem => dealloc_mem
|
dealloc_mem => dealloc_mem
|
);
|
);
|
|
|
tc : tc_single_port
|
tc : tc_single_port
|
PORT MAP (
|
PORT MAP (
|
to_srv => to_srv,
|
to_srv => to_srv,
|
frm_srv => frm_srv
|
frm_srv => frm_srv
|
);
|
);
|
|
|
single_port_server : PROCESS
|
single_port_server : PROCESS
|
VARIABLE frm_srv_v : frm_srv_typ;
|
VARIABLE frm_srv_v : frm_srv_typ;
|
CONSTANT ACCESS_DELAY : TIME := 5 NS;
|
CONSTANT ACCESS_DELAY : TIME := 5 NS;
|
BEGIN
|
BEGIN
|
-- Wait until the test case is finished setting up the next memory access.
|
-- Wait until the test case is finished setting up the next memory access.
|
WAIT ON to_srv'TRANSACTION;
|
WAIT ON to_srv'TRANSACTION;
|
CASE to_srv.do IS
|
CASE to_srv.do IS
|
WHEN init =>
|
WHEN init =>
|
ASSERT FALSE
|
ASSERT FALSE
|
REPORT "initialized"
|
REPORT "initialized"
|
SEVERITY NOTE;
|
SEVERITY NOTE;
|
WHEN read => -- perform memory read
|
WHEN read => -- perform memory read
|
d <= to_srv.data;
|
d <= to_srv.data;
|
a <= to_srv.addr;
|
a <= to_srv.addr;
|
rnw <= '1';
|
rnw <= '1';
|
-- Wait for data to appear
|
-- Wait for data to appear
|
WAIT FOR ACCESS_DELAY;
|
WAIT FOR ACCESS_DELAY;
|
WHEN write => -- perform memory write
|
WHEN write => -- perform memory write
|
d <= to_srv.data;
|
d <= to_srv.data;
|
a <= to_srv.addr;
|
a <= to_srv.addr;
|
rnw <= '0';
|
rnw <= '0';
|
WAIT FOR ACCESS_DELAY;
|
WAIT FOR ACCESS_DELAY;
|
WHEN dealloc => -- deallocate the linked list for the LL architecture
|
WHEN dealloc => -- deallocate the linked list for the LL architecture
|
dealloc_mem <= true;
|
dealloc_mem <= true;
|
WHEN end_test => -- reached the end of the test case
|
WHEN end_test => -- reached the end of the test case
|
WAIT;
|
WAIT;
|
END CASE;
|
END CASE;
|
frm_srv_v.data := q;
|
frm_srv_v.data := q;
|
-- Send message to test case to continue the test.
|
-- Send message to test case to continue the test.
|
frm_srv <= frm_srv_v ; WAIT FOR 0 NS;
|
frm_srv <= frm_srv_v ; WAIT FOR 0 NS;
|
END PROCESS single_port_server;
|
END PROCESS single_port_server;
|
END BHV;
|
END BHV;
|
|
|
CONFIGURATION ll_main_cfg OF TB_SINGLE_PORT IS
|
CONFIGURATION ll_main_cfg OF TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(LinkedList);
|
USE ENTITY work.single_port(LinkedList);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC0);
|
USE ENTITY work.tc_single_port(TC0);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION ll_main_cfg;
|
END CONFIGURATION ll_main_cfg;
|
|
|
CONFIGURATION ll_error_cfg OF TB_SINGLE_PORT IS
|
CONFIGURATION ll_error_cfg OF TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(LinkedList);
|
USE ENTITY work.single_port(LinkedList);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC1);
|
USE ENTITY work.tc_single_port(TC1);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION ll_error_cfg ;
|
END CONFIGURATION ll_error_cfg ;
|
|
|
CONFIGURATION mem_main_cfg of TB_SINGLE_PORT IS
|
CONFIGURATION mem_main_cfg of TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(ArrayMem);
|
USE ENTITY work.single_port(ArrayMem);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC0);
|
USE ENTITY work.tc_single_port(TC0);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION mem_main_cfg;
|
END CONFIGURATION mem_main_cfg;
|
|
|
CONFIGURATION mem_error_cfg of TB_SINGLE_PORT IS
|
CONFIGURATION mem_error_cfg of TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(ArrayMem);
|
USE ENTITY work.single_port(ArrayMem);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC1);
|
USE ENTITY work.tc_single_port(TC1);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION mem_error_cfg;
|
END CONFIGURATION mem_error_cfg;
|
|
|
CONFIGURATION memnoflag_main_cfg of TB_SINGLE_PORT IS
|
CONFIGURATION memnoflag_main_cfg of TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(ArrayMemNoFlag);
|
USE ENTITY work.single_port(ArrayMemNoFlag);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC0);
|
USE ENTITY work.tc_single_port(TC0);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION memnoflag_main_cfg;
|
END CONFIGURATION memnoflag_main_cfg;
|
|
|
CONFIGURATION memnoflag_error_cfg of TB_SINGLE_PORT IS
|
CONFIGURATION memnoflag_error_cfg of TB_SINGLE_PORT IS
|
FOR BHV
|
FOR BHV
|
FOR dut : single_port
|
FOR dut : single_port
|
USE ENTITY work.single_port(ArrayMemNoFlag);
|
USE ENTITY work.single_port(ArrayMemNoFlag);
|
END FOR; -- dut
|
END FOR; -- dut
|
FOR tc : tc_single_port
|
FOR tc : tc_single_port
|
USE ENTITY work.tc_single_port(TC1);
|
USE ENTITY work.tc_single_port(TC1);
|
END FOR; -- tc;
|
END FOR; -- tc;
|
END FOR; -- BHV
|
END FOR; -- BHV
|
END CONFIGURATION memnoflag_error_cfg;
|
END CONFIGURATION memnoflag_error_cfg;
|
|
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
-- Revision 1.1 2003/01/14 17:49:04 Default
|
-- Revision 1.1 2003/01/14 17:49:04 Default
|
-- Initial revision
|
-- Initial revision
|
--
|
--
|
-- Revision 1.2 2002/12/31 19:19:43 Default
|
-- Revision 1.2 2002/12/31 19:19:43 Default
|
-- Updated 'transaction statements for fixed simulator.
|
-- Updated 'transaction statements for fixed simulator.
|
--
|
--
|
-- Revision 1.1 2002/12/24 18:10:18 Default
|
-- Revision 1.1 2002/12/24 18:10:18 Default
|
-- Initial revision
|
-- Initial revision
|
--
|
--
|
|
|
|
|
|
|