OpenCores
URL https://opencores.org/ocsvn/rio/rio/trunk

Subversion Repositories rio

[/] [rio/] [branches/] [2.0.0-development/] [bench/] [vhdl/] [TestRioSwitch.vhd] - Diff between revs 48 and 51

Show entire file | Details | Blame | View Log

Rev 48 Rev 51
Line 8... Line 8...
-- 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:
-- - Test all sizes of packets that go through the maintenance port.
-- - Test all sizes of packets that go through the maintenance port.
 
-- - Make sure all testcases from the 1.0 branch is in here.
-- 
-- 
-- Author(s): 
-- Author(s): 
-- - Magnus Rosenius, magro732@opencores.org 
-- - Magnus Rosenius, magro732@opencores.org 
-- 
-- 
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Line 87... Line 88...
      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);
 
      readFrameAborted_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);
Line 170... Line 168...
  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 readFrameAborted : 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);
Line 381... Line 376...
                                                                     dataLength=>0,
                                                                     dataLength=>0,
                                                                     data=>maintData)));
                                                                     data=>maintData)));
    end procedure;
    end procedure;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
    -- Set a route table entry.
 
    ---------------------------------------------------------------------------
 
    procedure RouteSet(constant deviceId : std_logic_vector(15 downto 0);
 
                       constant portIndex : std_logic_vector(7 downto 0)) is
 
      variable frame : RioFrame;
 
    begin
 
      WriteConfig32(portIndex=>0, destinationId=>x"ffff", sourceId=>x"ffff", hop=>x"00",
 
                    tid=>x"de", address=>x"000070", data=>(x"0000" & deviceId));
 
      WriteConfig32(portIndex=>0, destinationId=>x"ffff", sourceId=>x"ffff", hop=>x"00",
 
                    tid=>x"ad", address=>x"000074", data=>(x"000000" & portIndex));
 
    end procedure;
 
 
 
    ---------------------------------------------------------------------------
 
    -- Set the default route table entry.
 
    ---------------------------------------------------------------------------
 
    procedure RouteSetDefault(constant portIndex : std_logic_vector(7 downto 0)) is
 
      variable frame : RioFrame;
 
    begin
 
      WriteConfig32(portIndex=>0, destinationId=>x"ffff", sourceId=>x"ffff", hop=>x"00",
 
                    tid=>x"ad", address=>x"000078", data=>(x"000000" & portIndex));
 
    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);
Line 478... Line 496...
    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("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("TG_RioSwitch");
    TestSpec("TG_RioSwitch");
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("TG_RioSwitch-TC1");
    TestSpec("TG_RioSwitch-TC1");
    PrintS("Description: Test switch maintenance accesses on different ports.");
    TestSpec("Description: Test switch maintenance accesses on different ports.");
    PrintS("Requirement: XXXXX");
    TestSpec("Requirement: XXXXX");
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 1:");
    TestSpec("Step 1:");
    PrintS("Action: Send maintenance read request packets to read switch identity.");
    TestSpec("Action: Send maintenance read request packets to read switch identity.");
    PrintS("Result: The switch should answer with its configured identitiy.");
    TestSpec("Result: The switch should answer with its configured identitiy.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step1");
    TestCaseStart("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",
Line 504... Line 522...
                 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;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 2:");
    TestSpec("Step 2:");
    PrintS("Action: Check the switch Processing Element Features.");
    TestSpec("Action: Check the switch Processing Element Features.");
    PrintS("Result: The expected switch features should be returned. ");
    TestSpec("Result: The expected switch features should be returned. ");
    PrintS("        Switch with extended features pointer valid. Common ");
    TestSpec("        Switch with extended features pointer valid. Common ");
    PrintS("        transport large system support and standard route table ");
    TestSpec("        transport large system support and standard route table ");
    PrintS("        configuration support.");
    TestSpec("        configuration support.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step2");
    TestCaseStart("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;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 3:");
    TestSpec("Step 3:");
    PrintS("Action: Check the switch port information.");
    TestSpec("Action: Check the switch port information.");
    PrintS("Result: The expected port and number of ports should be returned.");
    TestSpec("Result: The expected port and number of ports should be returned.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step3");
    TestCaseStart("TG_RioSwitch-TC1-Step3");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    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"05", address=>x"000014", data=>x"00000302");
                 tid=>x"05", address=>x"000014", data=>x"00000302");
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 4:");
    TestSpec("Step 4:");
    PrintS("Action: Check the switch number of supported routes.");
    TestSpec("Action: Check the switch number of supported routes.");
    PrintS("Result: The expected number of supported routes should be returned.");
    TestSpec("Result: The expected number of supported routes should be returned.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step4");
    TestCaseStart("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;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 5:");
    TestSpec("Step 5:");
    PrintS("Action: Test host base device id lock by reading it, then hold it ");
    TestSpec("Action: Test host base device id lock by reading it, then hold it ");
    PrintS("        and try to grab it from another address.");
    TestSpec("        and try to grab it from another address.");
    PrintS("Result: The value should follow the specification.");
    TestSpec("Result: The value should follow the specification.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step5");
    TestCaseStart("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");
Line 605... Line 623...
                 tid=>x"0a", address=>x"000068", data=>x"0000ffff");
                 tid=>x"0a", address=>x"000068", data=>x"0000ffff");
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 6");
    TestSpec("Step 6");
    PrintS("Action: Check the component tag register.");
    TestSpec("Action: Check the component tag register.");
    PrintS("Result: The written value in the component tag should be saved.");
    TestSpec("Result: The written value in the component tag should be saved.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step6");
    TestCaseStart("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");
 
 
Line 625... Line 643...
                 tid=>x"06", address=>x"00006c", data=>x"ffffffff");
                 tid=>x"06", address=>x"00006c", data=>x"ffffffff");
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 7");
    TestSpec("Step 7");
    PrintS("Action: Read and write to the port link timeout.");
    TestSpec("Action: Read and write to the port link timeout.");
    PrintS("Result: Check that the portLinkTimeout output from the switch changes.");
    TestSpec("Result: Check that the portLinkTimeout output from the switch changes.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step7");
    TestCaseStart("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",
Line 649... Line 667...
    ExchangeFrames;
    ExchangeFrames;
 
 
    assert portLinkTimeout = x"000001" report "Unexpected portLinkTimeout." severity error;
    assert portLinkTimeout = x"000001" report "Unexpected portLinkTimeout." severity error;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 8");
    TestSpec("Step 8");
    PrintS("Action: Read from the port general control.");
    TestSpec("Action: Read from the port general control.");
    PrintS("Result: Check the discovered bit.");
    TestSpec("Result: Check the discovered bit.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step8");
    TestCaseStart("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");
 
 
Line 675... Line 693...
                 tid=>x"06", address=>x"00013c", data=>x"00000000");
                 tid=>x"06", address=>x"00013c", data=>x"00000000");
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 9");
    TestSpec("Step 9");
    PrintS("Action: Read from the port N error and status.");
    TestSpec("Action: Read from the port N error and status.");
    PrintS("Result: Check the port ok and port uninitialized bits.");
    TestSpec("Result: Check the port ok and port uninitialized bits.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step9");
    TestCaseStart("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");
Line 711... Line 729...
    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;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 10");
    TestSpec("Step 10");
    PrintS("Action: Read and write to/from the port N control.");
    TestSpec("Action: Read and write to/from the port N control.");
    PrintS("Result: Check the output/input port enable.");
    TestSpec("Result: Check the output/input port enable.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step10");
    TestCaseStart("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;
 
 
Line 775... Line 793...
 
 
    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;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 11");
    TestSpec("Step 11");
    PrintS("Action: Read and write to/from the implementation defined space.");
    TestSpec("Action: Read and write to/from the implementation defined space.");
    PrintS("Result: Check the accesses on the external configuration port.");
    TestSpec("Result: Check the accesses on the external configuration port.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC1-Step11");
    TestCaseStart("TG_RioSwitch-TC1-Step11");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    CreateRandomPayload(maintData, seed1, seed2);
    CreateRandomPayload(maintData, seed1, seed2);
    ConfigRead(x"010000", maintData(0)(63 downto 32));
    ConfigRead(x"010000", maintData(0)(63 downto 32));
    ConfigRead(x"010004", maintData(0)(31 downto 0));
    ConfigRead(x"010004", maintData(0)(31 downto 0));
Line 874... Line 892...
 
 
    ExchangeFrames;
    ExchangeFrames;
    TestWait(messageEmpty, '1', "config write");
    TestWait(messageEmpty, '1', "config write");
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("TG_RioSwitch-TC2");
    TestSpec("TG_RioSwitch-TC2");
    PrintS("Description: Test the configuration of the routing table and the ");
    TestSpec("Description: Test the configuration of the routing table and the ");
    PrintS("             routing of packets.");
    TestSpec("             routing of packets.");
    PrintS("Requirement: XXXXX");
    TestSpec("Requirement: XXXXX");
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 1:");
    TestSpec("Step 1:");
    PrintS("Action: Configure the routing table for address 0->port 1.");
    TestSpec("Action: Configure the routing table for address 0->port 1.");
    PrintS("Result: A packet to address 0 should be forwarded to port 1.");
    TestSpec("Result: A packet to address 0 should be forwarded to port 1.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step1");
    TestCaseStart("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",
Line 903... Line 921...
               sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
               sourceId=>x"ffff", destinationId=>x"0000", payload=>randomPayload);
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 2:");
    TestSpec("Step 2:");
    PrintS("Action: Test the configuration of the default route->port 2.");
    TestSpec("Action: Test the configuration of the default route->port 2.");
    PrintS("Result: An unknown address should be routed to port 2.");
    TestSpec("Result: An unknown address should be routed to port 2.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step2");
    TestCaseStart("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",
Line 927... Line 945...
    RouteFrame(sourcePortIndex=>1, destinationPortIndex=>2,
    RouteFrame(sourcePortIndex=>1, destinationPortIndex=>2,
               sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
               sourceId=>x"0000", destinationId=>x"ffff", payload=>randomPayload);
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 3:");
    TestSpec("Step 3:");
    PrintS("Action: Test to route a maintenance read request from port 2, ");
    TestSpec("Action: Test to route a maintenance read request from port 2, ");
    PrintS("        address 0.");
    TestSpec("        address 0.");
    PrintS("Result: The packet should be routed to port 1 and hop decremented.");
    TestSpec("Result: The packet should be routed to port 1 and hop decremented.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step3");
    TestCaseStart("TG_RioSwitch-TC2-Step3");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                destId=>x"0000", sourceId=>x"dead",
                                destId=>x"0000", sourceId=>x"dead",
Line 963... Line 981...
                                                           data=>maintData)));
                                                           data=>maintData)));
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 4:");
    TestSpec("Step 4:");
    PrintS("Action: Test to route a maintenance write request from port 2, ");
    TestSpec("Action: Test to route a maintenance write request from port 2, ");
    PrintS("        address 0.");
    TestSpec("        address 0.");
    PrintS("Result: The packet should be routed to port 1 and hop decremented.");
    TestSpec("Result: The packet should be routed to port 1 and hop decremented.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step4");
    TestCaseStart("TG_RioSwitch-TC2-Step4");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    CreateRandomPayload(maintData, seed1, seed2);
    CreateRandomPayload(maintData, seed1, seed2);
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
Line 999... Line 1017...
                                                           dataLength=>8,
                                                           dataLength=>8,
                                                           data=>maintData)));
                                                           data=>maintData)));
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 5:");
    TestSpec("Step 5:");
    PrintS("Action: Test to route a maintenance read response from port 2, ");
    TestSpec("Action: Test to route a maintenance read response from port 2, ");
    PrintS("        address 0.");
    TestSpec("        address 0.");
    PrintS("Result: The packet should be routed to port 1 and hop decremented.");
    TestSpec("Result: The packet should be routed to port 1 and hop decremented.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step5");
    TestCaseStart("TG_RioSwitch-TC2-Step5");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    CreateRandomPayload(maintData, seed1, seed2);
    CreateRandomPayload(maintData, seed1, seed2);
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
Line 1035... Line 1053...
                                                           dataLength=>8,
                                                           dataLength=>8,
                                                           data=>maintData)));
                                                           data=>maintData)));
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 6:");
    TestSpec("Step 6:");
    PrintS("Action: Test to route a maintenance write response from port 2, ");
    TestSpec("Action: Test to route a maintenance write response from port 2, ");
    PrintS("        address 0.");
    TestSpec("        address 0.");
    PrintS("Result: The packet should be routed to port 1 and hop decremented.");
    TestSpec("Result: The packet should be routed to port 1 and hop decremented.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step6");
    TestCaseStart("TG_RioSwitch-TC2-Step6");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
    SendFrame(2, RioFrameCreate(ackId=>"00000", vc=>'0', crf=>'0', prio=>"00",
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                tt=>"01", ftype=>FTYPE_MAINTENANCE_CLASS,
                                destId=>x"0000", sourceId=>x"dead",
                                destId=>x"0000", sourceId=>x"dead",
Line 1070... Line 1088...
                                                           dataLength=>0,
                                                           dataLength=>0,
                                                           data=>maintData)));
                                                           data=>maintData)));
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 7:");
    TestSpec("Step 7:");
    PrintS("Action: ");
    TestSpec("Action: ");
    PrintS("Result: ");
    TestSpec("Result: ");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC2-Step7");
    TestCaseStart("TG_RioSwitch-TC2-Step7");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
    maintData(0) := x"0123456789abcdef";
    maintData(0) := x"0123456789abcdef";
    maintData(1) := x"0011223344550100";
    maintData(1) := x"0011223344550100";
    maintData(2) := x"1000011800000302";
    maintData(2) := x"1000011800000302";
Line 1114... Line 1132...
                                                           data=>maintData)));
                                                           data=>maintData)));
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("TG_RioSwitch-TC3");
    TestSpec("TG_RioSwitch-TC3");
    PrintS("Description: Test the routing of normal packets.");
    TestSpec("Description: Test the routing of normal packets.");
    PrintS("Requirement: XXXXX");
    TestSpec("Requirement: XXXXX");
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 1:");
    TestSpec("Step 1:");
    PrintS("Action: Send two packets but not the same time.");
    TestSpec("Action: Send two packets but not the same time.");
    PrintS("Result: Both packets should be received at the expected ports.");
    TestSpec("Result: Both packets should be received at the expected ports.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC3-Step1");
    TestCaseStart("TG_RioSwitch-TC3-Step1");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
 
 
 
    -- Setup the routing table for the following steps.
 
    RouteSet(x"0000", x"00");
 
    RouteSet(x"0001", x"00");
 
    RouteSet(x"0002", x"00");
 
    RouteSet(x"0003", x"00");
 
    RouteSet(x"0004", x"01");
 
    RouteSet(x"0005", x"02");
 
    RouteSet(x"0006", x"02");
 
    RouteSetDefault(x"02");
 
 
    -- 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,
              destinationId=>x"0000", sourceId=>x"ffff", payload=>randomPayload);
              destinationId=>x"0004", sourceId=>x"ffff", payload=>randomPayload);
    ReceiveFrame(portIndex=>1,
    ReceiveFrame(portIndex=>1,
                 destinationId=>x"0000", sourceId=>x"ffff", payload=>randomPayload);
                 destinationId=>x"0004", 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,
Line 1145... Line 1173...
                 destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload);
                 destinationId=>x"ffff", sourceId=>x"0000", payload=>randomPayload);
 
 
    ExchangeFrames;
    ExchangeFrames;
 
 
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintS("-----------------------------------------------------------------");
    TestSpec("-----------------------------------------------------------------");
    PrintS("Step 2:");
    TestSpec("Step 2:");
    PrintS("Action: Send two packets to the same port with is full and one to");
    TestSpec("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");
    TestSpec("        another that is also full. Then receive the packets one at");
    PrintS("        a time.");
    TestSpec("        a time.");
    PrintS("Result: The packet to the port that is ready should go though.");
    TestSpec("Result: The packet to the port that is ready should go though.");
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    PrintR("TG_RioSwitch-TC3-Step2");
    TestCaseStart("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);
Line 1249... Line 1277...
        writeMessage_i=>outboundMessage(portIndex),
        writeMessage_i=>outboundMessage(portIndex),
        writeAck_o=>outboundAck(portIndex),
        writeAck_o=>outboundAck(portIndex),
        readFrameEmpty_o=>readFrameEmpty(portIndex),
        readFrameEmpty_o=>readFrameEmpty(portIndex),
        readFrame_i=>readFrame(portIndex),
        readFrame_i=>readFrame(portIndex),
        readFrameRestart_i=>'0',
        readFrameRestart_i=>'0',
        readFrameAborted_o=>readFrameAborted(portIndex),
        readFrameAborted_o=>open,
        readWindowEmpty_o=>open,
        readWindowEmpty_o=>open,
        readWindowReset_i=>'0',
        readWindowReset_i=>'0',
        readWindowNext_i=>readFrame(portIndex),
        readWindowNext_i=>readFrame(portIndex),
        readContentEmpty_o=>readContentEmpty(portIndex),
        readContentEmpty_o=>open,
        readContent_i=>readContent(portIndex),
        readContent_i=>readContent(portIndex),
        readContentEnd_o=>readContentEnd(portIndex),
        readContentEnd_o=>readContentEnd(portIndex),
        readContentData_o=>readContentData(portIndex),
        readContentData_o=>readContentData(portIndex),
        writeFrame_i=>writeFrame(portIndex),
        writeFrame_i=>writeFrame(portIndex),
        writeFrameAbort_i=>writeFrameAbort(portIndex),
        writeFrameAbort_i=>writeFrameAbort(portIndex),
Line 1282... Line 1310...
      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,
      readFrameAborted_i=>readFrameAborted,
 
      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,

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.