微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 电源设计 > 基于网络编码的多信源组播通信系统,包括源代码,原理图等(四)

基于网络编码的多信源组播通信系统,包括源代码,原理图等(四)

时间:12-06 来源:互联网 点击:

cmp_data_mask_0={12'h0,CMP_DATA_MASK};

end else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b011) begin

cmp_data = {pkt_need_src_gen,12'hfff};

cmp_data_mask_1 = {12'h0,CMP_DATA_MASK};

cmp_data_mask_0 = {12'h0,CMP_DATA_MASK};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b001) begin

cmp_data = {pkt_need_src_gen,12'hfff};

cmp_data_mask_0 = {12'h0,CMP_DATA_MASK};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b010) begin

cmp_data = {pkt_need_src_gen,12'hfff};

cmp_data_mask_1 = {12'h0,CMP_DATA_MASK};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b100) begin

cmp_data = {pkt_need_src_gen,12'hfff};

cmp_data_mask_2 = {12'h0,CMP_DATA_MASK};

end

state_next = LUP_DCOD_FACTOR1_SEC;

end

end

LUP_DCOD_FACTOR1_SEC: begin

state_next = GET_FACTOR1_RESLT;

cam_lookup_reslt_next = {match_2,match_1,match_0};

match_addr_temp_2_next = match_addr_2;

match_addr_temp_1_next = match_addr_1;

match_addr_temp_0_next = match_addr_0;

if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b110) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_2 = {CMP_DATA_MASK,12'h0};

cmp_data_mask_1 = {CMP_DATA_MASK,12'h0};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b101) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_2 = {CMP_DATA_MASK,12'h0};

cmp_data_mask_0 = {CMP_DATA_MASK,12'h0};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b011) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_0 = {CMP_DATA_MASK,12'h0};

cmp_data_mask_1 = {CMP_DATA_MASK,12'h0};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b001) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_0 = {CMP_DATA_MASK,12'h0};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b010) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_1 = {CMP_DATA_MASK,12'h0};

end

else if((cam_lookup_reslt^~cam_lookup_reslt_pre)==3'b100) begin

cmp_data = {12'hfff,pkt_need_src_gen};

cmp_data_mask_2 = {CMP_DATA_MASK,12'h0};

end

end

/* --- get the factor pkt address from the cam, then reads the DRAM

if no address matches, then check the decode factor2 */

GET_FACTOR1_RESLT: begin

state_next = RD_DRAM_MINOR_STEP;

cam_lookup_reslt_next = cam_lookup_reslt | {match_2,match_1,match_0};

cam_lookup_reslt_pre_next = cam_lookup_reslt | {match_2,match_1,match_0};

if(match_2) begin

match_addr_temp_2_next = match_addr_2;

end

if(match_1) begin

match_addr_temp_1_next = match_addr_1;

end

if(match_0) begin

match_addr_temp_0_next = match_addr_0;

end

end

RD_DRAM_MINOR_STEP:

if(rd_idle)

if(|cam_lookup_reslt) begin

state_next = LUP_DCOD_FACTOR1_FIRST;

if(cam_lookup_reslt==3'b001)

begin

addr_vld = 1;

block_num_rd = match_addr_temp_0;

port_num_rd = 2'b00;

cam_lookup_reslt_next=0;

end

else if (cam_lookup_reslt==3'b010)

begin

addr_vld = 1;

block_num_rd = match_addr_temp_1;

port_num_rd = 2'b01;

cam_lookup_reslt_next=0;

end

else if (cam_lookup_reslt==3'b100)

begin

addr_vld = 1;

block_num_rd = match_addr_temp_2;

port_num_rd = 2'b10;

cam_lookup_reslt_next=0;

end

end

else

begin

state_next = LUP_DCOD_FACTOR2;

pkt_not_find = 1;

has_other_factor = has_factor2;

end

/* decoding the packet by decode factor2 */

LUP_DCOD_FACTOR2:

if(has_factor2) begin

addr_vld = 1;

block_num_rd = other_dram_addr;

port_num_rd = other_port_num_rd;

state_next = LUP_DCOD_FACTOR1_FIRST;

cam_lookup_reslt_pre_next = cam_lookup_reslt_save;

has_factor2_next = 0;

end

else begin

pkt_not_find = 1;

has_other_factor = has_factor2;

state_next = GET_SRC_GEN_NUM;

end

endcase // case(state)

end // always @ (*)

always @(posedge clk) begin

src_num_sel <= `DLY src_num_sel_next;

gen_num_sel <= `DLY gen_num_sel_next;

cam_lookup_reslt_pre <= `DLY cam_lookup_reslt_pre_next;

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top