LAB 4
流水线的阻塞技术
我们先分析下这个三级流水线是如何阻塞的
assign pipe2_ready_go = ...
assign pipe2_allowin = !pipe2_valid || pipe2_ready_go && pipe3_allowin;
assign pipe2_to_pipe3_valid = pipe2_valid && pipe2_ready_go
always @(posedge clk) begin
if (rst) begin
pipe2_valid <= 1'b0;
end
else if (pipe2_allowa_in) begin
pipe2_valid <= pipe1_to_pipe2_valid;
end
if (pipe1_to_pipe2_valid && pipe2_allowain) begin
pipe2_data <= pipe1_data;
end
end
分析一下如果 pipe2_ready_go == 1'b0
时,即 pipe2 处被堵塞时的流水线会发生什么。
第一拍 pipe2_allowin , pipe2_to_pipe3_valid会为 0,于是 pipe1_allowin 和pipe1