Skip to content
Snippets Groups Projects
Commit c20b0fb5 authored by dam1n19's avatar dam1n19
Browse files

ATO2-24: Added Enable Signals into message builder and hash compressor

parent 06138376
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,7 @@ module hash_compression (
for (int i=0; i < 64; i++) begin
W[i] <= 32'd0;
end
end else begin
end else if (en == 1'b1) begin
state <= next_state;
hash_iter <= next_hash_iter;
last_block <= next_last_block;
......@@ -198,7 +198,10 @@ module hash_compression (
for (int i=0; i < 64; i++) begin
W[i] <= next_W[i];
end
end
end else begin
data_in_ready <= 1'b0;
data_out_valid <= 1'b0;
end
end
// State Machine Combinatorial Logic
......
......@@ -79,7 +79,7 @@ module message_build (
data_out <= 512'd0;
data_word_count <= 55'd0;
extra_word <= 1'b0;
end else begin
end else if (en == 1'b1) begin
state <= next_state;
data_in_ready <= next_data_in_ready;
cfg_ready <= next_cfg_ready;
......@@ -90,7 +90,10 @@ module message_build (
data_out <= next_data_out;
data_word_count <= next_data_word_count;
extra_word <= next_extra_word;
end
end else begin
data_in_ready <= 1'b0;
data_out_valid <= 1'b0;
end
end
always_comb begin
......
......@@ -99,6 +99,7 @@ module sha256_engine (
message_build message_block_builder (
.clk (clk),
.nrst (nrst),
.en (en),
.sync_rst (sync_rst),
.data_in (data_in_buffered),
.data_in_valid (data_in_valid_buffered),
......@@ -119,6 +120,7 @@ module sha256_engine (
hash_compression hash_calculator (
.clk (clk),
.nrst (nrst),
.en (en),
.sync_rst (sync_rst),
.data_in (message_block),
.data_in_valid (message_block_valid),
......
......@@ -15,6 +15,7 @@ module tb_hash_compression;
logic clk;
logic nrst;
logic en;
logic sync_rst;
// Data In data and Handshaking
logic [511:0] data_in;
......@@ -38,6 +39,7 @@ module tb_hash_compression;
hash_compression uut (
.clk (clk),
.nrst(nrst),
.en (en),
.sync_rst(sync_rst),
.data_in(data_in),
.data_in_valid(data_in_valid),
......@@ -189,6 +191,9 @@ module tb_hash_compression;
data_out_check = data_out_queue.pop_front();
data_out_last_check = data_out_last_queue.pop_front();
// Enable Hash Compression
en = 1;
// Defaultly set Sync Reset Low
sync_rst = 0;
......
......@@ -15,6 +15,7 @@ module tb_message_build;
logic clk;
logic nrst;
logic en;
logic sync_rst;
// Data In data and Handshaking
logic [511:0] data_in;
......@@ -38,6 +39,7 @@ module tb_message_build;
message_build uut (
.clk (clk),
.nrst(nrst),
.en (en),
.sync_rst(sync_rst),
.data_in(data_in),
.data_in_valid(data_in_valid),
......@@ -220,6 +222,9 @@ module tb_message_build;
data_out_check = data_out_queue.pop_front();
data_out_last_check = data_out_last_queue.pop_front();
// Defaultly enable Message Builder
en = 1;
// Defaultly set Sync Reset Low
sync_rst = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment