rtl: add udp ram data count signal logic
This commit is contained in:
@ -1,8 +1,6 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////
|
// Top module for base ethernet operations
|
||||||
//Module Name : mac_top
|
// inheireted from Alinx
|
||||||
//Description :
|
|
||||||
//
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
`timescale 1 ns/1 ns
|
`timescale 1 ns/1 ns
|
||||||
module mac_top
|
module mac_top
|
||||||
(
|
(
|
||||||
@ -37,6 +35,7 @@ module mac_top
|
|||||||
input [10:0] udp_rec_ram_read_addr,
|
input [10:0] udp_rec_ram_read_addr,
|
||||||
output [15:0] udp_rec_data_length,
|
output [15:0] udp_rec_data_length,
|
||||||
output udp_rec_data_valid,
|
output udp_rec_data_valid,
|
||||||
|
output [11:0] udp_ram_data_count,
|
||||||
|
|
||||||
output arp_found,
|
output arp_found,
|
||||||
output mac_not_exist
|
output mac_not_exist
|
||||||
@ -81,6 +80,7 @@ mac_tx_top mac_tx0
|
|||||||
.arp_rec_source_ip_addr (arp_rec_source_ip_addr ),
|
.arp_rec_source_ip_addr (arp_rec_source_ip_addr ),
|
||||||
.arp_rec_source_mac_addr (arp_rec_source_mac_addr ),
|
.arp_rec_source_mac_addr (arp_rec_source_mac_addr ),
|
||||||
.arp_request_req (arp_request_req ),
|
.arp_request_req (arp_request_req ),
|
||||||
|
.udp_ram_data_count (udp_ram_data_count ),
|
||||||
|
|
||||||
|
|
||||||
.ram_wr_data (ram_wr_data) ,
|
.ram_wr_data (ram_wr_data) ,
|
||||||
|
|||||||
@ -31,8 +31,9 @@ module mac_tx_top
|
|||||||
(* MARK_DEBUG="true" *)input [15:0] udp_send_data_length,
|
(* MARK_DEBUG="true" *)input [15:0] udp_send_data_length,
|
||||||
(* MARK_DEBUG="true" *)output udp_tx_end,
|
(* MARK_DEBUG="true" *)output udp_tx_end,
|
||||||
(* MARK_DEBUG="true" *)output almost_full,
|
(* MARK_DEBUG="true" *)output almost_full,
|
||||||
|
(* MARK_DEBUG="true" *)output [11:0] udp_ram_data_count,
|
||||||
|
|
||||||
output upper_data_req,
|
(* MARK_DEBUG="true" *)output upper_data_req,
|
||||||
input icmp_tx_ready,
|
input icmp_tx_ready,
|
||||||
input [7:0] icmp_tx_data,
|
input [7:0] icmp_tx_data,
|
||||||
input icmp_tx_end,
|
input icmp_tx_end,
|
||||||
@ -251,7 +252,8 @@ udp_tx udp0
|
|||||||
.udp_tx_ready (udp_tx_ready ),
|
.udp_tx_ready (udp_tx_ready ),
|
||||||
.udp_tx_data (udp_tx_data ),
|
.udp_tx_data (udp_tx_data ),
|
||||||
.udp_tx_end (udp_tx_end ),
|
.udp_tx_end (udp_tx_end ),
|
||||||
.almost_full (almost_full )
|
.almost_full (almost_full ),
|
||||||
|
.udp_ram_data_count (udp_ram_data_count )
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|||||||
@ -27,13 +27,14 @@ module udp_tx
|
|||||||
output reg udp_tx_ready,
|
output reg udp_tx_ready,
|
||||||
output reg [7:0] udp_tx_data,
|
output reg [7:0] udp_tx_data,
|
||||||
output reg udp_tx_end,
|
output reg udp_tx_end,
|
||||||
output almost_full
|
output almost_full,
|
||||||
|
output [11:0] udp_ram_data_count
|
||||||
|
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
|
|
||||||
reg ram_rd_en ;
|
reg ram_rd_en ;
|
||||||
wire [3:0] usedw ;
|
(* MARK_DEBUG="true" *) wire [3:0] usedw ;
|
||||||
reg [3:0] fifo_count ;
|
reg [3:0] fifo_count ;
|
||||||
|
|
||||||
reg [7:0] ram_rdata_d0 ;
|
reg [7:0] ram_rdata_d0 ;
|
||||||
@ -62,7 +63,7 @@ parameter UDP_SEND = 6'b010000 ;
|
|||||||
parameter UDP_END = 6'b100000 ;
|
parameter UDP_END = 6'b100000 ;
|
||||||
|
|
||||||
|
|
||||||
reg [5:0] state ;
|
(* MARK_DEBUG="true" *) reg [5:0] state ;
|
||||||
reg [5:0] next_state ;
|
reg [5:0] next_state ;
|
||||||
|
|
||||||
|
|
||||||
@ -222,7 +223,7 @@ udp_tx_data_fifo tx_data_fifo
|
|||||||
.full ( ), // output wire full
|
.full ( ), // output wire full
|
||||||
.almost_full (almost_full ), // output wire almost_full
|
.almost_full (almost_full ), // output wire almost_full
|
||||||
.empty ( ), // output wire empty
|
.empty ( ), // output wire empty
|
||||||
.data_count ( ) // output wire [11 : 0] data_count
|
.data_count (udp_ram_data_count ) // output wire [11 : 0] data_count
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -356,7 +357,7 @@ udp_tx_data_fifo tx_data_fifo
|
|||||||
localparam GEN_CHECKSUM_END = 6'b010000 ;
|
localparam GEN_CHECKSUM_END = 6'b010000 ;
|
||||||
localparam CHECKSUM_WAIT = 6'b100000 ;
|
localparam CHECKSUM_WAIT = 6'b100000 ;
|
||||||
|
|
||||||
reg [5:0] ck_state ;
|
(* MARK_DEBUG="true" *) reg [5:0] ck_state ;
|
||||||
reg [5:0] ck_next_state ;
|
reg [5:0] ck_next_state ;
|
||||||
|
|
||||||
always @(posedge clk or negedge rst_n)
|
always @(posedge clk or negedge rst_n)
|
||||||
|
|||||||
Reference in New Issue
Block a user