RVSCC/rtl/rotate_cru.sv
Mario Romero 24a5622103
Some checks are pending
continuous-integration/drone/push Build is pending
Add 5 stage pipeline test and move timescale to include
2023-02-27 23:22:34 -03:00

28 lines
571 B
Systemverilog

`include "timescale.sv"
module rotate_cru#(
parameter ADDR_SIZE = 32,
parameter NUM_SETS = 16,
parameter NUM_WAYS = 4,
parameter BLOCK_SIZE = 32
)(
input logic clk, rst,
input logic replace,
output logic[LRU_INDEX_SIZE - 1:0] preferred
);
logic[LRU_INDEX_SIZE - 1:0] write_preference;
always_comb begin
preferred = write_preference;
end
always_ff @(posedge clk) begin
if (rst)
write_preference <= 0;
else if(replace)
write_preference += 1;
end
endmodule