📄 t_netlayer.v
字号:
module t_netlayer(
clk,
rst,
/******/
udp_over,
udp_rd,
udp_empty,
udp_headadd,
udp_length,
udp_addr,
udp_data,
/*******/
s_des_ip,
s_sou_ip,
s_des_port,
s_sou_port,
s_sou_add,
/********/
a_des_ip,
a_des_add,
/********/
r_des_ip,
r_des_add,
r_empty,
r_rd,
/********/
ram_en,
addr,
data_out,
desadd,
headadd,
length,
latch,
full,
);
input clk;
input rst;
output udp_over;
output udp_rd;
input udp_empty;
input udp_headadd;
input [9:0] udp_length;
output [10:0] udp_addr;
input [7:0] udp_data;
input [31:0] s_des_ip;
input [31:0] s_sou_ip;
input [15:0] s_des_port;
input [15:0] s_sou_port;
input [47:0] s_sou_add;
input [31:0] a_des_ip;
input [47:0] a_des_add;
input [31:0] r_des_ip;
input [47:0] r_des_add;
input r_empty;
output r_rd;
output ram_en;
output[10:0] addr;
output [7:0] data_out;
output [47:0] desadd;
output headadd;
output[15:0] length;
output latch;
input full;
wire[31:0] u_des_ip;
wire send_udp;
wire udp_over;
wire[7:0] udata_o;
wire udp_ing;
wire send_arp;
wire arp_over;
wire[7:0] adata_o;
wire send_rarp;
wire rarp_over;
wire sarp_ing;
wire[47:0] desadd_o;
wire[7:0] data_o;
wire sending ;
pack_control uu0 (
.clk(clk),
.rst(rst),
/**user setting**/
.s_des_ip(s_des_ip),
/**the data info fifo**/
.u_empty(udp_empty),
/***the udp destination ip and mac add****/
.a_des_add(a_des_add),
.a_des_ip(a_des_ip),
/****the arp request host's add and ip fifo*******
********need to reply*****************************/
.r_empty(r_empty),
.r_des_add(r_des_add),
/*****the interface to the udp****/
.u_des_ip(u_des_ip),
.send_udp(send_udp),
.udp_over(udp_over),
.udata_i(udata_o),
.udp_ing(udp_ing),
/****the interface to the arp and rarp***/
.send_arp(send_arp),
.arp_over(arp_over),
.adata_i(adata_o),
.send_rarp(send_rarp),
.rarp_over(rarp_over),
.sarp_ing(sarp_ing),
/***the interface from the mac sublayer***/
.full(full),
.desadd_o(desadd_o),
.data_o(data_o),
.send_ing (sending)
);
udp uu1 (
.clk(clk),
.rst(rst),
.data_i(udp_data),
.addr(udp_addr),
.info_en(udp_rd),
.length(udp_length),
.headadd(udp_headadd),
.des_ip(u_des_ip),
.sou_ip(s_sou_ip),
.des_port(s_des_port),
.sou_port(s_sou_port),
.send_udp(send_udp),
.udp_over(udp_over),
.udp_ing(udp_ing),
.udata_o(udata_o)
);
arp uu2 (
.clk(clk),
.rst(rst),
/****the interfrace to mac sublayer****/
.data_o(adata_o),
.full(full),
/****the interface with the arp request receiver****/
.r_desmac_i(r_des_add),
.r_desip_i(r_des_ip),
.r_rd(r_rd),
/*********/
.a_desip_i(s_des_ip),
/*********/
.soumac_i(s_sou_add),
.souip_i(s_sou_ip),
/*********/
.send_arp(send_arp),
.send_rarp(send_rarp),
.sending(sarp_ing),
.arp_ing(),
.rarp_ing(),
.arp_over(arp_over),
.rarp_over(rarp_over)
);
cache_control uu3 (
.clk(clk),
.rst(rst),
.sending(sending),
.data_i(data_o),
.desadd_i(desadd_o),
.full_o(),
/*******/
.headadd_o(headadd),
.length_o(length),
.desadd_o(desadd),
.latch_o(latch),
.full_i(full),
/*****/
.addr_o(addr),
.data_o(data_out),
.ram_en(ram_en)
);
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -