微波EDA网,见证研发工程师的成长!
首页 > 通信和网络 > 通信网络技术文库 > 基于网络编码的多信源组播通信系统,包括源代码,原理图等

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

时间:11-08 来源:3721RD 点击:

// it has been decoded,decode the next packet

state_next = GET_SRC_GEN_NUM;

else begin

cmp_data = {src_num_sel,gen_num_sel,12'hfff};

cmp_data_mask_0 = {12'h0,CMP_DATA_MASK};

cmp_data_mask_1 = {12'h0,CMP_DATA_MASK};

cmp_data_mask_2 = {12'h0,CMP_DATA_MASK};

state_next = GET_CMP_RESLT_FIRST;

end

end

GET_CMP_RESLT_FIRST: begin

cam_lookup_reslt_next = {match_2,match_1,match_0};

cmp_data = {12'hfff,src_num_sel,gen_num_sel};

cmp_data_mask_0 = {CMP_DATA_MASK,12'h0};

cmp_data_mask_1 = {CMP_DATA_MASK,12'h0};

cmp_data_mask_2 = {CMP_DATA_MASK,12'h0};

state_next = GET_CMP_RESLT_SEC;

match_addr_temp_2_next = match_addr_2;

match_addr_temp_1_next = match_addr_1;

match_addr_temp_0_next = match_addr_0;

end

/* get the address from the cams, if there are two adresses from

* the cams, then outputs the one to the DRAM control and save

* the other for later use. If there is no valid address, we could not

* decode, then get out and decode the next one */

GET_CMP_RESLT_SEC: begin

state_next = RD_DRAM_MAIN_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};

cam_lookup_reslt_save_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

/* reads the DRAM accroding to the CAM's address, then updates the look

* up result */

RD_DRAM_MAIN_STEP:

if(rd_idle) begin

if(|cam_lookup_reslt) begin

if(cam_lookup_reslt==3'b101) begin

other_dram_addr_next = match_addr_temp_2;

other_port_num_rd_next = 2'b10;

has_factor2_next = 1;

addr_vld = 1;

block_num_rd = match_addr_temp_0;

port_num_rd = 0;

cam_lookup_reslt_next = 3'b100;

end

else if (cam_lookup_reslt == 3'b011) begin

other_dram_addr_next = match_addr_temp_1;

other_port_num_rd_next = 2'b01;

has_factor2_next = 1;

addr_vld = 1;

block_num_rd = match_addr_temp_0;

port_num_rd = 0;

cam_lookup_reslt_next = 3'b010;

end

else if (cam_lookup_reslt==3'b110) begin

other_dram_addr_next = match_addr_temp_2;

other_port_num_rd_next = 2'b10;

has_factor2_next = 1;

addr_vld = 1;

block_num_rd = match_addr_temp_1;

port_num_rd = 2'b01;

cam_lookup_reslt_next=3'b100;

end

else if (cam_lookup_reslt==3'b001) begin

has_factor2_next = 0;

addr_vld = 1;

block_num_rd = match_addr_0;

port_num_rd = 2'b00;

cam_lookup_reslt_next = 0;

end

else if (cam_lookup_reslt==3'b010) begin

has_factor2_next = 0;

addr_vld = 1;

block_num_rd = match_addr_1;

port_num_rd = 2'b01;

cam_lookup_reslt_next = 0;

end

else if (cam_lookup_reslt==3'b100) begin

has_factor2_next = 0;

addr_vld = 1;

block_num_rd = match_addr_2;

port_num_rd = 2'b10;

cam_lookup_reslt_next = 0;

end

state_next=LUP_DCOD_FACTOR1_FIRST;

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

网站地图

Top