Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MINOTAuR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MINOTAuR
MINOTAuR
Commits
434ff5a4
Commit
434ff5a4
authored
3 years ago
by
Alban Gruin
Browse files
Options
Downloads
Patches
Plain Diff
sras: size improvements
Signed-off-by:
Alban Gruin
<
alban.gruin@irit.fr
>
parent
bd549d06
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontend/sras.sv
+28
-21
28 additions, 21 deletions
src/frontend/sras.sv
with
28 additions
and
21 deletions
src/frontend/sras.sv
+
28
−
21
View file @
434ff5a4
...
...
@@ -54,38 +54,44 @@ module sras #(
assign
overflow
=
|
ovf_counter_q
[
ptr_spec_q
];
always_comb
begin
tos_d
=
tos_q
;
ovf_counter_d
=
ovf_counter_q
;
if
(
flush_i
)
begin
tos_d
=
'0
;
ovf_counter_d
=
'0
;
end
else
if
(
!
bad_spec_i
)
begin
if
(
push_i
&&
!
pop_i
)
begin
if
(
overflow
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
]
+
1'b1
;
end
else
begin
if
(
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
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
else
if
(
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
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
end
else
if
(
!
push_i
&&
pop_i
)
begin
if
(
ovf_counter_q
[
ptr_spec_q
]
!=
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
]
-
1'b1
;
end
else
begin
tos_d
[
ptr_spec_d
]
=
prev_minus_one
;
end
else
if
(
!
push_i
&&
pop_i
&&
ovf_counter_q
[
ptr_spec_q
]
!=
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
]
-
1'b1
;
end
else
if
(
!
bad_spec_i
&&
begin_spec_i
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
];
end
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
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
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
...
...
@@ -133,15 +139,16 @@ module sras #(
stack_q
[
i
];
end
initial
stack_q
=
'0
;
always_ff
@
(
posedge
clk_i
or
negedge
rst_ni
)
begin
stack_q
<=
stack_d
;
if
(
~
rst_ni
)
begin
stack_q
<=
'0
;
ptr_spec_q
<=
'0
;
ptr_backup_q
<=
'0
;
tos_q
<=
'0
;
ovf_counter_q
<=
'0
;
end
else
begin
stack_q
<=
stack_d
;
ptr_spec_q
<=
ptr_spec_d
;
ptr_backup_q
<=
ptr_backup_d
;
tos_q
<=
tos_d
;
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
8b89b80a
·
8 months ago
mentioned in commit
8b89b80a
mentioned in commit 8b89b80adbf5fde27a6e32fa2a7dfffb38da3449
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment