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

Revert "sras: size improvements"

This reverts commit 434ff5a4.
parent fa209d0a
No related branches found
No related tags found
No related merge requests found
...@@ -54,44 +54,38 @@ module sras #( ...@@ -54,44 +54,38 @@ module sras #(
assign overflow = |ovf_counter_q[ptr_spec_q]; assign overflow = |ovf_counter_q[ptr_spec_q];
always_comb begin always_comb begin
tos_d = tos_q;
ovf_counter_d = ovf_counter_q; ovf_counter_d = ovf_counter_q;
if (flush_i) begin if (flush_i) begin
tos_d = '0;
ovf_counter_d = '0; ovf_counter_d = '0;
end else if (!bad_spec_i) begin end else if (!bad_spec_i) begin
if (push_i && !pop_i) begin if (push_i && !pop_i) begin
if (overflow) begin if (overflow) begin
ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] + 1'b1; ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] + 1'b1;
end else if (prev_plus_one == '0 || pp_plus_one == '0) begin end else begin
ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] + 1'b1; if (prev_plus_one == '0 || pp_plus_one == '0) begin
if (begin_spec_i) begin ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] + 1'b1;
ovf_counter_d[ptr_spec_q] = ovf_counter_q[ptr_spec_q] + 1'b1; if (begin_spec_i) begin
ovf_counter_d[ptr_spec_q] = ovf_counter_q[ptr_spec_q] + 1'b1;
end
end else begin
tos_d[ptr_spec_d] = prev_plus_one;
if (begin_spec_i) begin
tos_d[ptr_spec_q] = pp_plus_one;
end
end end
end end
end else if (!push_i && pop_i && ovf_counter_q[ptr_spec_q] != '0) begin end else if (!push_i && pop_i) begin
ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] - 1'b1; if (ovf_counter_q[ptr_spec_q] != '0) begin
end else if (!bad_spec_i && begin_spec_i) begin ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q] - 1'b1;
ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q]; end else begin
end tos_d[ptr_spec_d] = prev_minus_one;
end
end
always_comb begin
tos_d = tos_q;
if (flush_i) begin
tos_d = '0;
end else if (!bad_spec_i) begin
if (push_i && !pop_i && !overflow && prev_plus_one != '0 && pp_plus_one != '0) begin
tos_d[ptr_spec_d] = prev_plus_one;
if (begin_spec_i) begin
tos_d[ptr_spec_q] = pp_plus_one;
end end
end else if (!push_i && pop_i && ovf_counter_q[ptr_spec_q] == '0) begin
tos_d[ptr_spec_d] = prev_minus_one;
end else if (!bad_spec_i && begin_spec_i) begin end else if (!bad_spec_i && begin_spec_i) begin
tos_d[ptr_spec_d] = tos_q[ptr_spec_q]; tos_d[ptr_spec_d] = tos_q[ptr_spec_q];
ovf_counter_d[ptr_spec_d] = ovf_counter_q[ptr_spec_q];
end end
end end
end end
...@@ -139,16 +133,15 @@ module sras #( ...@@ -139,16 +133,15 @@ module sras #(
stack_q[i]; stack_q[i];
end end
initial stack_q = '0;
always_ff @(posedge clk_i or negedge rst_ni) begin always_ff @(posedge clk_i or negedge rst_ni) begin
stack_q <= stack_d;
if (~rst_ni) begin if (~rst_ni) begin
stack_q <= '0;
ptr_spec_q <= '0; ptr_spec_q <= '0;
ptr_backup_q <= '0; ptr_backup_q <= '0;
tos_q <= '0; tos_q <= '0;
ovf_counter_q <= '0; ovf_counter_q <= '0;
end else begin end else begin
stack_q <= stack_d;
ptr_spec_q <= ptr_spec_d; ptr_spec_q <= ptr_spec_d;
ptr_backup_q <= ptr_backup_d; ptr_backup_q <= ptr_backup_d;
tos_q <= tos_d; tos_q <= tos_d;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment