Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- Testbench for the
|
-- Testbench for the
|
-- GCpad controller core
|
-- GCpad controller core
|
--
|
--
|
-- $Id: tb.vhd,v 1.3 2004-10-10 17:27:44 arniml Exp $
|
-- $Id: tb.vhd,v 1.4 2004-10-10 20:19:49 arniml Exp $
|
--
|
--
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
--
|
--
|
-- All rights reserved
|
-- All rights reserved
|
--
|
--
|
Line 59... |
Line 59... |
use work.gcpad_comp.gcpad_basic;
|
use work.gcpad_comp.gcpad_basic;
|
use work.gcpad_comp.gcpad_full;
|
use work.gcpad_comp.gcpad_full;
|
|
|
architecture behav of tb is
|
architecture behav of tb is
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Some known commands for the GC controller
|
|
-----------------------------------------------------------------------------
|
|
constant cmd_get_id_c : std_logic_vector(7 downto 0) := "00000000";
|
|
constant cmd_poll_c : std_logic_vector(7 downto 0) := "01000000";
|
|
|
|
|
component gcpad_mod
|
component gcpad_mod
|
generic (
|
generic (
|
clocks_per_1us_g : natural := 2
|
clocks_per_1us_g : natural := 2
|
);
|
);
|
port (
|
port (
|
Line 83... |
Line 90... |
signal stimuli_1_end_s : boolean;
|
signal stimuli_1_end_s : boolean;
|
signal pad_data_1_s : std_logic;
|
signal pad_data_1_s : std_logic;
|
signal buttons_1_s : std_logic_vector(64 downto 0);
|
signal buttons_1_s : std_logic_vector(64 downto 0);
|
signal pad_request_1_s : std_logic;
|
signal pad_request_1_s : std_logic;
|
signal pad_avail_1_s : std_logic;
|
signal pad_avail_1_s : std_logic;
|
signal rx_data_1_s : std_logic_vector(63 downto 0);
|
signal pad_model_data_1_s : std_logic_vector(63 downto 0);
|
|
|
-- signals for full gcpad
|
-- signals for full gcpad
|
signal stimuli_2_end_s : boolean;
|
signal stimuli_2_end_s : boolean;
|
signal pad_data_2_s : std_logic;
|
signal pad_data_2_s : std_logic;
|
signal pad_request_2_s : std_logic;
|
signal pad_request_2_s : std_logic;
|
Line 95... |
Line 102... |
signal pad_timeout_2_s : std_logic;
|
signal pad_timeout_2_s : std_logic;
|
signal tx_size_2_s : std_logic_vector( 1 downto 0);
|
signal tx_size_2_s : std_logic_vector( 1 downto 0);
|
signal tx_command_2_s : std_logic_vector(23 downto 0);
|
signal tx_command_2_s : std_logic_vector(23 downto 0);
|
signal rx_size_2_s : std_logic_vector( 3 downto 0);
|
signal rx_size_2_s : std_logic_vector( 3 downto 0);
|
signal rx_data_2_s : std_logic_vector(63 downto 0);
|
signal rx_data_2_s : std_logic_vector(63 downto 0);
|
|
signal pad_model_data_2_s : std_logic_vector(63 downto 0);
|
|
|
begin
|
begin
|
|
|
basic_b : gcpad_basic
|
basic_b : gcpad_basic
|
generic map (
|
generic map (
|
Line 160... |
Line 168... |
clocks_per_1us_g => clocks_per_1us_c
|
clocks_per_1us_g => clocks_per_1us_c
|
)
|
)
|
port map (
|
port map (
|
clk_i => clk_s,
|
clk_i => clk_s,
|
pad_data_io => pad_data_1_s,
|
pad_data_io => pad_data_1_s,
|
rx_data_i => rx_data_1_s
|
rx_data_i => pad_model_data_1_s
|
);
|
);
|
|
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Process stimuli_pad_1
|
-- Process stimuli_pad_1
|
--
|
--
|
-- Executes test stimuli with Pad 1, the gcpad_basic flavour.
|
-- Executes test stimuli with Pad 1, the gcpad_basic flavour.
|
--
|
--
|
stimuli_pad_1: process
|
stimuli_pad_1: process
|
|
|
|
---------------------------------------------------------------------------
|
procedure send_packet(packet : in std_logic_vector(64 downto 0)) is
|
-- Procedure poll_pad
|
|
--
|
|
-- Requests the status of Pad 1 and checks the received data.
|
|
--
|
|
procedure poll_pad(packet : in std_logic_vector(63 downto 0)) is
|
begin
|
begin
|
wait until clk_s'event and clk_s = '1';
|
wait until clk_s'event and clk_s = '1';
|
wait for 1 ns;
|
wait for 1 ns;
|
|
|
rx_data_1_s <= packet(64 downto 1);
|
pad_model_data_1_s <= packet;
|
|
|
-- send request;
|
-- send request;
|
pad_request_1_s <= '1';
|
pad_request_1_s <= '1';
|
wait for 1 * period_c;
|
wait for 1 * period_c;
|
pad_request_1_s <= '0';
|
pad_request_1_s <= '0';
|
Line 189... |
Line 202... |
|
|
wait until pad_avail_1_s = '1';
|
wait until pad_avail_1_s = '1';
|
wait for 10 * period_c;
|
wait for 10 * period_c;
|
|
|
-- check result
|
-- check result
|
for i in 1 to packet'high loop
|
for i in 0 to packet'high loop
|
assert packet(i) = buttons_1_s(i-1)
|
assert packet(i) = buttons_1_s(i)
|
report "Button mismatch!"
|
report "Button mismatch on Pad 1!"
|
severity error;
|
severity error;
|
end loop;
|
end loop;
|
|
|
end send_packet;
|
end poll_pad;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure timeout_gcpad
|
|
--
|
|
-- Generates a timeout in gcpad_basic by disturbing the communication.
|
|
--
|
procedure timeout_gcpad is
|
procedure timeout_gcpad is
|
begin
|
begin
|
|
wait until clk_s'event and clk_s = '1';
|
|
wait for 1 ns;
|
|
|
-- send request;
|
-- send request;
|
pad_request_1_s <= '1';
|
pad_request_1_s <= '1';
|
wait for 1 * period_c;
|
wait for 1 * period_c;
|
pad_request_1_s <= '0';
|
pad_request_1_s <= '0';
|
|
|
Line 216... |
Line 239... |
wait for 10 * period_c;
|
wait for 10 * period_c;
|
pad_data_1_s <= 'H';
|
pad_data_1_s <= 'H';
|
wait for 10 * period_c;
|
wait for 10 * period_c;
|
|
|
end timeout_gcpad;
|
end timeout_gcpad;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
begin
|
begin
|
stimuli_1_end_s <= false;
|
stimuli_1_end_s <= false;
|
|
|
pad_data_1_s <= 'H';
|
pad_data_1_s <= 'H';
|
pad_request_1_s <= '0';
|
pad_request_1_s <= '0';
|
rx_data_1_s <= (others => '0');
|
pad_model_data_1_s <= (others => '0');
|
|
|
wait until reset_s = '1';
|
wait until reset_s = '1';
|
wait for period_c * 4;
|
wait for period_c * 4;
|
|
|
timeout_gcpad;
|
timeout_gcpad;
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000000");
|
wait for clocks_per_1us_c * 100 * period_c;
|
wait for clocks_per_1us_c * 100 * period_c;
|
send_packet(packet => "00011111111111111111111111111111111111111111111111111111111111111");
|
poll_pad(packet => "0001111111111111111111111111111111111111111111111111111111111111");
|
send_packet(packet => "00010000100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0001000010000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00001000100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000100010000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000100100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000010010000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000010100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000001010000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000001100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000110000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00001010101010101010101010101010101010101010101010101010101010101");
|
poll_pad(packet => "0000101010101010101010101010101010101010101010101010101010101010");
|
send_packet(packet => "00010101110101010101010101010101010101010101010101010101010101011");
|
poll_pad(packet => "0001010111010101010101010101010101010101010101010101010101010101");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000110000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000011000000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000101000000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010100000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100100000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010010000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100010000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010001000000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100001000000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000100000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000100000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000010000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000010000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000001000000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000001000000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000100000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000100000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000010000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000010000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000001000000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000001000000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000100000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000100000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000010000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000010000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000001000000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000001000000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000100000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000100000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000010000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000010000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000001000000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000001000000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000100000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000100000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000010000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000010000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000001000000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000001000000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000100000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000100000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000010000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000010000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000001000000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000001000000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000100000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000100000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000010000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000010000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000001000000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000001000000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000100000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000100000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000010000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000010000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000001000000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000001000000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000100000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000100000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000010000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000010000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000001000000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000001000000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000100000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000100000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000010000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000010000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000001000000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000001000000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000100000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000100000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000010000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000010000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000001000000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000001000000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000100000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000100000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000010000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000010000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000001000000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000001000000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000100000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000100000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000010000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000010000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000001000000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000001000000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000100000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000100000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000010000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000010000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000001000000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000001000000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000100000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000100000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000010000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000010000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000001000000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000001000001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000100000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000100001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000010000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000010001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000001000");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000001001");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000100");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000000101");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000010");
|
send_packet(packet => "00000000100000000000000000000000000000000000000000000000000000011");
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000001");
|
|
|
|
|
wait for period_c * 2*40;
|
wait for period_c * 2*40;
|
stimuli_1_end_s <= true;
|
stimuli_1_end_s <= true;
|
wait;
|
wait;
|
Line 312... |
Line 337... |
clocks_per_1us_g => clocks_per_1us_c
|
clocks_per_1us_g => clocks_per_1us_c
|
)
|
)
|
port map (
|
port map (
|
clk_i => clk_s,
|
clk_i => clk_s,
|
pad_data_io => pad_data_2_s,
|
pad_data_io => pad_data_2_s,
|
rx_data_i => rx_data_2_s
|
rx_data_i => pad_model_data_2_s
|
);
|
);
|
|
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Process stimuli_pad_2
|
-- Process stimuli_pad_2
|
--
|
--
|
-- Executes test stimuli with Pad 2, the gcpad_full flavour.
|
-- Executes test stimuli with Pad 2, the gcpad_full flavour.
|
--
|
--
|
stimuli_pad_2: process
|
stimuli_pad_2: process
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure issue_command
|
|
--
|
|
-- Sets the transmitter command for Pad 2 and starts the request.
|
|
--
|
procedure issue_command(cmd : in std_logic_vector(23 downto 0);
|
procedure issue_command(cmd : in std_logic_vector(23 downto 0);
|
size : in std_logic_vector( 1 downto 0)) is
|
size : in std_logic_vector( 1 downto 0)) is
|
begin
|
begin
|
wait until clk_s'event and clk_s = '1';
|
wait until clk_s'event and clk_s = '1';
|
wait for 1 ns;
|
wait for 1 ns;
|
Line 335... |
Line 366... |
-- send request;
|
-- send request;
|
pad_request_2_s <= '1';
|
pad_request_2_s <= '1';
|
wait for 1 * period_c;
|
wait for 1 * period_c;
|
pad_request_2_s <= '0';
|
pad_request_2_s <= '0';
|
|
|
|
|
end issue_command;
|
end issue_command;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure poll_pad
|
|
--
|
|
-- Requests the status of Pad 2 and checks the received data.
|
|
--
|
|
procedure poll_pad(packet : in std_logic_vector(63 downto 0)) is
|
|
variable cmd_v : std_logic_vector(23 downto 0);
|
|
begin
|
|
wait until clk_s'event and clk_s = '1';
|
|
wait for 1 ns;
|
|
|
|
-- set up model answer
|
|
pad_model_data_2_s <= packet;
|
|
-- set expected number of bytes for gcpad_full
|
|
rx_size_2_s <= "1000";
|
|
|
|
cmd_v(23 downto 16) := cmd_poll_c;
|
|
cmd_v(15 downto 0) := "0000001100000010";
|
|
issue_command(cmd => cmd_v,
|
|
size => "11");
|
|
|
|
wait until pad_avail_2_s = '1';
|
|
|
|
assert pad_timeout_2_s = '0'
|
|
report "Timout signalled on Pad 2 during status polling!"
|
|
severity error;
|
|
|
|
-- check result
|
|
for i in 0 to packet'high loop
|
|
assert packet(i) = rx_data_2_s(i)
|
|
report "Data mismatch on Pad 2!"
|
|
severity error;
|
|
end loop;
|
|
|
|
end poll_pad;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure timeout_gcpad_x
|
|
--
|
|
-- Generates a timeout in gcpad_full by disturbing the communication.
|
|
--
|
|
procedure timeout_gcpad_x is
|
|
variable cmd_v : std_logic_vector(23 downto 0);
|
|
begin
|
|
wait until clk_s'event and clk_s = '1';
|
|
wait for 1 ns;
|
|
|
|
pad_model_data_2_s <= (others => '0');
|
|
rx_size_2_s <= "1000";
|
|
|
|
|
|
cmd_v(23 downto 16) := cmd_poll_c;
|
|
cmd_v(15 downto 0) := "0000001100000010";
|
|
issue_command(cmd => cmd_v,
|
|
size => "11");
|
|
|
|
-- disturb communication
|
|
pad_data_2_s <= 'X';
|
|
|
|
wait until pad_avail_1_s = '1';
|
|
wait for 10 * period_c;
|
|
pad_data_2_s <= 'H';
|
|
wait for 10 * period_c;
|
|
|
|
assert pad_timeout_2_s = '1'
|
|
report "No timeout indicated on Pad 2 when communication has been disturbed!"
|
|
severity error;
|
|
|
|
end timeout_gcpad_x;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure timeout_gcpad_short
|
|
--
|
|
-- Generates a timeout in gcpad_full by requesting too many bytes for
|
|
-- a "get id" command.
|
|
--
|
|
procedure timeout_gcpad_short is
|
|
variable cmd_v : std_logic_vector(23 downto 0);
|
|
begin
|
|
wait until clk_s'event and clk_s = '1';
|
|
wait for 1 ns;
|
|
|
|
-- expect too many number of bytes
|
|
-- command is "get id", will yield 3 bytes, but 8 bytes are requested
|
|
rx_size_2_s <= "1000";
|
|
|
|
|
|
cmd_v(23 downto 16) := cmd_get_id_c;
|
|
cmd_v(15 downto 0) := (others => '1');
|
|
issue_command(cmd => cmd_v,
|
|
size => "01");
|
|
|
|
wait until pad_avail_2_s = '1';
|
|
|
|
assert pad_timeout_2_s = '1'
|
|
report "No timout indicated on Pad 2 when too many bytes requested!"
|
|
severity error;
|
|
|
|
end timeout_gcpad_short;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
-- Procedure get_id
|
|
--
|
|
-- Requests the ID information from the GC controller model.
|
|
--
|
|
procedure get_id is
|
|
variable cmd_v : std_logic_vector(23 downto 0);
|
|
constant id_c : std_logic_vector(23 downto 0) := "000010010000000000000000";
|
|
begin
|
|
wait until clk_s'event and clk_s = '1';
|
|
wait for 1 ns;
|
|
|
|
rx_size_2_s <= "0011";
|
|
|
|
|
|
cmd_v(23 downto 16) := cmd_get_id_c;
|
|
cmd_v(15 downto 0) := (others => '1');
|
|
issue_command(cmd => cmd_v,
|
|
size => "01");
|
|
|
|
wait until pad_avail_2_s = '1';
|
|
|
|
assert pad_timeout_2_s = '0'
|
|
report "Timout signalled on Pad 2 during get id!"
|
|
severity error;
|
|
|
|
-- check result
|
|
for i in 0 to id_c'high loop
|
|
assert id_c(i) = rx_data_2_s(i)
|
|
report "ID mismatch on Pad 2!"
|
|
severity error;
|
|
end loop;
|
|
|
|
end get_id;
|
|
--
|
|
---------------------------------------------------------------------------
|
|
|
begin
|
begin
|
stimuli_2_end_s <= false;
|
stimuli_2_end_s <= false;
|
|
|
pad_data_2_s <= 'H';
|
pad_data_2_s <= 'H';
|
pad_request_2_s <= '0';
|
pad_request_2_s <= '0';
|
tx_size_2_s <= (others => '0');
|
tx_size_2_s <= (others => '0');
|
tx_command_2_s <= (others => '0');
|
tx_command_2_s <= (others => '0');
|
rx_size_2_s <= (others => '0');
|
rx_size_2_s <= (others => '0');
|
|
pad_model_data_2_s <= (others => '0');
|
|
|
wait until reset_s = '1';
|
wait until reset_s = '1';
|
wait for period_c * 4;
|
wait for period_c * 4;
|
|
|
|
|
issue_command(cmd => "010000000000001100000010",
|
get_id;
|
size => "11");
|
timeout_gcpad_x;
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000000");
|
|
wait for clocks_per_1us_c * 100 * period_c;
|
|
poll_pad(packet => "0001111111111111111111111111111111111111111111111111111111111111");
|
|
timeout_gcpad_short;
|
|
poll_pad(packet => "0001000010000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000100010000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000010010000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000001010000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000110000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000101010101010101010101010101010101010101010101010101010101010");
|
|
poll_pad(packet => "0001010111010101010101010101010101010101010101010101010101010101");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000011000000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010100000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010010000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010001000000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000100000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000010000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000001000000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000100000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000010000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000001000000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000100000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000010000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000001000000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000100000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000010000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000001000000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000100000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000010000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000001000000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000100000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000010000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000001000000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000100000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000010000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000001000000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000100000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000010000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000001000000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000100000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000010000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000001000000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000100000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000010000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000001000000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000100000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000010000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000001000000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000100000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000010000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000001000000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000100000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000010000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000001000000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000100000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000010000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000001000000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000100000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000010000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000001000000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000100000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000010000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000001000");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000100");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000010");
|
|
poll_pad(packet => "0000000010000000000000000000000000000000000000000000000000000001");
|
|
|
|
|
wait for period_c * 2*40;
|
wait for period_c * 2*40;
|
stimuli_2_end_s <= true;
|
stimuli_2_end_s <= true;
|
wait;
|
wait;
|
Line 414... |
Line 661... |
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File History:
|
-- File History:
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.3 2004/10/10 17:27:44 arniml
|
|
-- added second pad
|
|
-- introduced testbench model for GC controller
|
|
--
|
-- Revision 1.2 2004/10/09 17:05:59 arniml
|
-- Revision 1.2 2004/10/09 17:05:59 arniml
|
-- delay assertion of request signal by real time (instead of delta cycles)
|
-- delay assertion of request signal by real time (instead of delta cycles)
|
--
|
--
|
-- Revision 1.1 2004/10/07 21:24:06 arniml
|
-- Revision 1.1 2004/10/07 21:24:06 arniml
|
-- initial check-in
|
-- initial check-in
|