/// programmable block decoder to support protocols such as 64b66b, 64b67b, 128b130b, 128b132b module mppcs_block_dec #( parameter DW = 32, /// max. data width parameter DATA_WIDTH = 32, parameter HW = 4, /// max. header width 4 parameter ND = 16 /// max. number of data per block parameter DATA_PER_BLOCK = 64, ) ( /// ingress data interface input logic [DW-1:0] data_in, /// ingress data before header extraction input logic in_valid, /// ingress flow control output logic in_ready, /// ingress flow control /// egress data interface output logic block_start, /// block synchronization output logic [HW-1:0] header_out, /// block header output logic [DW-1:0] data_out, /// egress data after header extraction output logic out_valid, /// egress flow control input logic out_ready, /// egress flow control /// control options input [$clog2(DW)-1:0] msb_data, /// number of data bits - 1 input [$clog2(HW)-1:0] msb_header, /// number of header bits - 1 input [$clog2(ND)-1:0] msb_num_data, /// number of data per block - 1 output logic sync_track, /// block sync tracking signal input logic sync_mode, /// 0: use external sync directly, 1 : use internal sync after assertion of external sync input logic [3:0] sync_offset, /// offset between sync and block start signal input logic sync_start, /// external sync input logic enable, /// 0: clock-gated, 1: mission mode input logic bypass, /// 1: data pass-through without header insertion /// clock & reset input clk, input rst ); /// mask unused bits in header and data wire [DW+1 :0] data_msk = {({{(DW-1){1'b0}},1'b1}<<msb_data),1'b0} - 1'b1; wire [DW-1:0] data_eff = data_msk[DW-1:0] & data_in; wire [HW+1 :0] header_msk = {({{(HW-1){1'b0}},1'b1}<<msb_header),1'b0} - 1'b1; /// block synchronization wire block_sync_en = enable & ~bypass; logic [$clog2(ND)-1:0] cnt_block_data,cnt_block_data_nxt; logic sync_start_lat; always @(posedge clk or posedge rst) begin if (rst) sync_start_lat <= 0; else sync_start_lat <= sync_start; end
时间: 2024-04-26 14:24:12 浏览: 167
Xilinx aurora 64b 66b 协议
3星 · 编辑精心推荐
这段代码是一个可编程块解码器,用于支持诸如64b66b、64b67b、128b130b、128b132b等协议。该模块有一个数据输入接口,可以输入数据进行解码;同时也有一个数据输出接口,可以输出解码后的数据。在解码数据时,还需要进行数据屏蔽和头部提取等操作。另外,该模块还具备一些控制选项,比如同步跟踪信号、同步模式和使能等。最后,该模块还有时钟和复位信号。
阅读全文