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
f963fd18
Commit
f963fd18
authored
3 years ago
by
Alban Gruin
Browse files
Options
Downloads
Patches
Plain Diff
sras: better condition handling (?)
Signed-off-by:
Alban Gruin
<
alban.gruin@irit.fr
>
parent
32942461
No related branches found
No related tags found
No related merge requests found
Pipeline
#10309
failed
8 months ago
Stage: build
Stage: write-back
Stage: write-through
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontend/sras.sv
+26
-16
26 additions, 16 deletions
src/frontend/sras.sv
with
26 additions
and
16 deletions
src/frontend/sras.sv
+
26
−
16
View file @
f963fd18
...
...
@@ -53,21 +53,29 @@ module sras #(
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
else
if
(
!
bad_spec_i
)
begin
if
(
push_i
&&
!
pop_i
)
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
)
begin
tos_d
[
ptr_spec_d
]
=
prev_minus_one
;
end
else
if
(
begin_spec_i
)
begin
tos_d
[
ptr_spec_d
]
=
tos_q
[
ptr_spec_q
];
end
end
end
logic
can_pop
,
can_push
;
assign
can_pop
=
pop_i
&&
!
bad_spec_i
;
assign
can_push
=
push_i
&&
!
bad_spec_i
;
assign
data_o
=
stack_q
[
previous_tos_addr
][
previous_tos
];
ariane_pkg
::
ras_t
to_push
;
assign
to_push
.
ra
=
(
push_i
)
?
data_i
:
0
;
assign
to_push
.
valid
=
push
_i
;
assign
to_push
.
valid
=
can_
push
;
ariane_pkg
::
ras_t
[
DEPTH
-
1
:
0
]
new_stack
,
prev_stack
;
...
...
@@ -78,11 +86,9 @@ module sras #(
new_stack
=
stack_q
[
ptr_spec_q
];
end
if
(
pop
_i
)
begin
if
(
can_
pop
)
begin
new_stack
[
previous_tos
]
=
to_push
;
end
if
(
push_i
)
begin
end
else
if
(
can_push
)
begin
new_stack
[
prev_plus_one
]
=
to_push
;
end
end
...
...
@@ -90,7 +96,7 @@ module sras #(
always_comb
begin
prev_stack
=
stack_q
[
ptr_spec_q
];
if
(
push
_i
)
begin
if
(
can_push
&&
begin_spec
_i
)
begin
prev_stack
[
pp_plus_one
]
=
to_push
;
end
end
...
...
@@ -124,9 +130,9 @@ module sras #(
assert
(
2
**
$
clog2
(
DEPTH
)
==
DEPTH
)
else
$
fatal
(
1
,
"[sras] DEPTH is not a power of 2"
);
end
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
push_i
|->
begin_spec_i
)
else
$
warning
(
1
,
"[sras] push_i & ~begin_spec_i"
);
//
assert property (
//
@(posedge clk_i) disable iff (!rst_ni) push_i |-> begin_spec_i)
//
else $warning (1,"[sras] push_i & ~begin_spec_i");
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
(
begin_spec_i
&
!
(
bad_spec_i
))
|->
(
ptr_spec_d
!=
ptr_backup_d
))
...
...
@@ -135,6 +141,10 @@ module sras #(
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
valid_spec_i
|->
((
ptr_backup_q
==
ptr_spec_q
)
|->
(
ptr_backup_d
==
ptr_spec_d
)))
else
$
fatal
(
1
,
"[sras] backup overtake"
);
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
can_push
|->
~
can_pop
&&
can_pop
|->
~
can_push
)
else
$
fatal
(
1
,
"[sras] push & pop at the same time"
);
`endif
// pragma translate_on
endmodule
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