feat(top): new (de)scrambler, crc16

This commit is contained in:
2024-08-13 22:07:58 +08:00
parent a4eb609aae
commit 5e8d69a0b0
13 changed files with 766 additions and 90 deletions
+27 -11
View File
@@ -20,28 +20,33 @@
//////////////////////////////////////////////////////////////////////////////////
module RecvTop (
input clk,
input clk_2x, // clk_2x
input clk_2x, // clk_2x
input clk_4x,
input rst,
input rst2, // TODO: delete the signal
input rst2, // TODO: delete the signal
// phy wave
input [11:0] dini,
input [11:0] dinq,
// mgc control
output [ 3:0] ad9361_ctrl_in,
output wire flag_mgc_done_pulse, // active high pulse signal
output wire frame_sync_pulse, // in domain clk
output wire flag_mgc_done_pulse, // active high pulse signal
output wire frame_sync_pulse, // in domain clk
//vio
input vio_tsync_inter16, //为1的时候启用内插,从16倍过采样中挑一路
input EQUenable_vio, //为1时启用均衡
input [ 7:0] Zerozone_vio, //零域估计,默认值为8'd29
input [ 6:0] vio_stopbit, //寻找停止位,默认值为7'd60
input vio_tsync_inter16, //为1的时候启用内插,从16倍过采样中挑一路
input EQUenable_vio, //为1时启用均衡
input [ 7:0] Zerozone_vio, //零域估计,默认值为8'd29
input [ 6:0] vio_stopbit, //寻找停止位,默认值为7'd60
// stop signal
output flag_stop, //给shx,拉高8个clk表示当前时帧有效数据接收完毕
output [16:0] addr_stop, //给shx,拉高8个clk,与flag_stop对齐,指示位置与最后1bit有效数据的位置对齐
output flag_stop, //给shx,拉高8个clk表示当前时帧有效数据接收完毕
output [16:0] addr_stop, //给shx,拉高8个clk,与flag_stop对齐,指示位置与最后1bit有效数据的位置对齐
// mac frame header
output [63:0] recvNetData,
output recvNetDataNd
output recvNetDataNd,
// rx data src
output wire [31:0] rx_data_src_fifo_tdata,
output wire rx_data_src_fifo_tlast,
input wire rx_data_src_fifo_tready,
output wire rx_data_src_fifo_tvalid
);
wire rst_TimeSync;
@@ -495,6 +500,17 @@ module RecvTop (
.total_frames(total_frames)
);
extract_mac_frame u_extract_mac_frame (
.clk (clk_2x),
.rst (rst2 || rst_frame_sync || ~flag_frame_sync),
.ldpc_dec_out_start (LDPC_SyncOut),
.ldpc_dec_out_valid (LDPC_Rdy),
.ldpc_dec_out_data (LDPC_Dout),
.m_axis_mac_frame_tvalid(rx_data_src_fifo_tvalid),
.m_axis_mac_frame_tdata (rx_data_src_fifo_tdata),
.m_axis_mac_frame_tready(rx_data_src_fifo_tready),
.m_axis_mac_frame_tlast (rx_data_src_fifo_tlast)
);