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
484754dc
Commit
484754dc
authored
3 years ago
by
Alban Gruin
Browse files
Options
Downloads
Patches
Plain Diff
cva6: don't backup on direct jumps
Signed-off-by:
Alban Gruin
<
alban.gruin@irit.fr
>
parent
071fc948
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/ariane.sv
+1
-1
1 addition, 1 deletion
src/ariane.sv
src/frontend/frontend.sv
+6
-2
6 additions, 2 deletions
src/frontend/frontend.sv
src/frontend/sras.sv
+20
-12
20 additions, 12 deletions
src/frontend/sras.sv
with
27 additions
and
15 deletions
src/ariane.sv
+
1
−
1
View file @
484754dc
...
...
@@ -688,7 +688,7 @@ module ariane import ariane_pkg::*; #(
`ifdef
WT_DCACHE
logic
icache_valid_spec
,
icache_bad_spec
;
assign
icache_valid_spec
=
resolved_branch
.
valid
&&
!
(
resolved_branch
.
is_mispredict
);
assign
icache_valid_spec
=
resolved_branch
.
valid
&&
!
(
resolved_branch
.
is_mispredict
)
&&
(
resolved_branch
.
cf_type
!=
Jump
)
;
assign
icache_bad_spec
=
resolved_branch
.
valid
&&
resolved_branch
.
is_mispredict
;
// this is a cache subsystem that is compatible with OpenPiton
...
...
This diff is collapsed.
Click to expand it.
src/frontend/frontend.sv
+
6
−
2
View file @
484754dc
...
...
@@ -165,7 +165,7 @@ module frontend import ariane_pkg::*; #(
assign
is_cf
[
i
]
=
instruction_valid
[
i
]
&
(
rvi_branch
[
i
]
|
rvc_branch
[
i
]
|
rvi_jalr
[
i
]
|
rvc_jalr
[
i
]
|
rvc_jr
[
i
]);
end
assign
begin_spec_o
=
(
(
|
is_branch
)
|
(
|
is_call
)
|
(
|
is_return
)
|
(
|
is_jump
)
|
(
|
is_jalr
)
)
&
(
~
replay
);
assign
begin_spec_o
=
(
|
is_cf
)
&
(
~
replay
);
// taken/not taken
always_comb
begin
...
...
@@ -253,7 +253,8 @@ module frontend import ariane_pkg::*; #(
// contains a valid prediction.
for
(
int
i
=
0
;
i
<
INSTR_PER_FETCH
;
i
++
)
bp_valid
|=
((
cf_type
[
i
]
!=
NoCF
&
cf_type
[
i
]
!=
Return
)
|
((
cf_type
[
i
]
==
Return
)
&
ras_predict
.
valid
));
end
assign
is_correct_predict
=
resolved_branch_i
.
valid
&
!
(
resolved_branch_i
.
is_mispredict
);
assign
is_correct_predict
=
resolved_branch_i
.
valid
&
!
(
resolved_branch_i
.
is_mispredict
)
&
(
resolved_branch_i
.
cf_type
!=
Jump
);
assign
is_mispredict
=
resolved_branch_i
.
valid
&
resolved_branch_i
.
is_mispredict
;
// Cache interface
...
...
@@ -471,6 +472,9 @@ module frontend import ariane_pkg::*; #(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
replay
|->
~
instr_queue_ready
)
else
$
warning
(
1
,
"[frontend] replay & instr_queue_ready..."
);
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
resolved_branch_i
.
cf_type
==
Jump
|->
!
resolved_branch_i
.
is_mispredict
)
else
$
warning
(
1
,
"[frontend] mispredicted jump"
);
`endif
// pragma translate_on
endmodule
This diff is collapsed.
Click to expand it.
src/frontend/sras.sv
+
20
−
12
View file @
484754dc
...
...
@@ -67,10 +67,14 @@ module sras #(
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
;
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
;
tos_d
[
ptr_spec_q
]
=
pp_plus_one
;
if
(
begin_spec_i
)
begin
tos_d
[
ptr_spec_q
]
=
pp_plus_one
;
end
end
end
end
else
if
(
!
push_i
&&
pop_i
)
begin
...
...
@@ -117,7 +121,7 @@ module sras #(
always_comb
begin
prev_stack
=
stack_q
[
ptr_spec_q
];
if
(
can_push
)
begin
if
(
can_push
&&
begin_spec_i
)
begin
prev_stack
[
pp_plus_one
]
=
to_push
;
end
end
...
...
@@ -153,17 +157,21 @@ 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))
// else $warning (1,"[sras] speculation overflow");
assert
property
(
@
(
posedge
clk_i
)
disable
iff
(
!
rst_ni
)
(
begin_spec_i
&
!
(
bad_spec_i
)
)
|->
(
ptr_spec_d
!
=
ptr_backup_d
))
else
$
fatal
(
1
,
"[sras]
speculation overflow
"
);
//
assert property (
//
@(posedge clk_i) disable iff (!rst_ni) (begin_spec_i & (
!
bad_spec_i)
&
(ptr_spec_d
=
= ptr_backup_d))
|-> (~push_i))
//
else $
warning
(1,"[sras]
backup overwrite
");
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) valid_spec_i |-> ((ptr_backup_q == ptr_spec_q) |-> (ptr_backup_d == ptr_spec_d)))
//
else $fatal (1,"[sras] backup overtake");
`endif
// pragma translate_on
endmodule
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
f16ceed7
·
8 months ago
mentioned in commit
f16ceed7
mentioned in commit f16ceed710fbae1e83844cb535b284cc41b5e912
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