URL
https://opencores.org/ocsvn/turbo8051/turbo8051/trunk
Subversion Repositories turbo8051
Compare Revisions
- This comparison shows the changes necessary to convert path
/turbo8051/trunk/verif
- from Rev 52 to Rev 53
- ↔ Reverse comparison
Rev 52 → Rev 53
/run/dat/oc8051_xrom.in
4,7 → 4,7
/// |
/// source file: H:\gmac_loopback.hex |
/// date: 3/29/2011 |
/// time: 6:42:26 PM |
/// time: 7:08:29 PM |
/// |
00 |
00 |
59,7 → 59,7
01 |
75 |
A0 |
D0 |
00 |
E4 |
93 |
F2 |
94,7 → 94,7
00 |
75 |
A0 |
D0 |
00 |
E4 |
F3 |
09 |
110,8 → 110,8
79 |
01 |
90 |
D0 |
00 |
00 |
E4 |
F0 |
A3 |
/tb/tb_top.v
405,12 → 405,16
end |
|
`TB_GLBL.init; |
|
// test case, which has control before reset |
if ( $test$plusargs("gmac_test_2") ) |
gmac_test2(); |
|
#1000 wait(reset_out_n == 1); |
|
// test case, which has control after reset |
if ( $test$plusargs("gmac_test_1") ) |
gmac_test1(); |
else if ( $test$plusargs("gmac_test_2") ) |
gmac_test2(); |
else if ( $test$plusargs("uart_test_1") ) |
uart_test1(); |
else if ( $test$plusargs("spi_test_1") ) |
/sw/C/gmac_loopback.c
0,0 → 1,36
/* |
* Copyright (c) 1999-2001 Tony Givargis. Permission to copy is granted |
* provided that this header remains intact. This software is provided |
* with no warranties. |
* |
* Version : 2.9 |
*/ |
|
/*---------------------------------------------------------------------------*/ |
|
#include <8051.h> |
|
char cErrCnt; |
/*---------------------------------------------------------------------------*/ |
|
__xdata __at (0x30) unsigned int read_data; |
__xdata __at (0x34) unsigned int tx_des_base; |
__xdata __at (0x38) unsigned int rx_des_base; |
|
void main() { |
|
unsigned int cFrameCnt = 0; |
unsigned int desc_ptr =0; |
|
while(1) { |
if((read_data & 0xF) != 0) { // Check the Rx Q Counter |
// Read the Receive Descriptor |
// tb_top.cpu_read('h4,{desc_rx_qbase,desc_ptr},read_data); |
// Write the Tx Descriptor |
rx_des_base = tx_des_base; |
// tb_top.cpu_write('h4,{desc_tx_qbase,desc_ptr},read_data); |
desc_ptr = desc_ptr+1; |
cFrameCnt = cFrameCnt+1; |
} |
} |
} |
sw/C/gmac_loopback.c
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: sw/C/run
===================================================================
--- sw/C/run (nonexistent)
+++ sw/C/run (revision 53)
@@ -0,0 +1,5 @@
+#!/bin/tcsh -f
+echo $1
+sdcc --model-large -I /home/dinesha/download/sdcc/device/include/mcs51 -I /home/dinesha/download/sdcc/device/include/ -L /home/dinesha/download/sdcc/device/lib/build/large -c $1.c
+sdcc --model-large -I /home/dinesha/download/sdcc/device/include/mcs51 -I /home/dinesha/download/sdcc/device/include/ -L /home/dinesha/download/sdcc/device/lib/build/large --code-loc 0x10 --data-loc 0x30 --stack-loc 0x20 --xram-loc 0x0000 $1.rel
+packihx $1.ihx > $1.hex
sw/C/run
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: testcase/gmac_test2.v
===================================================================
--- testcase/gmac_test2.v (nonexistent)
+++ testcase/gmac_test2.v (revision 53)
@@ -0,0 +1,89 @@
+task gmac_test2;
+reg [31:0] read_data;
+reg [3:0] desc_ptr;
+reg [9:0] desc_rx_qbase;
+reg [9:0] desc_tx_qbase;
+reg [7:0] iFrmCnt;
+
+ //--------------------------
+ // Data Memory MAP
+ //-------------------------
+ // 0x0000 to 0x0FFF - 4K - Processor Data Memory
+ // 0x1000 to 0x1FFF - 4K - Gmac Rx Data Memory
+ // 0x2000 to 0x2FFF - 4K - Reserved for Rx
+ // 0x3000 to 0x3FFF - 4K - Gmac Tx Data Memory
+ // 0x4000 to 0x4FFF - 4K - Reserved for Tx
+ // 0x7000 to 0x703F - 64 - Rx Descriptor
+ // 0x7040 to 0x707F - 64 - Tx Descripto
+
+ events_log = $fopen("../test_log_files/test1_events.log");
+ tb_top.u_tb_eth.event_file = events_log;
+
+ $system("cp ../testcase/dat/gmac_loopback.dat ./dat/oc8051_xrom.in");
+ // Enable the RISC booting + Internal ROM Mode
+ tb_top.ea_in = 1;
+ tb_top.master_mode = 1;
+
+ #1000 wait(reset_out_n == 1);
+
+
+ desc_ptr = 0;
+ desc_rx_qbase = 10'h1C0;
+ desc_tx_qbase = 10'h1C1;
+ iFrmCnt = 0;
+ tb_top.u_tb_eth.init_port(3'b1, 3'b1, 1'b1, 0);
+
+ tb_top.cpu_write('h1,8'h0,{4'h1,4'h1,8'h45,8'h01}); // tx/rx-control
+ tb_top.cpu_write('h1,8'h8,{16'h0,8'd22,8'd22}); // Tx/Rx IFG
+ tb_top.cpu_write('h1,8'h24,{desc_tx_qbase,desc_ptr,2'b00,
+ desc_rx_qbase,desc_ptr,2'b00}); // Tx/Rx Descriptor
+
+ tb_top.u_tb_eth.set_flow_type(0);//L2 unicast
+ tb_top.u_tb_eth.set_L2_frame_size(1, 64, 84, 1); //, 1, 17, 33, 49, 64
+ tb_top.u_tb_eth.set_payload_type(2, 5000,0); //make sure frame size is honored
+ tb_top.u_tb_eth.set_L2_protocol(0); // Untagged frame
+ tb_top.u_tb_eth.set_L2_source_address(0, 48'h12_34_56_78_9a_bc, 0,0);
+ tb_top.u_tb_eth.set_L2_destination_address(0, 48'h16_22_33_44_55_66, 0,0);
+ tb_top.u_tb_eth.set_L3_protocol(4); // IPV4
+ tb_top.u_tb_eth.set_crc_option(0,0);
+
+ fork
+ tb_top.u_tb_eth.transmit_packet_sequence(10, 96, 1, 500000);
+ begin
+ tb_top.u_tb_eth.wait_for_event(3, 0);
+ tb_top.u_tb_eth.wait_for_event(3, 0);
+ end
+ //begin
+ // while(iFrmCnt != 10) begin
+ // tb_top.cpu_read('h1,8'h30,read_data); // Tx/Rx Counter
+ // if(read_data[3:0] != 0) begin // Check the Rx Q Counter
+ // // Read the Receive Descriptor
+ // tb_top.cpu_read('h4,{desc_rx_qbase,desc_ptr},read_data);
+ // // Write the Tx Descriptor
+ // tb_top.cpu_write('h4,{desc_tx_qbase,desc_ptr},read_data);
+ // desc_ptr = desc_ptr+1;
+ // iFrmCnt = iFrmCnt+1;
+ // end
+ // #1000;
+ // end
+ //end
+ join
+
+ #100000;
+
+ `TB_AGENTS_GMAC.full_mii.status; // test status
+
+ // Check the Transmitted & Received Frame cnt
+ if(`TB_AGENTS_GMAC.full_mii.transmitted_packet_count != `TB_AGENTS_GMAC.full_mii.receive_packet_count)
+ `TB_GLBL.test_err;
+
+ // Check the Transmitted & Received Byte cnt
+ if(`TB_AGENTS_GMAC.full_mii.transmitted_packet_byte_count != `TB_AGENTS_GMAC.full_mii.receive_packet_byte_count)
+ `TB_GLBL.test_err;
+
+ if(`TB_AGENTS_GMAC.full_mii.receive_crc_err_count)
+ `TB_GLBL.test_err;
+
+
+endtask
+