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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [tests/] [ethmac/] [sim/] [ethmac-rxtxcallresponse.c] - Diff between revs 411 and 530

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 411 Rev 530
Line 3... Line 3...
////  Interrupt-driven Ethernet MAC transmit test code            ////
////  Interrupt-driven Ethernet MAC transmit test code            ////
////                                                              ////
////                                                              ////
////  Description                                                 ////
////  Description                                                 ////
////  Send packets while receiving packets                        ////
////  Send packets while receiving packets                        ////
////                                                              ////
////                                                              ////
////  Test data comes from pre-calculated array of random values, ////
 
////  MAC TX buffer pointers are set to addresses in this array,  ////
 
////  saving copying the data around before transfers.            ////
 
////                                                              ////
 
////  Author(s):                                                  ////
////  Author(s):                                                  ////
////      - jb, jb@orsoc.se, with parts taken from Linux kernel   ////
////      - jb, jb@orsoc.se, with parts taken from Linux kernel   ////
////        open_eth driver.                                      ////
////        open_eth driver.                                      ////
////                                                              ////
////                                                              ////
////                                                              ////
////                                                              ////
Line 477... Line 473...
        if (rx_bdp[i].len_status & OETH_RX_BD_OVERRUN) {
        if (rx_bdp[i].len_status & OETH_RX_BD_OVERRUN) {
          bad = 1;
          bad = 1;
          report(0xbaad0004);
          report(0xbaad0004);
        }
        }
        if (rx_bdp[i].len_status & OETH_RX_BD_MISS) {
        if (rx_bdp[i].len_status & OETH_RX_BD_MISS) {
 
                // not necessarily an issue
          report(0xbaad0005);
          report(0xbaad0005);
        }
        }
        if (rx_bdp[i].len_status & OETH_RX_BD_LATECOL) {
        if (rx_bdp[i].len_status & OETH_RX_BD_LATECOL) {
          bad = 1;
          bad = 1;
          report(0xbaad0006);
          report(0xbaad0006);
Line 634... Line 631...
  ethphy_set_100mbit(0);
  ethphy_set_100mbit(0);
 
 
  send_ethmac_rxtx_test_init_packet(0x0); // 0x0 - call response test
  send_ethmac_rxtx_test_init_packet(0x0); // 0x0 - call response test
 
 
#define ETH_TX_MIN_PACKET_SIZE 512
#define ETH_TX_MIN_PACKET_SIZE 512
#define ETH_TX_NUM_PACKETS (ETH_TX_MIN_PACKET_SIZE + 20)
#define ETH_TX_NUM_PACKETS  20
 
 
  //int response_time = 150000; // Response time before response packet it sent
  //int response_time = 150000; // Response time before response packet it sent
                              // back (should be in nanoseconds).
                              // back (should be in nanoseconds).
  int response_time  = 0;
  int response_time  = 0;
 
 
  unsigned long num_to_check;
  unsigned long num_to_check;
  for(num_to_check=ETH_TX_MIN_PACKET_SIZE;
  for(num_to_check=ETH_TX_MIN_PACKET_SIZE;
      num_to_check<ETH_TX_NUM_PACKETS;
      num_to_check<ETH_TX_MIN_PACKET_SIZE + ETH_TX_NUM_PACKETS;
      num_to_check++)
      num_to_check++)
    fill_and_tx_call_packet(num_to_check, response_time);
    fill_and_tx_call_packet(num_to_check, response_time);
 
 
 
 
  // Wait a moment for the RX packet check to complete before switching off RX
  // Wait a moment for the RX packet check to complete before switching off RX
Line 658... Line 655...
  ethphy_set_10mbit(0);
  ethphy_set_10mbit(0);
 
 
  oeth_enable_rx();
  oeth_enable_rx();
 
 
  for(num_to_check=ETH_TX_MIN_PACKET_SIZE;
  for(num_to_check=ETH_TX_MIN_PACKET_SIZE;
      num_to_check<ETH_TX_NUM_PACKETS;
      num_to_check<ETH_TX_MIN_PACKET_SIZE + ETH_TX_NUM_PACKETS;
      num_to_check++)
      num_to_check++)
    fill_and_tx_call_packet(num_to_check, response_time);
    fill_and_tx_call_packet(num_to_check, response_time);
 
 
  oeth_disable_rx();
  oeth_disable_rx();
 
 

powered by: WebSVN 2.1.0

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