Skip to content
Snippets Groups Projects
Commit 7dfbc2e8 authored by Alban Gruin's avatar Alban Gruin
Browse files

sras: improve segmented RAS ressource usage


Signed-off-by: default avatarAlban Gruin <alban.gruin@irit.fr>
parent e5893b6f
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,19 @@ module sras #(
assign pp_plus_one = tos_q[ptr_spec_q] + 1'b1;
assign prev_minus_one = previous_tos - 1'b1;
for (genvar i = 0; i < SpecDepth; i++) begin
assign tos_d[i] = (flush_i) ? '0 :
(i == ptr_spec_d && push_i && !pop_i) ? prev_plus_one :
(i == ptr_spec_q && push_i && !pop_i) ? pp_plus_one :
(i == ptr_spec_d && !push_i && pop_i) ? prev_minus_one :
(i == ptr_spec_d && !bad_spec_i && begin_spec_i) ? tos_q[ptr_spec_q] :
tos_q[i];
always_comb begin
tos_d = tos_q;
if (flush_i) begin
tos_d = '0;
end else if (push_i && !pop_i) begin
tos_d[ptr_spec_d] = prev_plus_one;
tos_d[ptr_spec_q] = pp_plus_one;
end else if (!push_i && pop_i) begin
tos_d[ptr_spec_d] = prev_minus_one;
end else if (!bad_spec_i && begin_spec_i) begin
tos_d[ptr_spec_d] = tos_q[ptr_spec_q];
end
end
assign data_o = stack_q[previous_tos_addr][previous_tos];
......@@ -65,14 +71,28 @@ module sras #(
ariane_pkg::ras_t [DEPTH-1:0] new_stack, prev_stack;
for (genvar i = 0; i < DEPTH; i++) begin
assign new_stack[i] = ((i == previous_tos && pop_i) ||
(i == prev_plus_one && push_i)) ? to_push :
(!bad_spec_i && begin_spec_i) ? stack_q[ptr_spec_q][i] :
stack_q[ptr_spec_d][i];
always_comb begin
new_stack = stack_q[ptr_spec_d];
if (!bad_spec_i && begin_spec_i) begin
new_stack = stack_q[ptr_spec_q];
end
if (pop_i) begin
new_stack[previous_tos] = to_push;
end
assign prev_stack[i] = (i == pp_plus_one && push_i) ? to_push :
stack_q[ptr_spec_q][i];
if (push_i) begin
new_stack[prev_plus_one] = to_push;
end
end
always_comb begin
prev_stack = stack_q[ptr_spec_q];
if (push_i) begin
prev_stack[pp_plus_one] = to_push;
end
end
for (genvar i = 0; i < SpecDepth; i++) begin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment