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

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [tbench/] [proto_systemverilog/] [scenarios/] [compile/] [testcase.sv] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 antanguay
/**
2
 * 10 GE MAC Core loopback test scenario file.
3
 * @file: testcase.sv (loopback)
4
 * @author: Pratik Mahajan
5
 * @par Contact: pratik@e-pigeonpost.com
6
 * @par Company: UCSC (SV 1896 Systemverilog for advanced verification course)
7
 *
8
 * @version: $LastChangedRevision$
9
 * @par Last Changed Date:
10
 * $LastChangedDate$
11
 * @par Last Changed By
12
 * $LastChangedBy$
13
 */
14
 
15
`include "../../verification/include.sv"
16
`include "../../verification/packet.sv"
17
`include "../../verification/driver.sv"
18
`include "../../verification/monitor.sv"
19
`include "../../verification/scoreboard.sv"
20
`include "../../verification/env.sv"
21
 
22
/**
23
 * Testcase representing loopback scenario.
24
 * The testcase sets proper environment variable for design to work in loopback mode
25
 * To connect DUT in loopback mode:
26
 *      XGMII interface Tx is connected to XGMII Rx port.
27
 *      Data transmitted through simple Tx port collected through simple Rx port
28
 *      and the data is compared for equality
29
 */
30
 
31
program testcase (      macCoreInterface        driverTestInterface,
32
                        macCoreInterface        monitorTestInterface
33
                        );
34
 
35
   env envLoopBack;
36
   int noOfPackets;
37
   int lengthOfFrame;
38
 
39
   initial begin
40
 
41
      envLoopBack = new (driverTestInterface, monitorTestInterface);
42
 
43
      noOfPackets = $urandom_range (5, 8);
44
      lengthOfFrame = $urandom_range (58, 68);
45
 
46
      #20 envLoopBack.reset ();
47
      #30 envLoopBack.init ();
48
      envLoopBack.run (noOfPackets, lengthOfFrame);
49
      envLoopBack.validate (noOfPackets, lengthOfFrame);
50
 
51
      #1000000 $finish;
52
 
53
   end
54
 
55
   final begin
56
      $display ("\n\n");
57
      $display ("\t//////////////////////////////////////////////////////////\n");
58
      $display ("\t///////////// Test Finished, Results: ////////////////////\n");
59
      $display ("\t//////////////////////////////////////////////////////////\n");
60
 
61
      if (envLoopBack.macCoreScoreboard.error == 1) $display ("\t\t End Of Test ERROR: \n\t\t Error occured while checking packets\n");
62
      else $display ("\t\t End Of Test PASS: \n\t\t All packets were matched properly\n");
63
   end
64
 
65
endprogram // testcase
66
 

powered by: WebSVN 2.1.0

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