读取.dat图像文件
.dat文件是matlab生成的图像文件
initial begin // Initialize Inputs CLK = 0; RST = 1; IMAGE_DATA = 0; BUFFER_WEN = 0; // Wait 100 ns for global reset to finish #10000; RST = 0; #100; RST = 1; // Add stimulus here $display("read image data from exp.dat file TO memery begin"); $readmemh ("C:/Users/Administrator/Desktop/Noise_Reduce/ReadData/exp.dat",RData); // $readmemh ("C:/Users/Administrator/Desktop/Noise_Reduce/Noise/data.dat",RData); //读取.dat 内的16进制数据函数,.dat文件只能有空格和回车 $display("send every pixel to TOP level HDL when every CLK negedge "); # 10; // @(negedge CLK); // @(negedge CLK); for(i=0;i<65536;i=i+1) begin BUFFER_WEN = #1 1; $display("send pixel RData[%d] to IMAGE_DATA is : %d",i,RData[i]); @(negedge CLK); IMAGE_DATA = #1 RData[i]; end BUFFER_WEN = #1 0; end
FPGA笔记-读取.dat文件
时间: 2024-10-27 03:11:23