Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Accelerator Wrapper Tech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
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
SoCLabs
Accelerator Wrapper Tech
Commits
8cdaed6e
Commit
8cdaed6e
authored
2 years ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
SOC1-166
: Moved valid filter and renamed signals
parent
1c77ddd1
No related branches found
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
hdl/src/wrapper_valid_filter.sv
+58
-0
58 additions, 0 deletions
hdl/src/wrapper_valid_filter.sv
with
58 additions
and
0 deletions
hdl/src/wrapper_valid_filter.sv
0 → 100644
+
58
−
0
View file @
8cdaed6e
//-----------------------------------------------------------------------------
// SoC Labs Valid Signal Filter Module
// A joint work commissioned on behalf of SoC Labs; under Arm Academic Access license.
//
// Contributors
//
// David Mapstone (d.a.mapstone@soton.ac.uk)
//
// Copyright 2023; SoC Labs (www.soclabs.org)
//-----------------------------------------------------------------------------
module
wrapper_valid_filter
(
input
logic
clk
,
input
logic
rst
,
input
logic
data_in_last
,
input
logic
data_in_valid
,
input
logic
data_in_ready
,
input
logic
data_out_valid
,
output
logic
payload_out_valid
);
logic
[
63
:
0
]
block_count
,
count_check
,
digest_count
;
logic
prev_last
;
logic
prev_data_out_valid
;
always_ff
@
(
posedge
clk
,
posedge
rst
)
begin
if
(
rst
)
begin
block_count
<=
'd0
;
count_check
<=
'd0
;
digest_count
<=
'd0
;
prev_data_out_valid
<=
'd0
;
// payload_out_valid <= 1'd0;
prev_last
<=
1'd0
;
end
else
begin
prev_data_out_valid
<=
data_out_valid
;
if
(
data_in_valid
&&
data_in_ready
)
begin
prev_last
<=
data_in_last
;
if
(
data_in_last
)
begin
block_count
<=
'd0
;
count_check
<=
block_count
+
1'd1
;
end
else
begin
block_count
<=
block_count
+
64'd1
;
end
end
if
(
data_out_valid
==
1'd0
&&
prev_data_out_valid
==
1'd1
)
begin
if
(
digest_count
==
(
count_check
-
64'd1
))
begin
digest_count
<=
'd0
;
// payload_out_valid <= 1'b1;
end
else
begin
digest_count
<=
digest_count
+
'd1
;
end
end
end
end
// Only takes Valid High for 1 Clock Cycle (Requires Change) and only takes valid high on when correct number of output packets seen
assign
payload_out_valid
=
(
digest_count
==
(
count_check
-
64'd1
))
&&
~
prev_data_out_valid
?
data_out_valid
:
1'b0
;
endmodule
\ No newline at end of file
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