fix(system): adjust cp len, frame sync pos, IQ map
This commit is contained in:
+1
-1
@@ -255,7 +255,7 @@ module RecvTop (
|
||||
.m_axis_data_tdata (dmf_tdata_interp4_q)
|
||||
);
|
||||
|
||||
localparam CNT_CHU_SEQ_SYNC_MAX = 8;//! should not less than 3 due to the minimum rst of aresetn
|
||||
localparam CNT_CHU_SEQ_SYNC_MAX = 40;//! should not less than 3 due to the minimum rst of aresetn
|
||||
|
||||
wire [21:0] mag;
|
||||
wire mag_valid;
|
||||
|
||||
+36
-12
@@ -9,16 +9,16 @@
|
||||
// * ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ *
|
||||
// * *************************************************** *
|
||||
// * Create Date: 2023/12/18
|
||||
// * Update Date: 2024/03/17
|
||||
// * Update Date: 2024/07/24
|
||||
|
||||
// NOTE: 接口中的hop_wait和参数GAP_LEN均是为了等待,hop是为了跳频切换,gap是为了满足帧同步延迟,!!!将hop_wait设置为0并不能去掉改状态
|
||||
module Transmitter #(
|
||||
parameter AGC_HEADER_LEN = 2130,
|
||||
parameter AGC_HEADER_LEN = 10586,
|
||||
parameter FRAME_HEADER_LEN = 512,
|
||||
parameter BLOCK_NUM = 28,
|
||||
parameter PHASE1_LEN = 2112, // (8 cp + 256 sym)* 8 ( total 2048 valid sym)
|
||||
parameter PREFIX_LEN = 8,
|
||||
parameter CHU_SEQ_LEN = 128,
|
||||
parameter BLOCK_NUM = 42,
|
||||
parameter PHASE1_LEN = 2880, // (32 cp + 256 sym)* 10 ( total 2880 valid sym)
|
||||
parameter PREFIX_LEN = 32,
|
||||
parameter CHU_SEQ_LEN = 256,
|
||||
parameter GAP_LEN = 160
|
||||
) (
|
||||
// general
|
||||
@@ -65,10 +65,12 @@ module Transmitter #(
|
||||
|
||||
reg [ 3:0] interp;
|
||||
reg [ 3:0] cnt_interp;
|
||||
reg [13:0] agc_addr;
|
||||
wire [ 1:0] agc_data;
|
||||
reg [ 8:0] mseqs_addr;
|
||||
reg [ 8:0] mseqs_addr_d1;
|
||||
reg [ 8:0] mseqs_addr_d2;
|
||||
reg [ 6:0] chu_seq_addr;
|
||||
reg [ 7:0] chu_seq_addr = 0;
|
||||
wire [31:0] chu_seq;
|
||||
wire mseqs;
|
||||
reg [31:0] bb_wave_out_i; // shape filter result
|
||||
@@ -86,7 +88,7 @@ module Transmitter #(
|
||||
reg [ 3:0] rtz; // return to zero
|
||||
|
||||
reg [12:0] addr_tx_test = 'd0;
|
||||
wire [7:0] data_tx_test;
|
||||
wire [ 7:0] data_tx_test;
|
||||
|
||||
// ******** Assingment ********
|
||||
|
||||
@@ -328,7 +330,11 @@ module Transmitter #(
|
||||
|
||||
// truncation
|
||||
always @(*) begin
|
||||
if (cs == S_SEND_FRAME_HEADER) begin
|
||||
if (cs == S_SEND_AGC) begin
|
||||
m_fir_tdata_i = agc_data[0] ? 16'h8001 : 16'h7FFF;
|
||||
m_fir_tdata_q = agc_data[1] ? 16'h8001 : 16'h7FFF;
|
||||
end
|
||||
else if (cs == S_SEND_FRAME_HEADER) begin
|
||||
m_fir_tdata_i = mseqs ? 16'h8001 : 16'h7FFF;
|
||||
m_fir_tdata_q = mseqs ? 16'h8001 : 16'h7FFF;
|
||||
end
|
||||
@@ -336,7 +342,7 @@ module Transmitter #(
|
||||
m_fir_tdata_i = tx_data_src_tdata[15-:16];
|
||||
m_fir_tdata_q = tx_data_src_tdata[31-:16];
|
||||
end
|
||||
else if (cs == S_SEND_CHU_POS || cs == S_SEND_AGC) begin
|
||||
else if (cs == S_SEND_CHU_POS) begin
|
||||
m_fir_tdata_i = chu_seq[15-:16];
|
||||
m_fir_tdata_q = chu_seq[31-:16];
|
||||
end
|
||||
@@ -417,11 +423,23 @@ module Transmitter #(
|
||||
end
|
||||
end
|
||||
|
||||
// chu seq addr control
|
||||
always @(posedge clk) begin
|
||||
if (cs == S_IDLE) begin
|
||||
agc_addr <= 0;
|
||||
end
|
||||
else if (cs == S_SEND_AGC) begin
|
||||
if (fir_tvalid_in == 1'b1) begin
|
||||
agc_addr <= agc_addr + 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
// chu seq addr control
|
||||
always @(posedge clk) begin
|
||||
if (ns != cs) begin
|
||||
// chu_seq_addr <= 7'h7F - 7'h7; // 8 cp
|
||||
chu_seq_addr <= CHU_SEQ_LEN - PREFIX_LEN; // 8 cp
|
||||
chu_seq_addr <= CHU_SEQ_LEN - PREFIX_LEN; // 32 cp
|
||||
end
|
||||
else if (cs == S_SEND_CHU_POS || cs == S_SEND_AGC || cs == S_SEND_CHU_NEG) begin
|
||||
if (fir_tvalid_in == 1'b1) begin
|
||||
@@ -456,6 +474,12 @@ module Transmitter #(
|
||||
|
||||
// ******** Inst ********
|
||||
|
||||
bram_agc_header u_bram_agc_header (
|
||||
.clka (clk), // input wire clka
|
||||
.addra(agc_addr), // input wire [13 : 0] addra
|
||||
.douta(agc_data) // output wire [1 : 0] douta
|
||||
);
|
||||
|
||||
bram_m_seqs_512 u_bram_m_seqs_512 (
|
||||
.clka (clk),
|
||||
.addra(mseqs_addr),
|
||||
@@ -465,7 +489,7 @@ module Transmitter #(
|
||||
|
||||
bram_chu_seq u_bram_chu_seq (
|
||||
.clka (clk), // input wire clka
|
||||
.addra(chu_seq_addr), // input wire [6 : 0] addra
|
||||
.addra(chu_seq_addr), // input wire [7 : 0] addra
|
||||
.douta(chu_seq) // output wire [31 : 0] douta
|
||||
);
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ module add_prefix #(
|
||||
//! if the WIDTH or DATA_LEN parameter is changed, make sure the shift IP inside is also changed
|
||||
parameter WIDTH = 2,
|
||||
parameter DATA_LEN = 256,
|
||||
parameter PREFIX_LEN = 8
|
||||
parameter PREFIX_LEN = 32
|
||||
) (
|
||||
input clk,
|
||||
input start,
|
||||
|
||||
+4
-4
@@ -134,7 +134,7 @@ module enc_control #(
|
||||
// and the width convert fifo is empty
|
||||
// and the finally stage fifo is almost empty
|
||||
// TODO:check the conditions, done 2024年5月27日
|
||||
if (s_axis_fifo_tvalid && data_src_count != 0 && fifo_enc_out_prog_empty && ~data_add_prefix_in_ready && ~data_add_prefix_out_valid) begin
|
||||
if (s_axis_fifo_tvalid && data_src_count >= 32 && fifo_enc_out_prog_empty && ~data_add_prefix_in_ready && ~data_add_prefix_out_valid) begin
|
||||
ns = S_START;
|
||||
end
|
||||
else begin
|
||||
@@ -297,13 +297,13 @@ module enc_control #(
|
||||
|
||||
add_prefix #(
|
||||
.WIDTH (2), // ! if this parameter is changed, make sure the shift IP inside is also changed
|
||||
.DATA_LEN (256),
|
||||
.PREFIX_LEN(8)
|
||||
.DATA_LEN (256), //! if the WIDTH or DATA_LEN parameter is changed, make sure the shift IP inside is also changed
|
||||
.PREFIX_LEN(32)
|
||||
) u_add_prefix (
|
||||
.clk (clk),
|
||||
.start (add_prefix_start),
|
||||
.ready (add_prefix_in_ready),
|
||||
.data_in (data_add_prefix_in),
|
||||
.data_in ({data_add_prefix_in[0], data_add_prefix_in[1]}), // NOTE : reverse to adjust to IQmerge module
|
||||
.data_in_ready (data_add_prefix_in_ready),
|
||||
.data_out (data_add_prefix_out),
|
||||
.data_out_valid(data_add_prefix_out_valid)
|
||||
|
||||
Reference in New Issue
Block a user