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
cd7dabb4
Commit
cd7dabb4
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
e17128ee
Branches
Branches containing commit
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
+18
-18
18 additions, 18 deletions
src/frontend/sras.sv
with
18 additions
and
18 deletions
src/frontend/sras.sv
+
18
−
18
View file @
cd7dabb4
...
@@ -54,6 +54,10 @@ module sras #(
...
@@ -54,6 +54,10 @@ module sras #(
logic
overflow
;
logic
overflow
;
assign
overflow
=
|
ovf_counter_q
[
ptr_spec_q
];
assign
overflow
=
|
ovf_counter_q
[
ptr_spec_q
];
logic
[
SZ_OVF
-
1
:
0
]
ovf_plus_one
,
ovf_minus_one
;
assign
ovf_plus_one
=
ovf_counter_q
[
ptr_spec_q
]
+
1'b1
;
assign
ovf_minus_one
=
ovf_counter_q
[
ptr_spec_q
]
-
1'b1
;
always_comb
begin
always_comb
begin
ovf_counter_d
=
ovf_counter_q
;
ovf_counter_d
=
ovf_counter_q
;
...
@@ -62,23 +66,23 @@ module sras #(
...
@@ -62,23 +66,23 @@ module sras #(
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
||
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
begin
if
(
overflow
||
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
counter_q
[
ptr_spec_q
]
+
1'b1
;
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
plus_one
;
end
end
if
((
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
&&
begin_spec_i
)
begin
if
((
prev_plus_one
==
'0
||
pp_plus_one
==
'0
)
&&
begin_spec_i
)
begin
ovf_counter_d
[
ptr_spec_q
]
=
ovf_
counter_q
[
ptr_spec_q
]
+
1'b1
;
ovf_counter_d
[
ptr_spec_q
]
=
ovf_
plus_one
;
end
end
end
else
if
(
!
push_i
&&
pop_i
)
begin
end
else
if
(
!
push_i
&&
pop_i
)
begin
if
(
ovf_counter_q
[
ptr_spec_q
]
==
'0
)
begin
if
(
ovf_counter_q
[
ptr_spec_q
]
==
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
'0
;
// ovf_counter_d[ptr_spec_d] =
ovf_counter_q[ptr_spec_q];
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
];
end
else
begin
end
else
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
counter_q
[
ptr_spec_q
]
-
1'b1
;
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
minus_one
;
end
end
end
else
if
(
begin_spec_i
)
begin
end
else
if
(
begin_spec_i
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
];
ovf_counter_d
[
ptr_spec_d
]
=
ovf_counter_q
[
ptr_spec_q
];
end
end
end
else
if
(
bad_spec_i
&&
resolved_type_i
==
ariane_pkg
::
Return
&&
ovf_counter_q
[
ptr_spec_q
]
!=
'0
)
begin
end
else
if
(
bad_spec_i
&&
resolved_type_i
==
ariane_pkg
::
Return
&&
ovf_counter_q
[
ptr_spec_q
]
!=
'0
)
begin
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
counter_q
[
ptr_spec_q
]
-
1'b1
;
ovf_counter_d
[
ptr_spec_d
]
=
ovf_
minus_one
;
end
end
end
end
...
@@ -112,7 +116,8 @@ module sras #(
...
@@ -112,7 +116,8 @@ module sras #(
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
=
data_i
;
// assign to_push.ra = (can_push) ? data_i : 0;
assign
to_push
.
valid
=
can_push
;
assign
to_push
.
valid
=
can_push
;
ariane_pkg
::
ras_t
[
DEPTH
-
1
:
0
]
new_stack
,
prev_stack
;
ariane_pkg
::
ras_t
[
DEPTH
-
1
:
0
]
new_stack
,
prev_stack
;
...
@@ -126,19 +131,14 @@ module sras #(
...
@@ -126,19 +131,14 @@ module sras #(
if
(
can_pop
)
begin
if
(
can_pop
)
begin
new_stack
[
previous_tos
]
=
to_push
;
new_stack
[
previous_tos
]
=
to_push
;
end
end
else
if
(
can_push
)
begin
if
(
can_push
)
begin
new_stack
[
prev_plus_one
]
=
to_push
;
new_stack
[
prev_plus_one
]
=
to_push
;
end
end
end
end
always_comb
begin
for
(
genvar
i
=
0
;
i
<
DEPTH
;
i
++
)
begin
prev_stack
=
stack_q
[
ptr_spec_q
];
assign
prev_stack
[
i
]
=
(
i
==
pp_plus_one
&&
can_push
&&
begin_spec_i
)
?
to_push
:
stack_q
[
ptr_spec_q
][
i
];
if
(
can_push
&&
begin_spec_i
)
begin
prev_stack
[
pp_plus_one
]
=
to_push
;
end
end
end
for
(
genvar
i
=
0
;
i
<
SpecDepth
;
i
++
)
begin
for
(
genvar
i
=
0
;
i
<
SpecDepth
;
i
++
)
begin
...
@@ -148,16 +148,16 @@ module sras #(
...
@@ -148,16 +148,16 @@ module sras #(
stack_q
[
i
];
stack_q
[
i
];
end
end
initial
stack_q
=
'0
;
//
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
;
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
e06bad87
·
8 months ago
mentioned in commit
e06bad87
mentioned in commit e06bad873d81a489153731918ad0929dbb809913
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