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

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [tbench/] [systemc/] [sc_pkt_if.cpp] - Diff between revs 7 and 15

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

Rev 7 Rev 15
Line 78... Line 78...
 
 
            pkt_tx_val = 1;
            pkt_tx_val = 1;
 
 
            for (int i = 0; i < pkt->length; i += 8) {
            for (int i = 0; i < pkt->length; i += 8) {
 
 
                pkt_tx_data = pkt->data[i+7] << 56 |
                pkt_tx_data = pkt->data[i] << 56 |
                    pkt->data[i+6] << 48 |
                    pkt->data[i+1] << 48 |
                    pkt->data[i+5] << 40 |
                    pkt->data[i+2] << 40 |
                    pkt->data[i+4] << 32 |
                    pkt->data[i+3] << 32 |
                    pkt->data[i+3] << 24 |
                    pkt->data[i+4] << 24 |
                    pkt->data[i+2] << 16 |
                    pkt->data[i+5] << 16 |
                    pkt->data[i+1] << 8 |
                    pkt->data[i+6] << 8 |
                    pkt->data[i];
                    pkt->data[i+7];
 
 
                if (i == 0) {
                if (i == 0) {
                    pkt_tx_sop = 1;
                    pkt_tx_sop = 1;
                }
                }
                else {
                else {
Line 179... Line 179...
 
 
                data = pkt_rx_data;
                data = pkt_rx_data;
 
 
                for (int lane = 0; lane < 8; lane++) {
                for (int lane = 0; lane < 8; lane++) {
 
 
                    pkt->data[pkt->length++] = (data >> (8 * lane)) & 0xff;
                    pkt->data[pkt->length++] = (data >> (8 * (7-lane))) & 0xff;
 
 
                    if (pkt->length >= 10000) {
                    if (pkt->length >= 10000) {
                        cout << "ERROR: Packet too long" << endl;
                        cout << "ERROR: Packet too long" << endl;
                        sc_stop();
                        sc_stop();
                    }
                    }

powered by: WebSVN 2.1.0

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