|
本帖最后由 zjzjzj 于 2023-11-8 11:50 编辑
大佬们,我想问一下,均值滤波仿真部分给出的代码,关于task的内容 变量是 bit 这样在xilinx中为什么会报错 bit is an unknown type ,这个部分是要改成reg类型 然后再加上begin -end吗?
bit [31:0] row_cnt;
bit [31:0] col_cnt;
bit [7:0] mem [image_width*image_height-1:0];
// task and function
task image_input;
bit [31:0] row_cnt;
bit [31:0] col_cnt;
bit [7:0] mem [image_width*image_height-1:0];
$readmemh("../../../../1_Matlab_Project/4.1_Avg_Filter/img_Gray1.dat",mem);
for(row_cnt = 0;row_cnt < image_height;row_cnt=row_cnt+1)
begin
repeat(5) @(posedge clk);
per_img_vsync = 1'b1;
repeat(5) @(posedge clk);
for(col_cnt = 0;col_cnt < image_width;col_cnt=col_cnt+1)
begin
per_img_href = 1'b1;
per_img_gray = mem[row_cnt*image_width+col_cnt];
@(posedge clk);
end
per_img_href = 1'b0;
end
per_img_vsync = 1'b0;
@(posedge clk);
endtask : image_input
|
|