Line 24... |
Line 24... |
// rx tsu interface
|
// rx tsu interface
|
output rx_q_rst_out,
|
output rx_q_rst_out,
|
output rx_q_rd_clk_out,
|
output rx_q_rd_clk_out,
|
output rx_q_rd_en_out,
|
output rx_q_rd_en_out,
|
input [ 7:0] rx_q_stat_in,
|
input [ 7:0] rx_q_stat_in,
|
input [55:0] rx_q_data_in,
|
input [63:0] rx_q_data_in,
|
// tx tsu interface
|
// tx tsu interface
|
output tx_q_rst_out,
|
output tx_q_rst_out,
|
output tx_q_rd_clk_out,
|
output tx_q_rd_clk_out,
|
output tx_q_rd_en_out,
|
output tx_q_rd_en_out,
|
input [ 7:0] tx_q_stat_in,
|
input [ 7:0] tx_q_stat_in,
|
input [55:0] tx_q_data_in
|
input [63:0] tx_q_data_in
|
);
|
);
|
|
|
parameter const_00 = 8'h00;
|
parameter const_00 = 8'h00;
|
parameter const_04 = 8'h04;
|
parameter const_04 = 8'h04;
|
parameter const_08 = 8'h08;
|
parameter const_08 = 8'h08;
|
Line 139... |
Line 139... |
end
|
end
|
|
|
// read registers
|
// read registers
|
reg [37:0] time_reg_ns_int;
|
reg [37:0] time_reg_ns_int;
|
reg [47:0] time_reg_sec_int;
|
reg [47:0] time_reg_sec_int;
|
reg [55:0] rx_q_data_int;
|
reg [63:0] rx_q_data_int;
|
reg [ 7:0] rx_q_stat_int;
|
reg [ 7:0] rx_q_stat_int;
|
reg [55:0] tx_q_data_int;
|
reg [63:0] tx_q_data_int;
|
reg [ 7:0] tx_q_stat_int;
|
reg [ 7:0] tx_q_stat_int;
|
reg time_ok;
|
reg time_ok;
|
|
|
reg [31:0] data_out_reg;
|
reg [31:0] data_out_reg;
|
always @(posedge clk) begin
|
always @(posedge clk) begin
|
Line 167... |
Line 167... |
if (rd_in && cs_3c) data_out_reg <= reg_3c;
|
if (rd_in && cs_3c) data_out_reg <= reg_3c;
|
if (rd_in && cs_40) data_out_reg <= {16'd0, time_reg_sec_int[47:32]};
|
if (rd_in && cs_40) data_out_reg <= {16'd0, time_reg_sec_int[47:32]};
|
if (rd_in && cs_44) data_out_reg <= time_reg_sec_int[31: 0];
|
if (rd_in && cs_44) data_out_reg <= time_reg_sec_int[31: 0];
|
if (rd_in && cs_48) data_out_reg <= { 2'd0, time_reg_ns_int [37: 8]};
|
if (rd_in && cs_48) data_out_reg <= { 2'd0, time_reg_ns_int [37: 8]};
|
if (rd_in && cs_4c) data_out_reg <= {24'd0, time_reg_ns_int [ 7: 0]};
|
if (rd_in && cs_4c) data_out_reg <= {24'd0, time_reg_ns_int [ 7: 0]};
|
if (rd_in && cs_50) data_out_reg <= { 8'd0, rx_q_data_int[55:32]};
|
if (rd_in && cs_50) data_out_reg <= rx_q_data_int[63:32];
|
if (rd_in && cs_54) data_out_reg <= rx_q_data_int[31: 0];
|
if (rd_in && cs_54) data_out_reg <= rx_q_data_int[31: 0];
|
if (rd_in && cs_58) data_out_reg <= { 8'd0, tx_q_data_int[55:32]};
|
if (rd_in && cs_58) data_out_reg <= tx_q_data_int[63:32];
|
if (rd_in && cs_5c) data_out_reg <= tx_q_data_int[31: 0];
|
if (rd_in && cs_5c) data_out_reg <= tx_q_data_int[31: 0];
|
end
|
end
|
assign data_out = data_out_reg;
|
assign data_out = data_out_reg;
|
|
|
// register mapping
|
// register mapping
|