vivado导出仿真波形数据至txt文件+matlab分析
vivado导出仿真波形数据至txt文件
若想把上述波形中的m_axis_data_tdata[31:0]打印出来,则只需在.v代码中加入以下代码,run behavioral simulation后,波形内容就会被保存下来。
下面展示代码
。
integer save_file;
initial begin
save_file = $fopen("路径/m_axis_data_tdata.txt"); //打开所创建的文件;若找不到该文件,则会自动创建该文件。
if(save_file == 0)begin
$display ("can not open the file!"); //如果创建文件失败,则会显示"can not open the file!"信息。
$stop;
end
end
always @(posedge clk) begin
if (data_en) begin
$fdisplay(save_file,"%d",m_axis_data_tdata