☰
vivado仿真数据导出用于matlab处理
2026/10/10 1:26:02 网站建设 项目流程

在tb文件中增加代码

integer save_file;
initial begin
save_file = $fopen("tx_fifo_data.txt", "w"); // Open or create a text file for writing
if (save_file == 0) begin
$display("Error: Cannot open file.");
$stop;
end
end

// Generate some test data
always @(posedge tx_clk) begin
if (tx_fifo_valid) begin // 当 fifo_out_valid 有效时记录数据
$fwrite(save_file, "Time: %0t, tx_fifo_data: %0h\n", $time, tx_fifo_data); // 以16进制输出 fifo_out
end
end

// Close the files at the end of the simulation
initial begin
#4000000 ; // Run for 4000000 time units (you can adjust this as needed)

// Close all files
$fclose(save_file);

// End the simulation
$stop;
end
文件路径:自己工程下找sim;

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询