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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [verif/] [testcase/] [gmac_test1.v] - Blame information for rev 41

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 dinesha
task gmac_test1;
2
 
3
 
4
   events_log = $fopen("../test_log_files/test1_events.log");
5
   tb_top.u_tb_eth.event_file = events_log;
6
 
7
   tb_top.u_tb_eth.init_port(3'b1, 3'b1, 1'b1, 0);
8
 
9
   tb_top.cpu_write('h1,8'h0,8'h01);  // tx-control
10
   tb_top.cpu_write('h1,8'h4,8'h65);  // Rx control
11
   tb_top.cpu_write('h1,8'h8,{16'h0,8'd22,8'd22}); // Tx/Rx IFG
12
 
13
   tb_top.u_tb_eth.set_flow_type(0);//L2 unicast 
14
   tb_top.u_tb_eth.set_L2_frame_size(1, 64, 84, 1); //, 1, 17, 33, 49, 64
15
   tb_top.u_tb_eth.set_payload_type(2, 5000,0); //make sure frame size is honored
16 41 dinesha
   tb_top.u_tb_eth.set_L2_protocol(0); // Untagged frame
17 15 dinesha
   tb_top.u_tb_eth.set_L2_source_address(0, 48'h12_34_56_78_9a_bc, 0,0);
18
   tb_top.u_tb_eth.set_L2_destination_address(0, 48'h16_22_33_44_55_66, 0,0);
19 41 dinesha
   tb_top.u_tb_eth.set_L3_protocol(4); // IPV4
20 15 dinesha
   tb_top.u_tb_eth.set_crc_option(0,0);
21
 
22
   fork
23
     tb_top.u_tb_eth.transmit_packet_sequence(10, 96, 1, 500000);
24
     begin
25
         tb_top.u_tb_eth.wait_for_event(3, 0);
26
         tb_top.u_tb_eth.wait_for_event(3, 0);
27
     end
28
   join
29
 
30
  #100000;
31
 
32
  `TB_AGENTS_GMAC.full_mii.status; // test status
33
 
34
  // Check the Transmitted & Received Frame cnt
35
  if(`TB_AGENTS_GMAC.full_mii.transmitted_packet_count != `TB_AGENTS_GMAC.full_mii.receive_packet_count)
36
       `TB_GLBL.test_err;
37
 
38
  // Check the Transmitted & Received Byte cnt
39
  if(`TB_AGENTS_GMAC.full_mii.transmitted_packet_byte_count != `TB_AGENTS_GMAC.full_mii.receive_packet_byte_count)
40
       `TB_GLBL.test_err;
41
 
42
  if(`TB_AGENTS_GMAC.full_mii.receive_crc_err_count)
43
       `TB_GLBL.test_err;
44
 
45
 
46
endtask
47
 

powered by: WebSVN 2.1.0

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