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
32942461
Commit
32942461
authored
3 years ago
by
Alban Gruin
Browse files
Options
Downloads
Patches
Plain Diff
Revert "sras: lock SRAS if there is too much calls"
This reverts commit
071fc948
.
parent
f16ceed7
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
+21
-50
21 additions, 50 deletions
src/frontend/sras.sv
with
21 additions
and
50 deletions
src/frontend/sras.sv
+
21
−
50
View file @
32942461
...
@@ -16,8 +16,7 @@
...
@@ -16,8 +16,7 @@
// segmented return address stack
// segmented return address stack
module
sras
#(
module
sras
#(
parameter
int
unsigned
DEPTH
=
2
,
parameter
int
unsigned
DEPTH
=
2
,
parameter
int
unsigned
SpecDepth
=
16
,
parameter
int
unsigned
SpecDepth
=
16
parameter
int
unsigned
SZ_OVF
=
16
)(
)(
input
logic
clk_i
,
input
logic
clk_i
,
input
logic
rst_ni
,
input
logic
rst_ni
,
...
@@ -35,7 +34,6 @@ module sras #(
...
@@ -35,7 +34,6 @@ module sras #(
logic
[$
clog2
(
SpecDepth
)
-
1
:
0
]
ptr_backup_d
,
ptr_backup_q
;
logic
[$
clog2
(
SpecDepth
)
-
1
:
0
]
ptr_backup_d
,
ptr_backup_q
;
logic
[
SpecDepth
-
1
:
0
][$
clog2
(
DEPTH
)
-
1
:
0
]
tos_d
,
tos_q
;
logic
[
SpecDepth
-
1
:
0
][$
clog2
(
DEPTH
)
-
1
:
0
]
tos_d
,
tos_q
;
ariane_pkg
::
ras_t
[
SpecDepth
-
1
:
0
][
DEPTH
-
1
:
0
]
stack_d
,
stack_q
;
ariane_pkg
::
ras_t
[
SpecDepth
-
1
:
0
][
DEPTH
-
1
:
0
]
stack_d
,
stack_q
;
logic
[
SpecDepth
-
1
:
0
][
SZ_OVF
-
1
:
0
]
ovf_counter_d
,
ovf_counter_q
;
assign
ptr_spec_d
=
(
bad_spec_i
)
?
ptr_backup_q
:
(
begin_spec_i
)
?
ptr_spec_q
+
1'b1
:
ptr_spec_q
;
assign
ptr_spec_d
=
(
bad_spec_i
)
?
ptr_backup_q
:
(
begin_spec_i
)
?
ptr_spec_q
+
1'b1
:
ptr_spec_q
;
assign
ptr_backup_d
=
(
valid_spec_i
)
?
ptr_backup_q
+
1'b1
:
ptr_backup_q
;
assign
ptr_backup_d
=
(
valid_spec_i
)
?
ptr_backup_q
+
1'b1
:
ptr_backup_q
;
...
@@ -50,51 +48,26 @@ module sras #(
...
@@ -50,51 +48,26 @@ module sras #(
assign
pp_plus_one
=
tos_q
[
ptr_spec_q
]
+
1'b1
;
assign
pp_plus_one
=
tos_q
[
ptr_spec_q
]
+
1'b1
;
assign
prev_minus_one
=
previous_tos
-
1'b1
;
assign
prev_minus_one
=
previous_tos
-
1'b1
;
logic
overflow
;
assign
overflow
=
|
ovf_counter_q
[
ptr_spec_q
];
always_comb
begin
always_comb
begin
tos_d
=
tos_q
;
tos_d
=
tos_q
;
ovf_counter_d
=
ovf_counter_q
;
if
(
flush_i
)
begin
if
(
flush_i
)
begin
tos_d
=
'0
;
tos_d
=
'0
;
ovf_counter_d
=
'0
;
end
else
if
(
push_i
&&
!
pop_i
)
begin
end
else
if
(
!
bad_spec_i
)
begin
tos_d
[
ptr_spec_d
]
=
prev_plus_one
;
if
(
push_i
&&
!
pop_i
)
begin
tos_d
[
ptr_spec_q
]
=
pp_plus_one
;
if
(
overflow
)
begin
end
else
if
(
!
push_i
&&
pop_i
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
]
+
1'b1
;
tos_d
[
ptr_spec_d
]
=
prev_minus_one
;
end
else
begin
end
else
if
(
!
bad_spec_i
&&
begin_spec_i
)
begin
if
(
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
begin
tos_d
[
ptr_spec_d
]
=
tos_q
[
ptr_spec_q
];
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
;
end
else
begin
tos_d
[
ptr_spec_d
]
=
prev_plus_one
;
tos_d
[
ptr_spec_q
]
=
pp_plus_one
;
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
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
end
end
logic
can_pop
,
can_push
;
assign
can_pop
=
pop_i
&&
ovf_counter_d
[
ptr_spec_q
][
SZ_OVF
-
1
:
1
]
==
'0
&&
!
bad_spec_i
;
assign
can_push
=
push_i
&&
ovf_counter_d
[
ptr_spec_q
]
==
'0
&&
!
bad_spec_i
;
assign
data_o
=
stack_q
[
previous_tos_addr
][
previous_tos
];
assign
data_o
=
stack_q
[
previous_tos_addr
][
previous_tos
];
ariane_pkg
::
ras_t
to_push
;
ariane_pkg
::
ras_t
to_push
;
assign
to_push
.
ra
=
(
can_
push
)
?
data_i
:
0
;
assign
to_push
.
ra
=
(
push
_i
)
?
data_i
:
0
;
assign
to_push
.
valid
=
can_
push
;
assign
to_push
.
valid
=
push
_i
;
ariane_pkg
::
ras_t
[
DEPTH
-
1
:
0
]
new_stack
,
prev_stack
;
ariane_pkg
::
ras_t
[
DEPTH
-
1
:
0
]
new_stack
,
prev_stack
;
...
@@ -105,11 +78,11 @@ module sras #(
...
@@ -105,11 +78,11 @@ module sras #(
new_stack
=
stack_q
[
ptr_spec_q
];
new_stack
=
stack_q
[
ptr_spec_q
];
end
end
if
(
can_
pop
)
begin
if
(
pop
_i
)
begin
new_stack
[
previous_tos
]
=
to_push
;
new_stack
[
previous_tos
]
=
to_push
;
end
end
if
(
can_
push
)
begin
if
(
push
_i
)
begin
new_stack
[
prev_plus_one
]
=
to_push
;
new_stack
[
prev_plus_one
]
=
to_push
;
end
end
end
end
...
@@ -117,7 +90,7 @@ module sras #(
...
@@ -117,7 +90,7 @@ module sras #(
always_comb
begin
always_comb
begin
prev_stack
=
stack_q
[
ptr_spec_q
];
prev_stack
=
stack_q
[
ptr_spec_q
];
if
(
can_
push
)
begin
if
(
push
_i
)
begin
prev_stack
[
pp_plus_one
]
=
to_push
;
prev_stack
[
pp_plus_one
]
=
to_push
;
end
end
end
end
...
@@ -131,17 +104,15 @@ module sras #(
...
@@ -131,17 +104,15 @@ module sras #(
always_ff
@
(
posedge
clk_i
or
negedge
rst_ni
)
begin
always_ff
@
(
posedge
clk_i
or
negedge
rst_ni
)
begin
if
(
~
rst_ni
)
begin
if
(
~
rst_ni
)
begin
stack_q
<=
'0
;
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
;
end
else
begin
end
else
begin
stack_q
<=
stack_d
;
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
;
ovf_counter_q
<=
ovf_counter_d
;
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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