Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SoCLabs SHA-2 Accelerator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Model registry
Operate
Environments
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
SoCLabs SHA-2 Accelerator
Commits
30c0e5d1
Commit
30c0e5d1
authored
2 years ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
ATO2-24
: Added a message block fifo to help debugging of message builder
parent
4d1b1cf0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hdl/src/sha256_engine.sv
+29
-5
29 additions, 5 deletions
hdl/src/sha256_engine.sv
hdl/verif/tb_sha256_message_build.sv
+2
-2
2 additions, 2 deletions
hdl/verif/tb_sha256_message_build.sv
with
31 additions
and
7 deletions
hdl/src/sha256_engine.sv
+
29
−
5
View file @
30c0e5d1
...
...
@@ -57,6 +57,11 @@ module sha256_engine (
logic
message_block_valid
;
logic
message_block_ready
;
logic
[
511
:
0
]
message_block_buffered
;
logic
message_block_last_buffered
;
logic
message_block_valid_buffered
;
logic
message_block_ready_buffered
;
logic
[
255
:
0
]
hash
;
logic
hash_last
;
logic
hash_valid
;
...
...
@@ -89,9 +94,9 @@ module sha256_engine (
.
en
(
en
),
.
sync_rst
(
sync_rst
),
.
data_in
(
{
cfg_size
,
cfg_scheme
}
),
.
data_in_valid
(
cfg_
in_
valid
),
.
data_in_ready
(
cfg_
in_
ready
),
.
data_in_last
(
cfg_
in_
last
),
.
data_in_valid
(
cfg_valid
),
.
data_in_ready
(
cfg_ready
),
.
data_in_last
(
cfg_last
),
.
data_out
(
{
cfg_size_buffered
,
cfg_scheme_buffered
}
),
.
data_out_last
(
cfg_last_buffered
),
.
data_out_valid
(
cfg_valid_buffered
),
...
...
@@ -119,8 +124,10 @@ module sha256_engine (
.
data_out_ready
(
message_block_ready
)
);
// Hash Compression (Peform Hash Calculation)
sha256_hash_compression
hash_calculator
(
// Intermediate FIFO
fifo_vr
#(
16
,
// Depth
512
// Data Width
)
message_block_buffer
(
.
clk
(
clk
),
.
nrst
(
nrst
),
.
en
(
en
),
...
...
@@ -129,6 +136,23 @@ module sha256_engine (
.
data_in_valid
(
message_block_valid
),
.
data_in_ready
(
message_block_ready
),
.
data_in_last
(
message_block_last
),
.
data_out
(
message_block_buffered
),
.
data_out_last
(
message_block_last_buffered
),
.
data_out_valid
(
message_block_valid_buffered
),
.
data_out_ready
(
message_block_ready_buffered
)
);
// Hash Compression (Peform Hash Calculation)
sha256_hash_compression
hash_calculator
(
.
clk
(
clk
),
.
nrst
(
nrst
),
.
en
(
en
),
.
sync_rst
(
sync_rst
),
.
data_in
(
message_block_buffered
),
.
data_in_valid
(
message_block_valid_buffered
),
.
data_in_ready
(
message_block_ready_buffered
),
.
data_in_last
(
message_block_last_buffered
),
.
data_out
(
hash
),
.
data_out_last
(
hash_last
),
.
data_out_valid
(
hash_valid
),
...
...
This diff is collapsed.
Click to expand it.
hdl/verif/tb_sha256_message_build.sv
+
2
−
2
View file @
30c0e5d1
...
...
@@ -154,12 +154,12 @@ module tb_sha256_message_build;
$
error
(
"data_out missmatch! packet %d | recieve: %x != check: %x"
,
packet_num
,
data_out
,
data_out_check
);
$
finish
;
end
//
$display("data_out match! packet %d | recieve: %x != check: %x", packet_num, data_out, data_out_check);
$
display
(
"data_out match! packet %d | recieve: %x != check: %x"
,
packet_num
,
data_out
,
data_out_check
);
assert
(
data_out_last
==
data_out_last_check
)
else
begin
$
error
(
"data_out_last missmatch! packet %d | recieve: %x != check: %x"
,
packet_num
,
data_out_last
,
data_out_last_check
);
$
finish
;
end
//
$display("data_out_last match! packet %d | recieve: %x != check: %x", packet_num, data_out_last, data_out_last_check);
$
display
(
"data_out_last match! packet %d | recieve: %x != check: %x"
,
packet_num
,
data_out_last
,
data_out_last_check
);
if
((
data_out_queue
.
size
()
>
0
)
&&
(
data_out_last_queue
.
size
()
>
0
))
begin
data_out_check
<=
data_out_queue
.
pop_front
();
data_out_last_check
<=
data_out_last_queue
.
pop_front
();
...
...
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