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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [verif/] [sw/] [C/] [gmac_loopback.c] - Blame information for rev 64

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

Line No. Rev Author Line
1 53 dinesha
/*
2
 * Copyright (c) 1999-2001 Tony Givargis.  Permission to copy is granted
3
 * provided that this header remains intact.  This software is provided
4
 * with no warranties.
5
 *
6
 * Version : 2.9
7
 */
8
 
9
/*---------------------------------------------------------------------------*/
10
 
11
#include <8051.h>
12
 
13
char cErrCnt;
14
/*---------------------------------------------------------------------------*/
15
 
16 54 dinesha
__xdata __at (0xA030) unsigned int read_data;
17 56 dinesha
__xdata unsigned long *rx_des_base;
18
__xdata unsigned long *tx_des_base;
19 53 dinesha
 
20
void main() {
21
 
22
    unsigned int cFrameCnt = 0;
23
    unsigned int desc_ptr   =0;
24
 
25
    while(1) {
26
       if((read_data & 0xF) != 0) { // Check the Rx Q Counter
27
          // Read the Receive Descriptor
28
          // tb_top.cpu_read('h4,{desc_rx_qbase,desc_ptr},read_data); 
29
          // Write the Tx Descriptor
30 56 dinesha
          rx_des_base = (__xdata unsigned long *) (0x7000 | desc_ptr);
31
          tx_des_base = (__xdata unsigned long *) (0x7040 | desc_ptr);
32 54 dinesha
          //rx_des_base = (__xdata unsigned int *) (0x7000+desc_ptr);
33
          //tx_des_base = (__xdata unsigned int *) (0x7040+desc_ptr);
34
          //__xdata (int *) (0x7040+desc_ptr) = __xdata (int *)(0x7000+desc_ptr);
35 53 dinesha
          // tb_top.cpu_write('h4,{desc_tx_qbase,desc_ptr},read_data); 
36 54 dinesha
          *tx_des_base = *rx_des_base;
37 56 dinesha
          desc_ptr = (desc_ptr+4) & 0x3F;
38 53 dinesha
          cFrameCnt  = cFrameCnt+1;
39
         }
40
    }
41
}

powered by: WebSVN 2.1.0

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