-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- RapidIO IP Library Core
|
-- RapidIO IP Library Core
|
--
|
--
|
-- This file is part of the RapidIO IP library project
|
-- This file is part of the RapidIO IP library project
|
-- http://www.opencores.org/cores/rio/
|
-- http://www.opencores.org/cores/rio/
|
--
|
--
|
-- Description
|
-- Description
|
-- Contains automatic simulation test code to verify a RioSwitch implementation.
|
-- Contains automatic simulation test code to verify a RioSwitch implementation.
|
--
|
--
|
-- To Do:
|
-- To Do:
|
-- -
|
-- - Use the Wishbone port as a test port on the implementation defined config-space.
|
|
-- - Test all sizes of packets that go through the maintenance port.
|
--
|
--
|
-- Author(s):
|
-- Author(s):
|
-- - Magnus Rosenius, magro732@opencores.org
|
-- - Magnus Rosenius, magro732@opencores.org
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- Copyright (C) 2013 Authors and OPENCORES.ORG
|
-- Copyright (C) 2013 Authors and OPENCORES.ORG
|
--
|
--
|
-- This source file may be used and distributed without
|
-- This source file may be used and distributed without
|
-- restriction provided that this copyright statement is not
|
-- restriction provided that this copyright statement is not
|
-- removed from the file and that any derivative work contains
|
-- removed from the file and that any derivative work contains
|
-- the original copyright notice and the associated disclaimer.
|
-- the original copyright notice and the associated disclaimer.
|
--
|
--
|
-- This source file is free software; you can redistribute it
|
-- This source file is free software; you can redistribute it
|
-- and/or modify it under the terms of the GNU Lesser General
|
-- and/or modify it under the terms of the GNU Lesser General
|
-- Public License as published by the Free Software Foundation;
|
-- Public License as published by the Free Software Foundation;
|
-- either version 2.1 of the License, or (at your option) any
|
-- either version 2.1 of the License, or (at your option) any
|
-- later version.
|
-- later version.
|
--
|
--
|
-- This source is distributed in the hope that it will be
|
-- This source is distributed in the hope that it will be
|
-- useful, but WITHOUT ANY WARRANTY; without even the implied
|
-- useful, but WITHOUT ANY WARRANTY; without even the implied
|
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
-- PURPOSE. See the GNU Lesser General Public License for more
|
-- PURPOSE. See the GNU Lesser General Public License for more
|
-- details.
|
-- details.
|
--
|
--
|
-- You should have received a copy of the GNU Lesser General
|
-- You should have received a copy of the GNU Lesser General
|
-- Public License along with this source; if not, download it
|
-- Public License along with this source; if not, download it
|
-- from http://www.opencores.org/lgpl.shtml
|
-- from http://www.opencores.org/lgpl.shtml
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- TestRioSwitch.
|
-- TestRioSwitch.
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
use ieee.math_real.all;
|
use ieee.math_real.all;
|
library std;
|
library std;
|
use std.textio.all;
|
use std.textio.all;
|
use work.rio_common.all;
|
use work.rio_common.all;
|
|
use work.TestPortPackage.all;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Entity for TestRioSwitch.
|
-- Entity for TestRioSwitch.
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
entity TestRioSwitch is
|
entity TestRioSwitch is
|
end entity;
|
end entity;
|
|
|
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Architecture for TestRioSwitch.
|
-- Architecture for TestRioSwitch.
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
architecture TestRioSwitchImpl of TestRioSwitch is
|
architecture TestRioSwitchImpl of TestRioSwitch is
|
|
|
component RioSwitch is
|
component RioSwitch is
|
generic(
|
generic(
|
SWITCH_PORTS : natural range 3 to 255 := 4;
|
SWITCH_PORTS : natural range 3 to 255 := 4;
|
DEVICE_IDENTITY : std_logic_vector(15 downto 0);
|
DEVICE_IDENTITY : std_logic_vector(15 downto 0);
|
DEVICE_VENDOR_IDENTITY : std_logic_vector(15 downto 0);
|
DEVICE_VENDOR_IDENTITY : std_logic_vector(15 downto 0);
|
DEVICE_REV : std_logic_vector(31 downto 0);
|
DEVICE_REV : std_logic_vector(31 downto 0);
|
ASSY_IDENTITY : std_logic_vector(15 downto 0);
|
ASSY_IDENTITY : std_logic_vector(15 downto 0);
|
ASSY_VENDOR_IDENTITY : std_logic_vector(15 downto 0);
|
ASSY_VENDOR_IDENTITY : std_logic_vector(15 downto 0);
|
ASSY_REV : std_logic_vector(15 downto 0));
|
ASSY_REV : std_logic_vector(15 downto 0));
|
port(
|
port(
|
clk : in std_logic;
|
clk : in std_logic;
|
areset_n : in std_logic;
|
areset_n : in std_logic;
|
|
|
writeFrameFull_i : in Array1(SWITCH_PORTS-1 downto 0);
|
writeFrameFull_i : in Array1(SWITCH_PORTS-1 downto 0);
|
writeFrame_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeFrame_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeFrameAbort_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeFrameAbort_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeContent_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeContent_o : out Array1(SWITCH_PORTS-1 downto 0);
|
writeContentData_o : out Array32(SWITCH_PORTS-1 downto 0);
|
writeContentData_o : out Array32(SWITCH_PORTS-1 downto 0);
|
|
|
readFrameEmpty_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readFrameEmpty_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readFrame_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readFrame_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readFrameRestart_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readFrameRestart_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readFrameAborted_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readFrameAborted_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readContentEmpty_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readContentEmpty_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readContent_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readContent_o : out Array1(SWITCH_PORTS-1 downto 0);
|
readContentEnd_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readContentEnd_i : in Array1(SWITCH_PORTS-1 downto 0);
|
readContentData_i : in Array32(SWITCH_PORTS-1 downto 0);
|
readContentData_i : in Array32(SWITCH_PORTS-1 downto 0);
|
|
|
portLinkTimeout_o : out std_logic_vector(23 downto 0);
|
portLinkTimeout_o : out std_logic_vector(23 downto 0);
|
|
|
linkInitialized_i : in Array1(SWITCH_PORTS-1 downto 0);
|
linkInitialized_i : in Array1(SWITCH_PORTS-1 downto 0);
|
outputPortEnable_o : out Array1(SWITCH_PORTS-1 downto 0);
|
outputPortEnable_o : out Array1(SWITCH_PORTS-1 downto 0);
|
inputPortEnable_o : out Array1(SWITCH_PORTS-1 downto 0);
|
inputPortEnable_o : out Array1(SWITCH_PORTS-1 downto 0);
|
|
|
localAckIdWrite_o : out Array1(SWITCH_PORTS-1 downto 0);
|
localAckIdWrite_o : out Array1(SWITCH_PORTS-1 downto 0);
|
clrOutstandingAckId_o : out Array1(SWITCH_PORTS-1 downto 0);
|
clrOutstandingAckId_o : out Array1(SWITCH_PORTS-1 downto 0);
|
inboundAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
inboundAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
outstandingAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
outstandingAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
outboundAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
outboundAckId_o : out Array5(SWITCH_PORTS-1 downto 0);
|
inboundAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
inboundAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
outstandingAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
outstandingAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
outboundAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
outboundAckId_i : in Array5(SWITCH_PORTS-1 downto 0);
|
|
|
configStb_o : out std_logic;
|
configStb_o : out std_logic;
|
configWe_o : out std_logic;
|
configWe_o : out std_logic;
|
configAddr_o : out std_logic_vector(23 downto 0);
|
configAddr_o : out std_logic_vector(23 downto 0);
|
configData_o : out std_logic_vector(31 downto 0);
|
configData_o : out std_logic_vector(31 downto 0);
|
configData_i : in std_logic_vector(31 downto 0));
|
configData_i : in std_logic_vector(31 downto 0);
|
|
configAck_i : in std_logic);
|
end component;
|
end component;
|
|
|
component TestPort is
|
constant PORTS : natural := 3;
|
port(
|
|
clk : in std_logic;
|
|
areset_n : in std_logic;
|
|
|
|
frameValid_i : in std_logic;
|
|
frameWrite_i : in RioFrame;
|
|
frameComplete_o : out std_logic;
|
|
|
|
frameExpected_i : in std_logic;
|
|
frameRead_i : in RioFrame;
|
|
frameReceived_o : out std_logic;
|
|
|
|
readFrameEmpty_o : out std_logic;
|
|
readFrame_i : in std_logic;
|
|
readFrameRestart_i : in std_logic;
|
|
readFrameAborted_o : out std_logic;
|
|
readContentEmpty_o : out std_logic;
|
|
readContent_i : in std_logic;
|
|
readContentEnd_o : out std_logic;
|
|
readContentData_o : out std_logic_vector(31 downto 0);
|
|
writeFrameFull_o : out std_logic;
|
|
writeFrame_i : in std_logic;
|
|
writeFrameAbort_i : in std_logic;
|
|
writeContent_i : in std_logic;
|
|
writeContentData_i : in std_logic_vector(31 downto 0));
|
|
end component;
|
|
|
|
constant PORTS : natural := 7;
|
|
constant SWITCH_IDENTITY : std_logic_vector(15 downto 0) := x"0123";
|
constant SWITCH_IDENTITY : std_logic_vector(15 downto 0) := x"0123";
|
constant SWITCH_VENDOR_IDENTITY : std_logic_vector(15 downto 0) := x"4567";
|
constant SWITCH_VENDOR_IDENTITY : std_logic_vector(15 downto 0) := x"4567";
|
constant SWITCH_REV : std_logic_vector(31 downto 0) := x"89abcdef";
|
constant SWITCH_REV : std_logic_vector(31 downto 0) := x"89abcdef";
|
constant SWITCH_ASSY_IDENTITY : std_logic_vector(15 downto 0) := x"0011";
|
constant SWITCH_ASSY_IDENTITY : std_logic_vector(15 downto 0) := x"0011";
|
constant SWITCH_ASSY_VENDOR_IDENTITY : std_logic_vector(15 downto 0) := x"2233";
|
constant SWITCH_ASSY_VENDOR_IDENTITY : std_logic_vector(15 downto 0) := x"2233";
|
constant SWITCH_ASSY_REV : std_logic_vector(15 downto 0) := x"4455";
|
constant SWITCH_ASSY_REV : std_logic_vector(15 downto 0) := x"4455";
|
|
|
signal clk : std_logic;
|
signal clk : std_logic;
|
signal areset_n : std_logic;
|
signal areset_n : std_logic;
|
|
|
signal frameValid : Array1(PORTS-1 downto 0);
|
signal inboundEmpty : Array1(PORTS-1 downto 0);
|
signal frameWrite : RioFrameArray(PORTS-1 downto 0);
|
signal inboundEmpty0 : std_logic;
|
signal frameComplete : Array1(PORTS-1 downto 0);
|
signal inboundEmpty1 : std_logic;
|
|
signal inboundEmpty2 : std_logic;
|
signal frameExpected : Array1(PORTS-1 downto 0);
|
signal inboundWrite : Array1(PORTS-1 downto 0);
|
signal frameRead : RioFrameArray(PORTS-1 downto 0);
|
signal inboundWrite0 : std_logic;
|
signal frameReceived : Array1(PORTS-1 downto 0);
|
signal inboundWrite1 : std_logic;
|
|
signal inboundWrite2 : std_logic;
|
|
signal inboundMessage : TestPortMessagePacketBufferArray(PORTS-1 downto 0);
|
|
signal inboundMessage0 : TestPortMessagePacketBuffer;
|
|
signal inboundMessage1 : TestPortMessagePacketBuffer;
|
|
signal inboundMessage2 : TestPortMessagePacketBuffer;
|
|
signal inboundAck : Array1(PORTS-1 downto 0);
|
|
signal inboundAck0 : std_logic;
|
|
signal inboundAck1 : std_logic;
|
|
signal inboundAck2 : std_logic;
|
|
|
|
signal outboundEmpty : Array1(PORTS-1 downto 0);
|
|
signal outboundEmpty0 : std_logic;
|
|
signal outboundEmpty1 : std_logic;
|
|
signal outboundEmpty2 : std_logic;
|
|
signal outboundWrite : Array1(PORTS-1 downto 0);
|
|
signal outboundWrite0 : std_logic;
|
|
signal outboundWrite1 : std_logic;
|
|
signal outboundWrite2 : std_logic;
|
|
signal outboundMessage : TestPortMessagePacketBufferArray(PORTS-1 downto 0);
|
|
signal outboundMessage0 : TestPortMessagePacketBuffer;
|
|
signal outboundMessage1 : TestPortMessagePacketBuffer;
|
|
signal outboundMessage2 : TestPortMessagePacketBuffer;
|
|
signal outboundAck : Array1(PORTS-1 downto 0);
|
|
signal outboundAck0 : std_logic;
|
|
signal outboundAck1 : std_logic;
|
|
signal outboundAck2 : std_logic;
|
|
|
signal writeFrameFull : Array1(PORTS-1 downto 0);
|
signal writeFrameFull : Array1(PORTS-1 downto 0);
|
signal writeFrame : Array1(PORTS-1 downto 0);
|
signal writeFrame : Array1(PORTS-1 downto 0);
|
signal writeFrameAbort : Array1(PORTS-1 downto 0);
|
signal writeFrameAbort : Array1(PORTS-1 downto 0);
|
signal writeContent : Array1(PORTS-1 downto 0);
|
signal writeContent : Array1(PORTS-1 downto 0);
|
signal writeContentData : Array32(PORTS-1 downto 0);
|
signal writeContentData : Array32(PORTS-1 downto 0);
|
|
|
signal readFrameEmpty : Array1(PORTS-1 downto 0);
|
signal readFrameEmpty : Array1(PORTS-1 downto 0);
|
signal readFrame : Array1(PORTS-1 downto 0);
|
signal readFrame : Array1(PORTS-1 downto 0);
|
signal readFrameRestart : Array1(PORTS-1 downto 0);
|
signal readFrameRestart : Array1(PORTS-1 downto 0);
|
signal readFrameAborted : Array1(PORTS-1 downto 0);
|
signal readFrameAborted : Array1(PORTS-1 downto 0);
|
signal readContentEmpty : Array1(PORTS-1 downto 0);
|
signal readContentEmpty : Array1(PORTS-1 downto 0);
|
signal readContent : Array1(PORTS-1 downto 0);
|
signal readContent : Array1(PORTS-1 downto 0);
|
signal readContentEnd : Array1(PORTS-1 downto 0);
|
signal readContentEnd : Array1(PORTS-1 downto 0);
|
signal readContentData : Array32(PORTS-1 downto 0);
|
signal readContentData : Array32(PORTS-1 downto 0);
|
|
|
signal portLinkTimeout : std_logic_vector(23 downto 0);
|
signal portLinkTimeout : std_logic_vector(23 downto 0);
|
|
|
signal linkInitialized : Array1(PORTS-1 downto 0);
|
signal linkInitialized : Array1(PORTS-1 downto 0);
|
signal outputPortEnable : Array1(PORTS-1 downto 0);
|
signal outputPortEnable : Array1(PORTS-1 downto 0);
|
signal inputPortEnable : Array1(PORTS-1 downto 0);
|
signal inputPortEnable : Array1(PORTS-1 downto 0);
|
|
|
signal localAckIdWrite : Array1(PORTS-1 downto 0);
|
signal localAckIdWrite : Array1(PORTS-1 downto 0);
|
signal clrOutstandingAckId : Array1(PORTS-1 downto 0);
|
signal clrOutstandingAckId : Array1(PORTS-1 downto 0);
|
signal inboundAckIdWrite : Array5(PORTS-1 downto 0);
|
signal inboundAckIdWrite : Array5(PORTS-1 downto 0);
|
signal outstandingAckIdWrite : Array5(PORTS-1 downto 0);
|
signal outstandingAckIdWrite : Array5(PORTS-1 downto 0);
|
signal outboundAckIdWrite : Array5(PORTS-1 downto 0);
|
signal outboundAckIdWrite : Array5(PORTS-1 downto 0);
|
signal inboundAckIdRead : Array5(PORTS-1 downto 0);
|
signal inboundAckIdRead : Array5(PORTS-1 downto 0);
|
signal outstandingAckIdRead : Array5(PORTS-1 downto 0);
|
signal outstandingAckIdRead : Array5(PORTS-1 downto 0);
|
signal outboundAckIdRead : Array5(PORTS-1 downto 0);
|
signal outboundAckIdRead : Array5(PORTS-1 downto 0);
|
|
|
signal configStb, configStbExpected : std_logic;
|
signal messageEmpty : std_logic;
|
signal configWe, configWeExpected : std_logic;
|
signal messageWrite : std_logic;
|
signal configAddr, configAddrExpected : std_logic_vector(23 downto 0);
|
signal message : TestPortMessageWishbone;
|
signal configDataWrite, configDataWriteExpected : std_logic_vector(31 downto 0);
|
signal messageAck : std_logic;
|
signal configDataRead, configDataReadExpected : std_logic_vector(31 downto 0);
|
|
|
signal configStb : std_logic;
|
|
signal configWe : std_logic;
|
|
signal configAddr : std_logic_vector(23 downto 0);
|
|
signal configDataWrite : std_logic_vector(31 downto 0);
|
|
signal configDataRead : std_logic_vector(31 downto 0);
|
|
signal configAck : std_logic;
|
|
|
begin
|
begin
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Clock generation.
|
-- Clock generation.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
ClockGenerator: process
|
ClockGenerator: process
|
begin
|
begin
|
clk <= '0';
|
clk <= '0';
|
wait for 20 ns;
|
wait for 20 ns;
|
clk <= '1';
|
clk <= '1';
|
wait for 20 ns;
|
wait for 20 ns;
|
end process;
|
end process;
|
|
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Serial port emulator.
|
-- Serial port emulator.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
TestDriver: process
|
TestDriver: process
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure SendFrame(constant portIndex : natural range 0 to 7;
|
procedure SendFrame(constant portIndex : natural range 0 to 7;
|
constant frame : RioFrame) is
|
constant frame : RioFrame) is
|
begin
|
begin
|
frameValid(portIndex) <= '1';
|
-- Crappy Modelsim cannot handle arrays of signals...
|
frameWrite(portIndex) <= frame;
|
case portIndex is
|
wait until frameComplete(portIndex) = '1';
|
when 0 =>
|
frameValid(portIndex) <= '0';
|
TestPortPacketBufferWrite(inboundWrite0, inboundMessage0, inboundAck0,
|
|
frame, false);
|
|
when 1 =>
|
|
TestPortPacketBufferWrite(inboundWrite1, inboundMessage1, inboundAck1,
|
|
frame, false);
|
|
when others =>
|
|
TestPortPacketBufferWrite(inboundWrite2, inboundMessage2, inboundAck2,
|
|
frame, false);
|
|
end case;
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure ReceiveFrame(constant portIndex : natural range 0 to 7;
|
procedure ReceiveFrame(constant portIndex : natural range 0 to 7;
|
constant frame : RioFrame) is
|
constant frame : RioFrame) is
|
begin
|
begin
|
frameExpected(portIndex) <= '1';
|
-- Crappy Modelsim cannot handle arrays of signals...
|
frameRead(portIndex) <= frame;
|
case portIndex is
|
wait until frameReceived(portIndex) = '1';
|
when 0 =>
|
frameExpected(portIndex) <= '0';
|
TestPortPacketBufferWrite(outboundWrite0, outboundMessage0, outboundAck0,
|
|
frame, false);
|
|
when 1 =>
|
|
TestPortPacketBufferWrite(outboundWrite1, outboundMessage1, outboundAck1,
|
|
frame, false);
|
|
when others =>
|
|
TestPortPacketBufferWrite(outboundWrite2, outboundMessage2, outboundAck2,
|
|
frame, false);
|
|
end case;
|
|
end procedure;
|
|
|
|
---------------------------------------------------------------------------
|
|
--
|
|
---------------------------------------------------------------------------
|
|
procedure SendFrame(constant portIndex : natural range 0 to 7;
|
|
constant sourceId : std_logic_vector(15 downto 0);
|
|
constant destinationId : std_logic_vector(15 downto 0);
|
|
constant payload : RioPayload) is
|
|
variable frame : RioFrame;
|
|
begin
|
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>"0000",
|
|
sourceId=>sourceId, destId=>destinationId,
|
|
payload=>payload);
|
|
SendFrame(portIndex, frame);
|
|
end procedure;
|
|
|
|
---------------------------------------------------------------------------
|
|
--
|
|
---------------------------------------------------------------------------
|
|
procedure ReceiveFrame(constant portIndex : natural range 0 to 7;
|
|
constant sourceId : std_logic_vector(15 downto 0);
|
|
constant destinationId : std_logic_vector(15 downto 0);
|
|
constant payload : RioPayload) is
|
|
variable frame : RioFrame;
|
|
begin
|
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>"0000",
|
|
sourceId=>sourceId, destId=>destinationId,
|
|
payload=>payload);
|
|
ReceiveFrame(portIndex, frame);
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure ReadConfig32(constant portIndex : natural range 0 to 7;
|
procedure ReadConfig32(constant portIndex : natural range 0 to 7;
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant hop : std_logic_vector(7 downto 0);
|
constant hop : std_logic_vector(7 downto 0);
|
constant tid : std_logic_vector(7 downto 0);
|
constant tid : std_logic_vector(7 downto 0);
|
constant address : std_logic_vector(23 downto 0);
|
constant address : std_logic_vector(23 downto 0);
|
constant data : std_logic_vector(31 downto 0)) is
|
constant data : std_logic_vector(31 downto 0)) is
|
variable maintData : DoubleWordArray(0 to 7);
|
variable maintData : DoubleWordArray(0 to 7);
|
begin
|
begin
|
SendFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
SendFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
sourceId=>sourceId, destId=>destinationId,
|
sourceId=>sourceId, destId=>destinationId,
|
payload=>RioMaintenance(transaction=>"0000",
|
payload=>RioMaintenance(transaction=>"0000",
|
size=>"1000",
|
size=>"1000",
|
tid=>tid,
|
tid=>tid,
|
hopCount=>hop,
|
hopCount=>hop,
|
configOffset=>address(23 downto 3),
|
configOffset=>address(23 downto 3),
|
wdptr=>address(2),
|
wdptr=>address(2),
|
dataLength=>0,
|
dataLength=>0,
|
data=>maintData)));
|
data=>maintData)));
|
if (address(2) = '0') then
|
if (address(2) = '0') then
|
maintData(0) := data & x"00000000";
|
maintData(0) := data & x"00000000";
|
else
|
else
|
maintData(0) := x"00000000" & data ;
|
maintData(0) := x"00000000" & data ;
|
end if;
|
end if;
|
|
|
ReceiveFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
ReceiveFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
sourceId=>destinationId, destId=>sourceId,
|
sourceId=>destinationId, destId=>sourceId,
|
payload=>RioMaintenance(transaction=>"0010",
|
payload=>RioMaintenance(transaction=>"0010",
|
size=>"0000",
|
size=>"0000",
|
tid=>tid,
|
tid=>tid,
|
hopCount=>x"ff",
|
hopCount=>x"ff",
|
configOffset=>"000000000000000000000",
|
configOffset=>"000000000000000000000",
|
wdptr=>'0',
|
wdptr=>'0',
|
dataLength=>1,
|
dataLength=>1,
|
data=>maintData)));
|
data=>maintData)));
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure WriteConfig32(constant portIndex : natural range 0 to 7;
|
procedure WriteConfig32(constant portIndex : natural range 0 to 7;
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant hop : std_logic_vector(7 downto 0);
|
constant hop : std_logic_vector(7 downto 0);
|
constant tid : std_logic_vector(7 downto 0);
|
constant tid : std_logic_vector(7 downto 0);
|
constant address : std_logic_vector(23 downto 0);
|
constant address : std_logic_vector(23 downto 0);
|
constant data : std_logic_vector(31 downto 0)) is
|
constant data : std_logic_vector(31 downto 0)) is
|
variable maintData : DoubleWordArray(0 to 7);
|
variable maintData : DoubleWordArray(0 to 7);
|
begin
|
begin
|
if (address(2) = '0') then
|
if (address(2) = '0') then
|
maintData(0) := data & x"00000000";
|
maintData(0) := data & x"00000000";
|
else
|
else
|
maintData(0) := x"00000000" & data ;
|
maintData(0) := x"00000000" & data ;
|
end if;
|
end if;
|
|
|
SendFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
SendFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
sourceId=>sourceId, destId=>destinationId,
|
sourceId=>sourceId, destId=>destinationId,
|
payload=>RioMaintenance(transaction=>"0001",
|
payload=>RioMaintenance(transaction=>"0001",
|
size=>"1000",
|
size=>"1000",
|
tid=>tid,
|
tid=>tid,
|
hopCount=>hop,
|
hopCount=>hop,
|
configOffset=>address(23 downto 3),
|
configOffset=>address(23 downto 3),
|
wdptr=>address(2),
|
wdptr=>address(2),
|
dataLength=>1,
|
dataLength=>1,
|
data=>maintData)));
|
data=>maintData)));
|
|
|
ReceiveFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
ReceiveFrame(portIndex, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
sourceId=>destinationId, destId=>sourceId,
|
sourceId=>destinationId, destId=>sourceId,
|
payload=>RioMaintenance(transaction=>"0011",
|
payload=>RioMaintenance(transaction=>"0011",
|
size=>"0000",
|
size=>"0000",
|
tid=>tid,
|
tid=>tid,
|
hopCount=>x"ff",
|
hopCount=>x"ff",
|
configOffset=>"000000000000000000000",
|
configOffset=>"000000000000000000000",
|
wdptr=>'0',
|
wdptr=>'0',
|
dataLength=>0,
|
dataLength=>0,
|
data=>maintData)));
|
data=>maintData)));
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure RouteFrame(constant sourcePortIndex : natural range 0 to 7;
|
procedure RouteFrame(constant sourcePortIndex : natural range 0 to 7;
|
constant destinationPortIndex : natural range 0 to 7;
|
constant destinationPortIndex : natural range 0 to 7;
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant destinationId : std_logic_vector(15 downto 0);
|
constant payload : RioPayload) is
|
constant payload : RioPayload) is
|
variable frame : RioFrame;
|
variable frame : RioFrame;
|
begin
|
begin
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tt=>"01", ftype=>"0000",
|
tt=>"01", ftype=>"0000",
|
sourceId=>sourceId, destId=>destinationId,
|
destId=>destinationId, sourceId=>sourceId,
|
payload=>payload);
|
payload=>payload);
|
|
|
frameExpected(destinationPortIndex) <= '1';
|
ReceiveFrame(destinationPortIndex, frame);
|
frameRead(destinationPortIndex) <= frame;
|
SendFrame(sourcePortIndex, frame);
|
|
|
frameValid(sourcePortIndex) <= '1';
|
|
frameWrite(sourcePortIndex) <= frame;
|
|
wait until frameComplete(sourcePortIndex) = '1';
|
|
frameValid(sourcePortIndex) <= '0';
|
|
|
|
wait until frameReceived(destinationPortIndex) = '1';
|
|
frameExpected(destinationPortIndex) <= '0';
|
|
|
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure SendFrame(constant portIndex : natural range 0 to 7;
|
procedure ExchangeFrames is
|
constant sourceId : std_logic_vector(15 downto 0);
|
|
constant destinationId : std_logic_vector(15 downto 0);
|
|
constant payload : RioPayload) is
|
|
variable frame : RioFrame;
|
|
begin
|
begin
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
TestWait(inboundEmpty0, '1', "port0 frame sent");
|
tt=>"01", ftype=>"0000",
|
TestWait(inboundEmpty1, '1', "port0 frame sent");
|
sourceId=>sourceId, destId=>destinationId,
|
TestWait(inboundEmpty2, '1', "port0 frame sent");
|
payload=>payload);
|
TestWait(outboundEmpty0, '1', "port0 frame received");
|
|
TestWait(outboundEmpty1, '1', "port0 frame received");
|
frameValid(portIndex) <= '1';
|
TestWait(outboundEmpty2, '1', "port0 frame received");
|
frameWrite(portIndex) <= frame;
|
|
end procedure;
|
end procedure;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
--
|
--
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
procedure ReceiveFrame(constant portIndex : natural range 0 to 7;
|
procedure ConfigRead(constant address : std_logic_vector(23 downto 0);
|
constant sourceId : std_logic_vector(15 downto 0);
|
constant data : std_logic_vector(31 downto 0)) is
|
constant destinationId : std_logic_vector(15 downto 0);
|
|
constant payload : RioPayload) is
|
|
variable frame : RioFrame;
|
|
begin
|
begin
|
frame := RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
TestPortWishboneWrite(writeSignal=>messageWrite,
|
tt=>"01", ftype=>"0000",
|
messageSignal=>message,
|
sourceId=>sourceId, destId=>destinationId,
|
ackSignal=>messageAck,
|
payload=>payload);
|
writeAccess=>false,
|
|
address=>(x"00000000" & x"00" & address),
|
frameExpected(portIndex) <= '1';
|
byteSelect=>x"00",
|
frameRead(portIndex) <= frame;
|
data=>(x"00000000" & data),
|
|
latency=>3);
|
|
end procedure;
|
|
procedure ConfigWrite(constant address : std_logic_vector(23 downto 0);
|
|
constant data : std_logic_vector(31 downto 0)) is
|
|
begin
|
|
TestPortWishboneWrite(writeSignal=>messageWrite,
|
|
messageSignal=>message,
|
|
ackSignal=>messageAck,
|
|
writeAccess=>true,
|
|
address=>(x"00000000" & x"00" & address),
|
|
byteSelect=>x"00",
|
|
data=>(x"00000000" & data),
|
|
latency=>3);
|
end procedure;
|
end procedure;
|
|
|
-- These variabels are needed for the random number generation.
|
-- These variabels are needed for the random number generation.
|
variable seed1 : positive := 1;
|
variable seed1 : positive := 1;
|
variable seed2: positive := 1;
|
variable seed2: positive := 1;
|
|
|
|
variable maintData : DoubleWordArray(0 to 7);
|
variable data : DoubleWordArray(0 to 31);
|
variable data : DoubleWordArray(0 to 31);
|
variable randomPayload : RioPayload;
|
variable randomPayload : RioPayload;
|
variable randomPayload1 : RioPayload;
|
variable randomPayload1 : RioPayload;
|
variable randomPayload2 : RioPayload;
|
variable randomPayload2 : RioPayload;
|
variable frame : RioFrameArray(0 to PORTS-1);
|
variable frame : RioFrame;
|
|
|
begin
|
begin
|
areset_n <= '0';
|
areset_n <= '0';
|
|
|
linkInitialized <= (others=>'0');
|
linkInitialized <= (others=>'0');
|
|
|
|
writeFrameFull <= (others=>'0');
|
for portIndex in 0 to PORTS-1 loop
|
for portIndex in 0 to PORTS-1 loop
|
frameValid(portIndex) <= '0';
|
inboundWrite0 <= '0';
|
frameExpected(portIndex) <= '0';
|
outboundWrite0 <= '0';
|
|
inboundWrite1 <= '0';
|
|
outboundWrite1 <= '0';
|
|
inboundWrite2 <= '0';
|
|
outboundWrite2 <= '0';
|
localAckIdWrite(portIndex) <= '0';
|
localAckIdWrite(portIndex) <= '0';
|
clrOutstandingAckId(portIndex) <= '0';
|
clrOutstandingAckId(portIndex) <= '0';
|
inboundAckIdWrite(portIndex) <= (others=>'0');
|
inboundAckIdWrite(portIndex) <= (others=>'0');
|
outstandingAckIdWrite(portIndex) <= (others=>'0');
|
outstandingAckIdWrite(portIndex) <= (others=>'0');
|
outboundAckIdWrite(portIndex) <= (others=>'0');
|
outboundAckIdWrite(portIndex) <= (others=>'0');
|
end loop;
|
end loop;
|
|
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
areset_n <= '1';
|
areset_n <= '1';
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
wait until clk'event and clk = '1';
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("TG_RioSwitch");
|
PrintS("TG_RioSwitch");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("TG_RioSwitch-TC1");
|
PrintS("TG_RioSwitch-TC1");
|
PrintS("Description: Test switch maintenance accesses on different ports.");
|
PrintS("Description: Test switch maintenance accesses on different ports.");
|
PrintS("Requirement: XXXXX");
|
PrintS("Requirement: XXXXX");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 1:");
|
PrintS("Step 1:");
|
PrintS("Action: Send maintenance read request packets to read switch identity.");
|
PrintS("Action: Send maintenance read request packets to read switch identity.");
|
PrintS("Result: The switch should answer with its configured identitiy.");
|
PrintS("Result: The switch should answer with its configured identitiy.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step1");
|
PrintR("TG_RioSwitch-TC1-Step1");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000000", data=>(SWITCH_IDENTITY & SWITCH_VENDOR_IDENTITY));
|
tid=>x"00", address=>x"000000", data=>(SWITCH_IDENTITY & SWITCH_VENDOR_IDENTITY));
|
ReadConfig32(portIndex=>1, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>1, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"01", address=>x"000004", data=>SWITCH_REV);
|
tid=>x"01", address=>x"000004", data=>SWITCH_REV);
|
ReadConfig32(portIndex=>2, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>2, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"02", address=>x"000008", data=>(SWITCH_ASSY_IDENTITY & SWITCH_ASSY_VENDOR_IDENTITY));
|
tid=>x"02", address=>x"000008", data=>(SWITCH_ASSY_IDENTITY & SWITCH_ASSY_VENDOR_IDENTITY));
|
ReadConfig32(portIndex=>3, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>3, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"03", address=>x"00000c", data=>(SWITCH_ASSY_REV & x"0100"));
|
tid=>x"03", address=>x"00000c", data=>(SWITCH_ASSY_REV & x"0100"));
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 2:");
|
PrintS("Step 2:");
|
PrintS("Action: Check the switch Processing Element Features.");
|
PrintS("Action: Check the switch Processing Element Features.");
|
PrintS("Result: The expected switch features should be returned. ");
|
PrintS("Result: The expected switch features should be returned. ");
|
PrintS(" Switch with extended features pointer valid. Common ");
|
PrintS(" Switch with extended features pointer valid. Common ");
|
PrintS(" transport large system support and standard route table ");
|
PrintS(" transport large system support and standard route table ");
|
PrintS(" configuration support.");
|
PrintS(" configuration support.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step2");
|
PrintR("TG_RioSwitch-TC1-Step2");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>4, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>4, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"04", address=>x"000010", data=>x"10000118");
|
tid=>x"04", address=>x"000010", data=>x"10000118");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 3:");
|
PrintS("Step 3:");
|
PrintS("Action: Check the switch port information.");
|
PrintS("Action: Check the switch port information.");
|
PrintS("Result: The expected port and number of ports should be returned.");
|
PrintS("Result: The expected port and number of ports should be returned.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step3");
|
PrintR("TG_RioSwitch-TC1-Step3");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>5, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>2, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"05", address=>x"000014", data=>x"00000705");
|
tid=>x"05", address=>x"000014", data=>x"00000302");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 4:");
|
PrintS("Step 4:");
|
PrintS("Action: Check the switch number of supported routes.");
|
PrintS("Action: Check the switch number of supported routes.");
|
PrintS("Result: The expected number of supported routes should be returned.");
|
PrintS("Result: The expected number of supported routes should be returned.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step4");
|
PrintR("TG_RioSwitch-TC1-Step4");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000034", data=>x"00000800");
|
tid=>x"06", address=>x"000034", data=>x"00000800");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 5:");
|
PrintS("Step 5:");
|
PrintS("Action: Test host base device id lock by reading it, then hold it ");
|
PrintS("Action: Test host base device id lock by reading it, then hold it ");
|
PrintS(" and try to grab it from another address.");
|
PrintS(" and try to grab it from another address.");
|
PrintS("Result: The value should follow the specification.");
|
PrintS("Result: The value should follow the specification.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step5");
|
PrintR("TG_RioSwitch-TC1-Step5");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
-- Check that the lock is released.
|
-- Check that the lock is released.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
|
|
-- Try to accuire the lock.
|
-- Try to accuire the lock.
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
|
|
-- Check that the lock has been accuired.
|
-- Check that the lock has been accuired.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
|
|
-- Try to accuire the lock from another source.
|
-- Try to accuire the lock from another source.
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
|
|
-- Check that the lock refuses the new access.
|
-- Check that the lock refuses the new access.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
|
|
-- Release the lock.
|
-- Release the lock.
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
tid=>x"00", address=>x"000068", data=>x"00000002");
|
|
|
-- Check that the lock is released.
|
-- Check that the lock is released.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
|
|
-- Check that the lock can be accuired from another source once unlocked.
|
-- Check that the lock can be accuired from another source once unlocked.
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
|
|
-- Check that the lock is released.
|
-- Check that the lock is released.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
|
|
-- Release the lock again.
|
-- Release the lock again.
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
tid=>x"00", address=>x"000068", data=>x"00000003");
|
|
|
-- Check that the lock is released.
|
-- Check that the lock is released.
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
tid=>x"00", address=>x"000068", data=>x"0000ffff");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 6");
|
PrintS("Step 6");
|
PrintS("Action: Check the component tag register.");
|
PrintS("Action: Check the component tag register.");
|
PrintS("Result: The written value in the component tag should be saved.");
|
PrintS("Result: The written value in the component tag should be saved.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step6");
|
PrintR("TG_RioSwitch-TC1-Step6");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00006c", data=>x"00000000");
|
tid=>x"06", address=>x"00006c", data=>x"00000000");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00006c", data=>x"ffffffff");
|
tid=>x"06", address=>x"00006c", data=>x"ffffffff");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00006c", data=>x"ffffffff");
|
tid=>x"06", address=>x"00006c", data=>x"ffffffff");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 7");
|
PrintS("Step 7");
|
PrintS("Action: Read and write to the port link timeout.");
|
PrintS("Action: Read and write to the port link timeout.");
|
PrintS("Result: Check that the portLinkTimeout output from the switch changes.");
|
PrintS("Result: Check that the portLinkTimeout output from the switch changes.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step7");
|
PrintR("TG_RioSwitch-TC1-Step7");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
assert portLinkTimeout = x"ffffff" report "Unexpected portLinkTimeout." severity error;
|
assert portLinkTimeout = x"ffffff" report "Unexpected portLinkTimeout." severity error;
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000120", data=>x"ffffff00");
|
tid=>x"06", address=>x"000120", data=>x"ffffff00");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000120", data=>x"00000100");
|
tid=>x"06", address=>x"000120", data=>x"00000100");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000120", data=>x"00000100");
|
tid=>x"06", address=>x"000120", data=>x"00000100");
|
|
|
|
ExchangeFrames;
|
|
|
assert portLinkTimeout = x"000001" report "Unexpected portLinkTimeout." severity error;
|
assert portLinkTimeout = x"000001" report "Unexpected portLinkTimeout." severity error;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 8");
|
PrintS("Step 8");
|
PrintS("Action: Read from the port general control.");
|
PrintS("Action: Read from the port general control.");
|
PrintS("Result: Check the discovered bit.");
|
PrintS("Result: Check the discovered bit.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step8");
|
PrintR("TG_RioSwitch-TC1-Step8");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00013c", data=>x"20000000");
|
tid=>x"06", address=>x"00013c", data=>x"20000000");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00013c", data=>x"20000000");
|
tid=>x"06", address=>x"00013c", data=>x"20000000");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
tid=>x"06", address=>x"00013c", data=>x"00000000");
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 9");
|
PrintS("Step 9");
|
PrintS("Action: Read from the port N error and status.");
|
PrintS("Action: Read from the port N error and status.");
|
PrintS("Result: Check the port ok and port uninitialized bits.");
|
PrintS("Result: Check the port ok and port uninitialized bits.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step9");
|
PrintR("TG_RioSwitch-TC1-Step9");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
linkInitialized(0) <= '0';
|
linkInitialized(0) <= '0';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000158", data=>x"00000001");
|
tid=>x"06", address=>x"000158", data=>x"00000001");
|
|
ExchangeFrames;
|
linkInitialized(0) <= '1';
|
linkInitialized(0) <= '1';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000158", data=>x"00000002");
|
tid=>x"06", address=>x"000158", data=>x"00000002");
|
|
ExchangeFrames;
|
|
|
linkInitialized(1) <= '0';
|
linkInitialized(1) <= '0';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000178", data=>x"00000001");
|
tid=>x"06", address=>x"000178", data=>x"00000001");
|
|
ExchangeFrames;
|
linkInitialized(1) <= '1';
|
linkInitialized(1) <= '1';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000178", data=>x"00000002");
|
tid=>x"06", address=>x"000178", data=>x"00000002");
|
|
ExchangeFrames;
|
|
|
linkInitialized(2) <= '0';
|
linkInitialized(2) <= '0';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000198", data=>x"00000001");
|
tid=>x"06", address=>x"000198", data=>x"00000001");
|
|
ExchangeFrames;
|
linkInitialized(2) <= '1';
|
linkInitialized(2) <= '1';
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"000198", data=>x"00000002");
|
tid=>x"06", address=>x"000198", data=>x"00000002");
|
|
ExchangeFrames;
|
linkInitialized(3) <= '0';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001b8", data=>x"00000001");
|
|
linkInitialized(3) <= '1';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001b8", data=>x"00000002");
|
|
|
|
linkInitialized(4) <= '0';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001d8", data=>x"00000001");
|
|
linkInitialized(4) <= '1';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001d8", data=>x"00000002");
|
|
|
|
linkInitialized(5) <= '0';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001f8", data=>x"00000001");
|
|
linkInitialized(5) <= '1';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001f8", data=>x"00000002");
|
|
|
|
linkInitialized(6) <= '0';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"000218", data=>x"00000001");
|
|
linkInitialized(6) <= '1';
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"000218", data=>x"00000002");
|
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 10");
|
PrintS("Step 10");
|
PrintS("Action: Read and write to/from the port N control.");
|
PrintS("Action: Read and write to/from the port N control.");
|
PrintS("Result: Check the output/input port enable.");
|
PrintS("Result: Check the output/input port enable.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step10");
|
PrintR("TG_RioSwitch-TC1-Step10");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
assert outputPortEnable(0) = '0' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(0) = '0' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(0) = '0' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(0) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00015c", data=>x"00000001");
|
tid=>x"06", address=>x"00015c", data=>x"00000001");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00015c", data=>x"00600001");
|
tid=>x"06", address=>x"00015c", data=>x"00600001");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00015c", data=>x"00600001");
|
tid=>x"06", address=>x"00015c", data=>x"00600001");
|
|
|
|
ExchangeFrames;
|
|
|
assert outputPortEnable(0) = '1' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(0) = '1' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(0) = '1' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(0) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
assert outputPortEnable(1) = '0' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(1) = '0' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(1) = '0' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(1) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00017c", data=>x"00000001");
|
tid=>x"06", address=>x"00017c", data=>x"00000001");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00017c", data=>x"00600001");
|
tid=>x"06", address=>x"00017c", data=>x"00600001");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00017c", data=>x"00600001");
|
tid=>x"06", address=>x"00017c", data=>x"00600001");
|
|
|
|
ExchangeFrames;
|
|
|
assert outputPortEnable(1) = '1' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(1) = '1' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(1) = '1' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(1) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
assert outputPortEnable(2) = '0' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(2) = '0' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(2) = '0' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(2) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00019c", data=>x"00000001");
|
tid=>x"06", address=>x"00019c", data=>x"00000001");
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00019c", data=>x"00600001");
|
tid=>x"06", address=>x"00019c", data=>x"00600001");
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"06", address=>x"00019c", data=>x"00600001");
|
tid=>x"06", address=>x"00019c", data=>x"00600001");
|
|
|
|
ExchangeFrames;
|
|
|
assert outputPortEnable(2) = '1' report "Unexpected outputPortEnable." severity error;
|
assert outputPortEnable(2) = '1' report "Unexpected outputPortEnable." severity error;
|
assert inputPortEnable(2) = '1' report "Unexpected inputPortEnable." severity error;
|
assert inputPortEnable(2) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
assert outputPortEnable(3) = '0' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(3) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001bc", data=>x"00000001");
|
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001bc", data=>x"00600001");
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001bc", data=>x"00600001");
|
|
|
|
assert outputPortEnable(3) = '1' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(3) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
assert outputPortEnable(4) = '0' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(4) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001dc", data=>x"00000001");
|
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001dc", data=>x"00600001");
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001dc", data=>x"00600001");
|
|
|
|
assert outputPortEnable(4) = '1' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(4) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
assert outputPortEnable(5) = '0' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(5) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001fc", data=>x"00000001");
|
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001fc", data=>x"00600001");
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"0001fc", data=>x"00600001");
|
|
|
|
assert outputPortEnable(5) = '1' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(5) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
assert outputPortEnable(6) = '0' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(6) = '0' report "Unexpected inputPortEnable." severity error;
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"00021c", data=>x"00000001");
|
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"00021c", data=>x"00600001");
|
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
|
tid=>x"06", address=>x"00021c", data=>x"00600001");
|
|
|
|
assert outputPortEnable(6) = '1' report "Unexpected outputPortEnable." severity error;
|
|
assert inputPortEnable(6) = '1' report "Unexpected inputPortEnable." severity error;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 11");
|
PrintS("Step 11");
|
PrintS("Action: Read and write to/from the implementation defined space.");
|
PrintS("Action: Read and write to/from the implementation defined space.");
|
PrintS("Result: Check the accesses on the external configuration port.");
|
PrintS("Result: Check the accesses on the external configuration port.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC1-Step11");
|
PrintR("TG_RioSwitch-TC1-Step11");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
configStbExpected <= '1';
|
CreateRandomPayload(maintData, seed1, seed2);
|
configWeExpected <= '0';
|
ConfigRead(x"010000", maintData(0)(63 downto 32));
|
configAddrExpected <= x"010000";
|
ConfigRead(x"010004", maintData(0)(31 downto 0));
|
configDataReadExpected <= x"deadbeef";
|
ConfigRead(x"010008", maintData(1)(63 downto 32));
|
|
ConfigRead(x"01000c", maintData(1)(31 downto 0));
|
|
ConfigRead(x"010010", maintData(2)(63 downto 32));
|
|
ConfigRead(x"010014", maintData(2)(31 downto 0));
|
|
ConfigRead(x"010018", maintData(3)(63 downto 32));
|
|
ConfigRead(x"01001c", maintData(3)(31 downto 0));
|
|
ConfigRead(x"010020", maintData(4)(63 downto 32));
|
|
ConfigRead(x"010024", maintData(4)(31 downto 0));
|
|
ConfigRead(x"010028", maintData(5)(63 downto 32));
|
|
ConfigRead(x"01002c", maintData(5)(31 downto 0));
|
|
ConfigRead(x"010030", maintData(6)(63 downto 32));
|
|
ConfigRead(x"010034", maintData(6)(31 downto 0));
|
|
ConfigRead(x"010038", maintData(7)(63 downto 32));
|
|
ConfigRead(x"01003c", maintData(7)(31 downto 0));
|
|
|
ReadConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
tid=>x"06", address=>x"010000", data=>x"deadbeef");
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0000",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000010000000000000",
|
|
wdptr=>'1',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"dead", sourceId=>x"0000",
|
|
payload=>RioMaintenance(transaction=>"0010",
|
|
size=>"0000",
|
|
tid=>x"ef",
|
|
hopCount=>x"ff",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
|
configStbExpected <= '1';
|
ExchangeFrames;
|
configWeExpected <= '1';
|
TestWait(messageEmpty, '1', "config read");
|
configAddrExpected <= x"010004";
|
|
configDataWriteExpected <= x"c0debabe";
|
|
|
|
WriteConfig32(portIndex=>6, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
CreateRandomPayload(maintData, seed1, seed2);
|
tid=>x"06", address=>x"010004", data=>x"c0debabe");
|
ConfigWrite(x"010000", maintData(0)(63 downto 32));
|
|
ConfigWrite(x"010004", maintData(0)(31 downto 0));
|
|
ConfigWrite(x"010008", maintData(1)(63 downto 32));
|
|
ConfigWrite(x"01000c", maintData(1)(31 downto 0));
|
|
ConfigWrite(x"010010", maintData(2)(63 downto 32));
|
|
ConfigWrite(x"010014", maintData(2)(31 downto 0));
|
|
ConfigWrite(x"010018", maintData(3)(63 downto 32));
|
|
ConfigWrite(x"01001c", maintData(3)(31 downto 0));
|
|
ConfigWrite(x"010020", maintData(4)(63 downto 32));
|
|
ConfigWrite(x"010024", maintData(4)(31 downto 0));
|
|
ConfigWrite(x"010028", maintData(5)(63 downto 32));
|
|
ConfigWrite(x"01002c", maintData(5)(31 downto 0));
|
|
ConfigWrite(x"010030", maintData(6)(63 downto 32));
|
|
ConfigWrite(x"010034", maintData(6)(31 downto 0));
|
|
ConfigWrite(x"010038", maintData(7)(63 downto 32));
|
|
ConfigWrite(x"01003c", maintData(7)(31 downto 0));
|
|
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0001",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000010000000000000",
|
|
wdptr=>'1',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"dead", sourceId=>x"0000",
|
|
payload=>RioMaintenance(transaction=>"0011",
|
|
size=>"0000",
|
|
tid=>x"ef",
|
|
hopCount=>x"ff",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ExchangeFrames;
|
|
TestWait(messageEmpty, '1', "config read");
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("TG_RioSwitch-TC2");
|
PrintS("TG_RioSwitch-TC2");
|
PrintS("Description: Test the configuration of the routing table and the ");
|
PrintS("Description: Test the configuration of the routing table and the ");
|
PrintS(" routing of packets.");
|
PrintS(" routing of packets.");
|
PrintS("Requirement: XXXXX");
|
PrintS("Requirement: XXXXX");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 1:");
|
PrintS("Step 1:");
|
PrintS("Action: Configure the routing table for address 0->port 1.");
|
PrintS("Action: Configure the routing table for address 0->port 1.");
|
PrintS("Result: A packet to address 0 should be forwarded to port 1.");
|
PrintS("Result: A packet to address 0 should be forwarded to port 1.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC2-Step1");
|
PrintR("TG_RioSwitch-TC2-Step1");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"07", address=>x"000070", data=>x"00000000");
|
tid=>x"07", address=>x"000070", data=>x"00000000");
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"08", address=>x"000074", data=>x"00000001");
|
tid=>x"08", address=>x"000074", data=>x"00000001");
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"09", address=>x"000074", data=>x"00000001");
|
tid=>x"09", address=>x"000074", data=>x"00000001");
|
|
|
-- Send a frame from a port and check if it is correctly routed.
|
-- Send a frame from a port and check if it is correctly routed.
|
randomPayload.length := 3;
|
randomPayload.length := 3;
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
RouteFrame(sourcePortIndex=>0, destinationPortIndex=>1,
|
RouteFrame(sourcePortIndex=>0, destinationPortIndex=>1,
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 2:");
|
PrintS("Step 2:");
|
PrintS("Action: Test the configuration of the default route->port 6.");
|
PrintS("Action: Test the configuration of the default route->port 2.");
|
PrintS("Result: An unknown address should be routed to port 6.");
|
PrintS("Result: An unknown address should be routed to port 2.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC2-Step2");
|
PrintR("TG_RioSwitch-TC2-Step2");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"0a", address=>x"000078", data=>x"00000000");
|
tid=>x"0a", address=>x"000078", data=>x"00000000");
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
WriteConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"0b", address=>x"000078", data=>x"00000006");
|
tid=>x"0b", address=>x"000078", data=>x"00000002");
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
ReadConfig32(portIndex=>0, destinationId=>x"0000", sourceId=>x"0002", hop=>x"00",
|
tid=>x"0c", address=>x"000078", data=>x"00000006");
|
tid=>x"0c", address=>x"000078", data=>x"00000002");
|
|
ExchangeFrames;
|
|
|
-- Send a frame from a port and check if it is correctly routed.
|
-- Send a frame from a port and check if it is correctly routed.
|
randomPayload.length := 4;
|
randomPayload.length := 4;
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
RouteFrame(sourcePortIndex=>1, destinationPortIndex=>6,
|
RouteFrame(sourcePortIndex=>1, destinationPortIndex=>2,
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
|
|
ExchangeFrames;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
|
PrintS("Step 3:");
|
|
PrintS("Action: Test to route a maintenance read request from port 2, ");
|
|
PrintS(" address 0.");
|
|
PrintS("Result: The packet should be routed to port 1 and hop decremented.");
|
|
---------------------------------------------------------------------------
|
|
PrintR("TG_RioSwitch-TC2-Step3");
|
|
---------------------------------------------------------------------------
|
|
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0000",
|
|
size=>"1000",
|
|
tid=>x"be",
|
|
hopCount=>x"01",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(1, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0000",
|
|
size=>"1000",
|
|
tid=>x"be",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ExchangeFrames;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
|
PrintS("Step 4:");
|
|
PrintS("Action: Test to route a maintenance write request from port 2, ");
|
|
PrintS(" address 0.");
|
|
PrintS("Result: The packet should be routed to port 1 and hop decremented.");
|
|
---------------------------------------------------------------------------
|
|
PrintR("TG_RioSwitch-TC2-Step4");
|
|
---------------------------------------------------------------------------
|
|
|
|
CreateRandomPayload(maintData, seed1, seed2);
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0001",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"01",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'1',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(1, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0001",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'1',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
ExchangeFrames;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
|
PrintS("Step 5:");
|
|
PrintS("Action: Test to route a maintenance read response from port 2, ");
|
|
PrintS(" address 0.");
|
|
PrintS("Result: The packet should be routed to port 1 and hop decremented.");
|
|
---------------------------------------------------------------------------
|
|
PrintR("TG_RioSwitch-TC2-Step5");
|
|
---------------------------------------------------------------------------
|
|
|
|
CreateRandomPayload(maintData, seed1, seed2);
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0010",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"01",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(1, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000",sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0010",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
ExchangeFrames;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
|
PrintS("Step 6:");
|
|
PrintS("Action: Test to route a maintenance write response from port 2, ");
|
|
PrintS(" address 0.");
|
|
PrintS("Result: The packet should be routed to port 1 and hop decremented.");
|
|
---------------------------------------------------------------------------
|
|
PrintR("TG_RioSwitch-TC2-Step6");
|
|
---------------------------------------------------------------------------
|
|
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0011",
|
|
size=>"1000",
|
|
tid=>x"ef",
|
|
hopCount=>x"01",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(1, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0011",
|
|
size=>"1000",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
ExchangeFrames;
|
|
|
|
---------------------------------------------------------------------------
|
|
PrintS("-----------------------------------------------------------------");
|
|
PrintS("Step 7:");
|
|
PrintS("Action: ");
|
|
PrintS("Result: ");
|
|
---------------------------------------------------------------------------
|
|
PrintR("TG_RioSwitch-TC2-Step7");
|
|
---------------------------------------------------------------------------
|
|
|
|
maintData(0) := x"0123456789abcdef";
|
|
maintData(1) := x"0011223344550100";
|
|
maintData(2) := x"1000011800000302";
|
|
maintData(3) := x"0000000000000000";
|
|
maintData(4) := x"0000000000000000";
|
|
maintData(5) := x"0000000000000000";
|
|
maintData(6) := x"0000000000000800";
|
|
maintData(7) := x"0000000000000000";
|
|
|
|
SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"0000", sourceId=>x"dead",
|
|
payload=>RioMaintenance(transaction=>"0001",
|
|
size=>"1100",
|
|
tid=>x"ef",
|
|
hopCount=>x"00",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'1',
|
|
dataLength=>8,
|
|
data=>maintData)));
|
|
|
|
ReceiveFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
|
|
tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
|
|
destId=>x"dead", sourceId=>x"0000",
|
|
payload=>RioMaintenance(transaction=>"0011",
|
|
size=>"0000",
|
|
tid=>x"ef",
|
|
hopCount=>x"ff",
|
|
configOffset=>"000000000000000000000",
|
|
wdptr=>'0',
|
|
dataLength=>0,
|
|
data=>maintData)));
|
|
|
|
ExchangeFrames;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("TG_RioSwitch-TC3");
|
PrintS("TG_RioSwitch-TC3");
|
PrintS("Description: Test the routing of normal packets.");
|
PrintS("Description: Test the routing of normal packets.");
|
PrintS("Requirement: XXXXX");
|
PrintS("Requirement: XXXXX");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 1:");
|
PrintS("Step 1:");
|
PrintS("Action: Send two packets but not the same time.");
|
PrintS("Action: Send two packets but not the same time.");
|
PrintS("Result: Both packets should be received at the expected ports.");
|
PrintS("Result: Both packets should be received at the expected ports.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC3-Step1");
|
PrintR("TG_RioSwitch-TC3-Step1");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
-- Frame on port 0 to port 1.
|
-- Frame on port 0 to port 1.
|
randomPayload.length := 3;
|
randomPayload.length := 3;
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
SendFrame(portIndex=>0,
|
SendFrame(portIndex=>0,
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
destinationId=>x"0000", sourceId=>x"ffff", payload=>randomPayload);
|
ReceiveFrame(portIndex=>1,
|
ReceiveFrame(portIndex=>1,
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
destinationId=>x"0000", sourceId=>x"ffff", payload=>randomPayload);
|
|
|
-- Frame on port 1 to port 6.
|
-- Frame on port 1 to port 6.
|
randomPayload.length := 4;
|
randomPayload.length := 4;
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
SendFrame(portIndex=>1,
|
SendFrame(portIndex=>1,
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
|
destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload);
|
ReceiveFrame(portIndex=>6,
|
ReceiveFrame(portIndex=>6,
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
|
destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload);
|
|
|
wait until frameComplete(1) = '1';
|
ExchangeFrames;
|
frameValid(1) <= '0';
|
|
wait until frameReceived(6) = '1';
|
|
frameExpected(6) <= '0';
|
|
|
|
wait until frameComplete(0) = '1';
|
|
frameValid(0) <= '0';
|
|
wait until frameReceived(1) = '1';
|
|
frameExpected(1) <= '0';
|
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintS("-----------------------------------------------------------------");
|
PrintS("-----------------------------------------------------------------");
|
PrintS("Step 2:");
|
PrintS("Step 2:");
|
PrintS("Action: Send two packets to the same port with is full and one to");
|
PrintS("Action: Send two packets to the same port with is full and one to");
|
PrintS(" another that is also full. Then receive the packets one at");
|
PrintS(" another that is also full. Then receive the packets one at");
|
PrintS(" a time.");
|
PrintS(" a time.");
|
PrintS("Result: The packet to the port that is ready should go though.");
|
PrintS("Result: The packet to the port that is ready should go though.");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
PrintR("TG_RioSwitch-TC3-Step2");
|
PrintR("TG_RioSwitch-TC3-Step2");
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
-- Frame on port 0 to port 1.
|
-- Frame on port 0 to port 1.
|
randomPayload.length := 5;
|
randomPayload.length := 5;
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
CreateRandomPayload(randomPayload.data, seed1, seed2);
|
SendFrame(portIndex=>0,
|
RouteFrame(sourcePortIndex=>0, destinationPortIndex=>1,
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
destinationId=>x"0000", sourceId=>x"ffff", payload=>randomPayload);
|
|
|
-- Frame on port 1 to port 6.
|
-- Frame on port 1 to port 2.
|
randomPayload1.length := 6;
|
randomPayload1.length := 6;
|
CreateRandomPayload(randomPayload1.data, seed1, seed2);
|
CreateRandomPayload(randomPayload1.data, seed1, seed2);
|
SendFrame(portIndex=>1,
|
RouteFrame(sourcePortIndex=>2, destinationPortIndex=>2,
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload1);
|
destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload1);
|
|
|
-- Frame on port 2 to port 6.
|
-- Frame on port 2 to port 2.
|
randomPayload2.length := 7;
|
randomPayload2.length := 7;
|
CreateRandomPayload(randomPayload2.data, seed1, seed2);
|
CreateRandomPayload(randomPayload2.data, seed1, seed2);
|
SendFrame(portIndex=>2,
|
RouteFrame(sourcePortIndex=>2, destinationPortIndex=>2,
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload2);
|
destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload2);
|
|
|
|
writeFrameFull <= (others=>'1');
|
wait for 10 us;
|
wait for 10 us;
|
|
|
ReceiveFrame(portIndex=>1,
|
writeFrameFull(1) <= '0';
|
sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
|
|
wait until frameComplete(0) = '1';
|
|
frameValid(0) <= '0';
|
|
wait until frameReceived(1) = '1';
|
|
frameExpected(1) <= '0';
|
|
|
|
wait for 10 us;
|
wait for 10 us;
|
|
|
ReceiveFrame(portIndex=>6,
|
writeFrameFull(2) <= '0';
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload1);
|
|
wait until frameComplete(1) = '1';
|
|
frameValid(1) <= '0';
|
|
wait until frameReceived(6) = '1';
|
|
frameExpected(6) <= '0';
|
|
|
|
wait for 10 us;
|
wait for 10 us;
|
|
|
ReceiveFrame(portIndex=>6,
|
ExchangeFrames;
|
sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload2);
|
|
wait until frameComplete(2) = '1';
|
|
frameValid(2) <= '0';
|
|
wait until frameReceived(6) = '1';
|
|
frameExpected(6) <= '0';
|
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
-- Test completed.
|
-- Test completed.
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
|
|
wait for 10 us;
|
|
|
|
assert readContentEmpty = "1111111"
|
|
report "Pending frames exist." severity error;
|
|
|
|
TestEnd;
|
TestEnd;
|
end process;
|
end process;
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Instantiate a process receiving the configuration accesses to the
|
-- Instantiate a process receiving the configuration accesses to the
|
-- implementation defined space.
|
-- implementation defined space.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
process
|
|
begin
|
TestWishbone: TestPortWishbone
|
loop
|
generic map(ADDRESS_WIDTH=>24, SEL_WIDTH=>1, DATA_WIDTH=>32)
|
wait until configStb = '1' and clk'event and clk = '1';
|
port map(
|
assert configStb = configStbExpected report "Unexpected configStb." severity error;
|
clk=>clk, areset_n=>areset_n,
|
assert configWe = configWeExpected report "Unexpected configWe." severity error;
|
messageEmpty_o=>messageEmpty,
|
assert configAddr = configAddrExpected report "Unexpected configAddr." severity error;
|
messageWrite_i=>messageWrite,
|
if (configWe = '1') then
|
message_i=>message,
|
assert configDataWrite = configDataWriteExpected report "Unexpected configDataWrite." severity error;
|
messageAck_o=>messageAck,
|
else
|
cyc_i=>configStb,
|
configDataRead <= configDataReadExpected;
|
stb_i=>configStb,
|
end if;
|
we_i=>configWe,
|
end loop;
|
adr_i=>configAddr,
|
end process;
|
sel_i=>"0",
|
|
dat_i=>configDataWrite,
|
|
dat_o=>configDataRead,
|
|
err_o=>open,
|
|
ack_o=>configAck);
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Instantiate the test port array.
|
-- Instantiate the test port array.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
|
inboundEmpty2 <= inboundEmpty(2);
|
|
inboundEmpty1 <= inboundEmpty(1);
|
|
inboundEmpty0 <= inboundEmpty(0);
|
|
inboundWrite <= inboundWrite2 & inboundWrite1 & inboundWrite0;
|
|
inboundMessage <= inboundMessage2 & inboundMessage1 & inboundMessage0;
|
|
inboundAck2 <= inboundAck(2);
|
|
inboundAck1 <= inboundAck(1);
|
|
inboundAck0 <= inboundAck(0);
|
|
outboundEmpty2 <= outboundEmpty(2);
|
|
outboundEmpty1 <= outboundEmpty(1);
|
|
outboundEmpty0 <= outboundEmpty(0);
|
|
outboundWrite <= outboundWrite2 & outboundWrite1 & outboundWrite0;
|
|
outboundMessage <= outboundMessage2 & outboundMessage1 & outboundMessage0;
|
|
outboundAck2 <= outboundAck(2);
|
|
outboundAck1 <= outboundAck(1);
|
|
outboundAck0 <= outboundAck(0);
|
TestPortGeneration: for portIndex in 0 to PORTS-1 generate
|
TestPortGeneration: for portIndex in 0 to PORTS-1 generate
|
TestPortInst: TestPort
|
TestPortPacketBufferInst: TestPortPacketBuffer
|
|
generic map(READ_CONTENT_END_DATA_VALID=>false)
|
port map(
|
port map(
|
clk=>clk, areset_n=>areset_n,
|
clk=>clk, areset_n=>areset_n,
|
frameValid_i=>frameValid(portIndex),
|
readEmpty_o=>inboundEmpty(portIndex),
|
frameWrite_i=>frameWrite(portIndex),
|
readWrite_i=>inboundWrite(portIndex),
|
frameComplete_o=>frameComplete(portIndex),
|
readMessage_i=>inboundMessage(portIndex),
|
frameExpected_i=>frameExpected(portIndex),
|
readAck_o=>inboundAck(portIndex),
|
frameRead_i=>frameRead(portIndex),
|
writeEmpty_o=>outboundEmpty(portIndex),
|
frameReceived_o=>frameReceived(portIndex),
|
writeWrite_i=>outboundWrite(portIndex),
|
|
writeMessage_i=>outboundMessage(portIndex),
|
|
writeAck_o=>outboundAck(portIndex),
|
readFrameEmpty_o=>readFrameEmpty(portIndex),
|
readFrameEmpty_o=>readFrameEmpty(portIndex),
|
readFrame_i=>readFrame(portIndex),
|
readFrame_i=>readFrame(portIndex),
|
readFrameRestart_i=>readFrameRestart(portIndex),
|
readFrameRestart_i=>'0',
|
readFrameAborted_o=>readFrameAborted(portIndex),
|
readFrameAborted_o=>readFrameAborted(portIndex),
|
|
readWindowEmpty_o=>open,
|
|
readWindowReset_i=>'0',
|
|
readWindowNext_i=>readFrame(portIndex),
|
readContentEmpty_o=>readContentEmpty(portIndex),
|
readContentEmpty_o=>readContentEmpty(portIndex),
|
readContent_i=>readContent(portIndex),
|
readContent_i=>readContent(portIndex),
|
readContentEnd_o=>readContentEnd(portIndex),
|
readContentEnd_o=>readContentEnd(portIndex),
|
readContentData_o=>readContentData(portIndex),
|
readContentData_o=>readContentData(portIndex),
|
writeFrameFull_o=>writeFrameFull(portIndex),
|
|
writeFrame_i=>writeFrame(portIndex),
|
writeFrame_i=>writeFrame(portIndex),
|
writeFrameAbort_i=>writeFrameAbort(portIndex),
|
writeFrameAbort_i=>writeFrameAbort(portIndex),
|
writeContent_i=>writeContent(portIndex),
|
writeContent_i=>writeContent(portIndex),
|
writeContentData_i=>writeContentData(portIndex));
|
writeContentData_i=>writeContentData(portIndex));
|
end generate;
|
end generate;
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Instantiate the switch.
|
-- Instantiate the switch.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
|
|
TestSwitch: RioSwitch
|
TestSwitch: RioSwitch
|
generic map(
|
generic map(
|
SWITCH_PORTS=>7,
|
SWITCH_PORTS=>PORTS,
|
DEVICE_IDENTITY=>SWITCH_IDENTITY,
|
DEVICE_IDENTITY=>SWITCH_IDENTITY,
|
DEVICE_VENDOR_IDENTITY=>SWITCH_VENDOR_IDENTITY,
|
DEVICE_VENDOR_IDENTITY=>SWITCH_VENDOR_IDENTITY,
|
DEVICE_REV=>SWITCH_REV,
|
DEVICE_REV=>SWITCH_REV,
|
ASSY_IDENTITY=>SWITCH_ASSY_IDENTITY,
|
ASSY_IDENTITY=>SWITCH_ASSY_IDENTITY,
|
ASSY_VENDOR_IDENTITY=>SWITCH_ASSY_VENDOR_IDENTITY,
|
ASSY_VENDOR_IDENTITY=>SWITCH_ASSY_VENDOR_IDENTITY,
|
ASSY_REV=>SWITCH_ASSY_REV)
|
ASSY_REV=>SWITCH_ASSY_REV)
|
port map(
|
port map(
|
clk=>clk, areset_n=>areset_n,
|
clk=>clk, areset_n=>areset_n,
|
writeFrameFull_i=>writeFrameFull,
|
writeFrameFull_i=>writeFrameFull,
|
writeFrame_o=>writeFrame, writeFrameAbort_o=>writeFrameAbort,
|
writeFrame_o=>writeFrame, writeFrameAbort_o=>writeFrameAbort,
|
writeContent_o=>writeContent, writeContentData_o=>writeContentData,
|
writeContent_o=>writeContent, writeContentData_o=>writeContentData,
|
readFrameEmpty_i=>readFrameEmpty,
|
readFrameEmpty_i=>readFrameEmpty,
|
readFrame_o=>readFrame, readFrameRestart_o=>readFrameRestart,
|
readFrame_o=>readFrame, readFrameRestart_o=>readFrameRestart,
|
readFrameAborted_i=>readFrameAborted,
|
readFrameAborted_i=>readFrameAborted,
|
readContentEmpty_i=>readContentEmpty,
|
readContentEmpty_i=>readContentEmpty,
|
readContent_o=>readContent, readContentEnd_i=>readContentEnd,
|
readContent_o=>readContent, readContentEnd_i=>readContentEnd,
|
readContentData_i=>readContentData,
|
readContentData_i=>readContentData,
|
portLinkTimeout_o=>portLinkTimeout,
|
portLinkTimeout_o=>portLinkTimeout,
|
linkInitialized_i=>linkInitialized,
|
linkInitialized_i=>linkInitialized,
|
outputPortEnable_o=>outputPortEnable, inputPortEnable_o=>inputPortEnable,
|
outputPortEnable_o=>outputPortEnable, inputPortEnable_o=>inputPortEnable,
|
localAckIdWrite_o=>localAckIdWrite,
|
localAckIdWrite_o=>localAckIdWrite,
|
clrOutstandingAckId_o=>clrOutstandingAckId,
|
clrOutstandingAckId_o=>clrOutstandingAckId,
|
inboundAckId_o=>inboundAckIdWrite,
|
inboundAckId_o=>inboundAckIdWrite,
|
outstandingAckId_o=>outstandingAckIdWrite,
|
outstandingAckId_o=>outstandingAckIdWrite,
|
outboundAckId_o=>outboundAckIdWrite,
|
outboundAckId_o=>outboundAckIdWrite,
|
inboundAckId_i=>inboundAckIdRead,
|
inboundAckId_i=>inboundAckIdRead,
|
outstandingAckId_i=>outstandingAckIdRead,
|
outstandingAckId_i=>outstandingAckIdRead,
|
outboundAckId_i=>outboundAckIdRead,
|
outboundAckId_i=>outboundAckIdRead,
|
configStb_o=>configStb, configWe_o=>configWe, configAddr_o=>configAddr,
|
configStb_o=>configStb, configWe_o=>configWe, configAddr_o=>configAddr,
|
configData_o=>configDataWrite, configData_i=>configDataRead);
|
configData_o=>configDataWrite, configData_i=>configDataRead, configAck_i=>configAck);
|
|
|
|
|
end architecture;
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
--
|
|
-------------------------------------------------------------------------------
|
|
-- REMARK: Add support for testing partially complete frames, cut-through-routing...
|
|
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
use ieee.numeric_std.all;
|
|
library std;
|
|
use std.textio.all;
|
|
use work.rio_common.all;
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
--
|
|
-------------------------------------------------------------------------------
|
|
entity TestPort is
|
|
port(
|
|
clk : in std_logic;
|
|
areset_n : in std_logic;
|
|
|
|
frameValid_i : in std_logic;
|
|
frameWrite_i : in RioFrame;
|
|
frameComplete_o : out std_logic;
|
|
|
|
frameExpected_i : in std_logic;
|
|
frameRead_i : in RioFrame;
|
|
frameReceived_o : out std_logic;
|
|
|
|
readFrameEmpty_o : out std_logic;
|
|
readFrame_i : in std_logic;
|
|
readFrameRestart_i : in std_logic;
|
|
readFrameAborted_o : out std_logic;
|
|
readContentEmpty_o : out std_logic;
|
|
readContent_i : in std_logic;
|
|
readContentEnd_o : out std_logic;
|
|
readContentData_o : out std_logic_vector(31 downto 0);
|
|
|
|
writeFrameFull_o : out std_logic;
|
|
writeFrame_i : in std_logic;
|
|
writeFrameAbort_i : in std_logic;
|
|
writeContent_i : in std_logic;
|
|
writeContentData_i : in std_logic_vector(31 downto 0));
|
|
end entity;
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
--
|
|
-------------------------------------------------------------------------------
|
|
architecture TestPortImpl of TestPort is
|
|
begin
|
|
|
|
-----------------------------------------------------------------------------
|
|
--
|
|
-----------------------------------------------------------------------------
|
|
FrameReader: process
|
|
type StateType is (STATE_IDLE, STATE_WRITE);
|
|
variable state : StateType;
|
|
variable frameIndex : natural range 0 to 69;
|
|
begin
|
|
writeFrameFull_o <= '1';
|
|
frameReceived_o <= '0';
|
|
wait until areset_n = '1';
|
|
|
|
state := STATE_IDLE;
|
|
|
|
loop
|
|
wait until clk'event and clk = '1';
|
|
|
|
case state is
|
|
|
|
when STATE_IDLE =>
|
|
frameReceived_o <= '0';
|
|
if (frameExpected_i = '1') then
|
|
writeFrameFull_o <= '0';
|
|
state := STATE_WRITE;
|
|
frameIndex := 0;
|
|
else
|
|
writeFrameFull_o <= '1';
|
|
end if;
|
|
assert writeFrame_i = '0' report "Unexpected frame." severity error;
|
|
assert writeFrameAbort_i = '0' report "Unexpected frame abort." severity error;
|
|
assert writeContent_i = '0' report "Unexpected data." severity error;
|
|
|
|
when STATE_WRITE =>
|
|
if (writeContent_i = '1') then
|
|
-- Writing content.
|
|
if (frameIndex < frameRead_i.length) then
|
|
assert writeContentData_i = frameRead_i.payload(frameIndex)
|
|
report "Unexpected frame content received:" &
|
|
" index=" & integer'image(frameIndex) &
|
|
" expected=" & integer'image(to_integer(unsigned(frameRead_i.payload(frameIndex)))) &
|
|
" got=" & integer'image(to_integer(unsigned(writeContentData_i)))
|
|
severity error;
|
|
|
|
frameIndex := frameIndex + 1;
|
|
else
|
|
report "Unexpected frame content received:" &
|
|
" index=" & integer'image(frameIndex) &
|
|
" expected=" & integer'image(to_integer(unsigned(frameRead_i.payload(frameIndex)))) &
|
|
" got=" & integer'image(to_integer(unsigned(writeContentData_i)))
|
|
severity error;
|
|
|
|
frameIndex := frameIndex + 1;
|
|
end if;
|
|
else
|
|
-- Not writing any content.
|
|
end if;
|
|
|
|
if (writeFrame_i = '1') then
|
|
-- Writing a complete frame.
|
|
assert frameIndex = frameRead_i.length report "Unexpected frame length received." severity error;
|
|
state := STATE_IDLE;
|
|
frameReceived_o <= '1';
|
|
writeFrameFull_o <= '1';
|
|
else
|
|
-- Not writing any frame.
|
|
end if;
|
|
|
|
if (writeFrameAbort_i = '1') then
|
|
-- The frame should be aborted.
|
|
frameIndex := 0;
|
|
else
|
|
-- Not aborting any frame.
|
|
end if;
|
|
end case;
|
|
end loop;
|
|
end process;
|
|
|
|
-----------------------------------------------------------------------------
|
|
--
|
|
-----------------------------------------------------------------------------
|
|
-- REMARK: add support for these signals...
|
|
-- readFrameEmpty_i : in std_logic;
|
|
-- readFrameAborted_i : in std_logic;
|
|
FrameSender: process
|
|
type StateType is (STATE_IDLE, STATE_READ);
|
|
variable state : StateType;
|
|
variable frameIndex : natural range 0 to 69;
|
|
begin
|
|
readFrameEmpty_o <= '1';
|
|
readFrameAborted_o <= '0';
|
|
readContentEmpty_o <= '1';
|
|
readContentEnd_o <= '1';
|
|
readContentData_o <= (others => 'U');
|
|
frameComplete_o <= '0';
|
|
wait until areset_n = '1';
|
|
|
|
state := STATE_IDLE;
|
|
|
|
loop
|
|
wait until clk'event and clk = '1';
|
|
|
|
case state is
|
|
|
|
when STATE_IDLE =>
|
|
frameComplete_o <= '0';
|
|
if (frameValid_i = '1') then
|
|
state := STATE_READ;
|
|
frameIndex := 0;
|
|
readContentEmpty_o <= '0';
|
|
readFrameEmpty_o <= '0';
|
|
else
|
|
readContentEmpty_o <= '1';
|
|
end if;
|
|
|
|
when STATE_READ =>
|
|
if (readFrameRestart_i = '1') then
|
|
readContentEnd_o <= '0';
|
|
frameIndex := 0;
|
|
else
|
|
-- Not restarting a frame.
|
|
end if;
|
|
|
|
if (readContent_i = '1') then
|
|
if (frameIndex < frameWrite_i.length) then
|
|
readContentData_o <= frameWrite_i.payload(frameIndex);
|
|
readContentEnd_o <= '0';
|
|
frameIndex := frameIndex + 1;
|
|
elsif (frameIndex = frameWrite_i.length) then
|
|
readContentEnd_o <= '1';
|
|
else
|
|
report "Reading empty frame." severity error;
|
|
end if;
|
|
else
|
|
-- Not reading data.
|
|
end if;
|
|
|
|
if (readFrame_i = '1') then
|
|
state := STATE_IDLE;
|
|
assert frameIndex = frameWrite_i.length report "Unread frame data discarded." severity error;
|
|
frameComplete_o <= '1';
|
|
readFrameEmpty_o <= '1';
|
|
readContentEmpty_o <= '1';
|
|
readContentData_o <= (others => 'U');
|
|
else
|
|
-- Not reading a frame.
|
|
end if;
|
|
|
|
end case;
|
|
end loop;
|
|
end process;
|
|
|
|
end architecture;
|
end architecture;
|
|
|