`timescale 1 ps / 1 ps
module tst_tb;
reg clk ;
reg rst_n ;
initial
begin
clk = 0 ;
rst_n = 0;
#100 rst_n =1 ;
end
always #5 clk <= ~clk ;
///----------------------------------------------------------------
reg [7:0] data_buf [0:63] ;
reg [7:0] data_buf1 [0:8];
reg [7:0] data_buf2 [0:8];
//path_d = 'E:/MATLAB/file/lei/data_input/dat_in.txt'
initial
begin
//$readmemb()
$readmemh ("E:/MATLAB/file/lei/data_input/dat_in.txt", data_buf) ;
$readmemh ("E:/MATLAB/file/lei/data_input/dat3_3_in.txt", data_buf1) ;
$readmemh ("E:/MATLAB/file/lei/data_input/dat_biao.txt", data_buf2) ;
end
parameter M=10'd64;
reg [7:0] data_2 ;
reg [9:0] cnt_2 ;
always @(posedge clk or negedge rst_n)
begin
if(~rst_n)
cnt_2 <= 0 ;
else if(cnt_2 == 10'd8)
cnt_2 <= 10'd0 ;
else
cnt_2 <= cnt_2 + 1 ;
end
always @(posedge clk or negedge rst_n)
begin
if(~rst_n)
data_2 <= 0 ;
else
data_2 <= data_buf2[cnt_2] ;
end
reg cnt_vs;
reg cnt_vs1;
reg cnt_vs2;
reg [7:0] data_i1 ;
reg [9:0] cnt_d1 ;
always @(posedge clk or negedge rst_n)
begin
if(~rst_n)
cnt_d1 <= 0 ;
else
cnt_d1 <= data_2;
end
always @(posedge clk or negedge rst_n)
begin
if(~rst_n)
data_i1 <= 0 ;
else if(cnt_vs2)
data_i1 <= data_buf1[cnt_d1] ;
end
reg [9:0] cnt_row;
reg [9:0] cnt_row1;
reg [9:0] cnt;
reg [9:0