// read single
task rd;
input [31:0] adr;
output [31:0] result;
begin
cycle_end = 1;
address = adr;
selects = 255;
write_flag = 0;
GO <= 1;
@(posedge CLK_I);
// GO <= 0;
// wait for cycle to start
while (~CYC_O)
@(posedge CLK_I);
// wait for cycle to end
while (CYC_O)
@(posedge CLK_I);
result = data;
//$display(" Reading %h from address %h", result, address);
end
endtask // read
GO <= 1;
@(posedge CLK_I); //这句 完全 没看懂。这个不都是跟在always后面。表示电平敏感列表的吗? 看这段代码 好像是做了什么事情。 不知道具体是个什么行为
task rd;
input [31:0] adr;
output [31:0] result;
begin
cycle_end = 1;
address = adr;
selects = 255;
write_flag = 0;
GO <= 1;
@(posedge CLK_I);
// GO <= 0;
// wait for cycle to start
while (~CYC_O)
@(posedge CLK_I);
// wait for cycle to end
while (CYC_O)
@(posedge CLK_I);
result = data;
//$display(" Reading %h from address %h", result, address);
end
endtask // read
GO <= 1;
@(posedge CLK_I); //这句 完全 没看懂。这个不都是跟在always后面。表示电平敏感列表的吗? 看这段代码 好像是做了什么事情。 不知道具体是个什么行为