api: print more debug csr

This commit is contained in:
morgan 2025-01-17 12:40:20 +08:00
parent 5b7c280414
commit b3e06ccf13

View File

@ -48,26 +48,45 @@ pub extern "C" fn cxp_setup() -> bool {
pub extern "C" fn cxp_debug_frame_print() {
use libboard_zynq::println;
use crate::pl::csr::{cxp_frame_pipeline, CXP};
const LEN: usize = 200;
use crate::pl::csr::CXP;
const LEN: usize = 512;
let mut eop: [u8; LEN] = [0; LEN];
let mut pak_arr: [u32; LEN] = [0; LEN];
let mut k_arr: [u8; LEN] = [0; LEN];
let mut err: [u8; LEN] = [0; LEN];
let mut i: usize = 0;
unsafe {
while cxp_frame_pipeline::debug_out_dout_valid_read() == 1 {
pak_arr[i] = cxp_frame_pipeline::debug_out_dout_pak_read();
k_arr[i] = cxp_frame_pipeline::debug_out_kout_pak_read();
eop[i] = cxp_frame_pipeline::debug_out_eop_read();
err[i] = cxp_frame_pipeline::debug_out_crc_error_read();
// println!("received {:#04X}", pak_arr[i]);
cxp_frame_pipeline::debug_out_inc_write(1);
i += 1;
if i == LEN {
break;
}
}
use crate::pl::csr::cxp_frame_pipeline;
println!(
"roi counter = {} | roi update = {}",
cxp_frame_pipeline::roi_counter_read(),
cxp_frame_pipeline::roi_update_read()
);
if cxp_frame_pipeline::roi_update_read() == 1 {
println!("roi update clear");
cxp_frame_pipeline::roi_update_write(1);
};
println!("pixel4x[0] y = {}", cxp_frame_pipeline::pix_y_read(),);
println!(
"header decode l_size = {} | x_size = {} | y_size = {} | new lines count = {}",
cxp_frame_pipeline::header_l_size_read(),
cxp_frame_pipeline::header_x_size_read(),
cxp_frame_pipeline::header_y_size_read(),
cxp_frame_pipeline::header_new_line_read(),
);
// while cxp_frame_pipeline::debug_out_dout_valid_read() == 1 {
// pak_arr[i] = cxp_frame_pipeline::debug_out_dout_pak_read();
// k_arr[i] = cxp_frame_pipeline::debug_out_kout_pak_read();
// eop[i] = cxp_frame_pipeline::debug_out_eop_read();
// err[i] = cxp_frame_pipeline::debug_out_crc_error_read();
// // println!("received {:#04X}", pak_arr[i]);
// cxp_frame_pipeline::debug_out_inc_write(1);
// i += 1;
// if i == LEN {
// break;
// }
// }
// let channel: usize = 0;
// while (CXP[channel].rx_debug_out_dout_valid_read)() == 1 {
// pak_arr[i] = (CXP[channel].rx_debug_out_dout_pak_read)();
@ -79,15 +98,16 @@ pub extern "C" fn cxp_debug_frame_print() {
// break;
// }
// }
println!(
"Decode error = {}",
(CXP[MASTER_CHANNEL as usize].rx_reader_decode_err_read)()
);
println!("Trigger ack = {}", (CXP[MASTER_CHANNEL as usize].rx_trigger_ack_read)());
// println!(
// "Decode error = {}",
// (CXP[MASTER_CHANNEL as usize].rx_reader_decode_err_read)()
// );
if (CXP[MASTER_CHANNEL as usize].rx_trigger_ack_read)() == 1 {
println!("Trigger ack clear");
println!("Trigger ack recv and clear");
(CXP[MASTER_CHANNEL as usize].rx_trigger_ack_write)(1);
};
} else {
println!("NO Trigger ack");
}
}
cxp_ctrl::print_decode_error(MASTER_CHANNEL);
if i > 0 {