aboutsummaryrefslogtreecommitdiffstats
path: root/simple_gemac/simple_gemac_tb.v
diff options
context:
space:
mode:
authormatt <matt@221aa14e-8319-0410-a670-987f0aec2ac5>2009-04-01 02:28:13 +0000
committermatt <matt@221aa14e-8319-0410-a670-987f0aec2ac5>2009-04-01 02:28:13 +0000
commite480576f11e15be97e3033652583bedd5d691c56 (patch)
tree131bca0d2da47f7d6bb0312eb0a2f4b63b535157 /simple_gemac/simple_gemac_tb.v
parenta26dcb660f7a10703e2d285e09ce22f323d8a78d (diff)
downloaduhd-e480576f11e15be97e3033652583bedd5d691c56.tar.gz
uhd-e480576f11e15be97e3033652583bedd5d691c56.tar.bz2
uhd-e480576f11e15be97e3033652583bedd5d691c56.zip
rx seems to work. haven't test error frames
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10732 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'simple_gemac/simple_gemac_tb.v')
-rw-r--r--simple_gemac/simple_gemac_tb.v48
1 files changed, 30 insertions, 18 deletions
diff --git a/simple_gemac/simple_gemac_tb.v b/simple_gemac/simple_gemac_tb.v
index 481c6ebab..434c84a4a 100644
--- a/simple_gemac/simple_gemac_tb.v
+++ b/simple_gemac/simple_gemac_tb.v
@@ -19,14 +19,19 @@ module simple_gemac_tb;
wire [7:0] rx_data;
reg [7:0] tx_data;
- wire [15:0] pause_time = 16'hBEEF;
+ reg [15:0] pause_time;
reg pause_req = 0;
- reg GMII_RX_CLK;
- always @(GMII_GTX_CLK)
- GMII_RX_CLK <= #30 GMII_GTX_CLK;
+// reg GMII_RX_CLK;
+// always @(GMII_GTX_CLK)
+// GMII_RX_CLK <= #30 GMII_GTX_CLK;
-// wire GMII_RX_CLK = #30 GMII_GTX_CLK;
+ wire GMII_RX_CLK = GMII_GTX_CLK;
+
+ // Loopback
+ assign GMII_RX_DV = GMII_TX_EN;
+ assign GMII_RX_ER = GMII_TX_ER;
+ assign GMII_RXD = GMII_TXD;
simple_gemac simple_gemac
(.clk125(clk), .reset(reset),
@@ -42,15 +47,17 @@ module simple_gemac_tb;
);
task SendFlowCtrl;
- begin
- $display("Sending Flow Control, %d", $time);
- @(posedge clk);
- pause_req <= 1;
- @(posedge clk);
- pause_req <= 0;
- end
+ input [15:0] fc_len;
+ begin
+ $display("Sending Flow Control, quanta = %d, time = %d", fc_len,$time);
+ pause_time = fc_len;
+ @(posedge clk);
+ pause_req <= 1;
+ @(posedge clk);
+ pause_req <= 0;
+ end
endtask // SendFlowCtrl
-
+
reg [31:0] count;
task SendPacket;
input [7:0] data_start;
@@ -115,13 +122,18 @@ module simple_gemac_tb;
@(negedge reset);
repeat (10)
@(posedge clk);
- SendFlowCtrl;
- repeat (20)
- @(posedge clk);
- SendPacket(8'hAA,10);
+ SendFlowCtrl(16'h0007); // Send flow control
+ #30000;
+ @(posedge clk);
+ SendFlowCtrl(16'h0009); // Increas flow control before it expires
+ #10000;
+ @(posedge clk);
+ SendFlowCtrl(16'h0000); // Cancel flow control befor it expires
+ @(posedge clk);
+ SendPacket(8'hAA,10); // This packet gets dropped by the filters
repeat (10)
@(posedge clk);
- SendPacketFromFile(60);
+ SendPacketFromFile(60); // The rest are valid packets
repeat (10)
@(posedge clk);
SendPacketFromFile(61);