forked from mardeny2001/JoSDC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathir.v
63 lines (39 loc) · 1.21 KB
/
ir.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
56
57
58
59
60
61
62
63
/////////////////////////////////////////////////////////////////////////////////////////
/*
done by: Mohammed A. Mardeni
Date: 7/10/2023 - 8:10 AM
Function: Hold current instruction DATA for processing the instruction.
*/
//////////////////////////////////////////////////////////////////////////////////////////
module ir(clk,d,q);
//####################### Scalers Ports ###############################################//
input clk;
//####################### Vector Ports ###############################################//
input [31:0]d;
output reg [31:0]q;
//####################### circuit ###############################################//
//procedural implentation as the sequential nature of the circuit require sensitivity list
always @(posedge clk) begin
q <=d;
end
endmodule
module ir_dut;
//registers to put test values to
reg [31:0]d;
reg clk;
//wires to prob outputs from
wire [31:0]q;
//ciruit under test
ir ir_ut(.clk(clk),.d(d),.q(q));
///////////////////
initial begin : test_vectors
d=32'b0;
#20 d=32'd20;
#40 d=32'd10;
end
initial begin : clk_generation
clk=0;
forever
#10 clk=~clk;
end
endmodule