-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHP_Test_Top.v
55 lines (45 loc) · 1.42 KB
/
HP_Test_Top.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2023, Avant-Gray LLC. All rights reserved.
//
// Company: Avant-Gray LLC
// Engineer: Tanj Bennett
//
// Create Date: 10/03/2022
// Design Name: HashPipe
// File Name: HP_Test_Top
// Project Name: https://github.com/TanjIsGray/LowE_BTC
//
//////////////////////////////////////////////////////////////////////////////////
`include "timescale.v"
// SHA-256 hash function variants for unrolling in special case of BTC mining.
// The base algorithm is described in FIPS 180-4:
// https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf
/// Test driver
///
module HP_Test_Top #(
parameter
WORDBITS = 32,
HASHWORDS = 8, // hash width in words
MSGWORDS = 16, // message width in words
parameter HASHBITS = HASHWORDS * WORDBITS,
parameter MSGBITS = MSGWORDS * WORDBITS
) (
input inPort_clk,
input [MSGBITS-1:0] inPort_msg,
output reg [HASHBITS-1:0] outPort_hash
);
reg [MSGBITS-1:0] req_msg_r;
always @(posedge inPort_clk) begin
req_msg_r <= inPort_msg;
end
wire [HASHBITS-1:0] quadOutput;
WholeQuadPipe quadPipe (
.a_h_out(quadOutput),
.clk(inPort_clk),
.msg_in(req_msg_r)
);
always @(posedge inPort_clk) begin
outPort_hash <= quadOutput;
end
endmodule