-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_memory.v
More file actions
63 lines (53 loc) · 1.14 KB
/
test_memory.v
File metadata and controls
63 lines (53 loc) · 1.14 KB
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
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 21:32:42 04/14/2015
// Design Name: memory
// Module Name: H:/Users/ll024/Desktop/PrimeFactorization/test_memory.v
// Project Name: PrimeFactorization
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: memory
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module test_memory;
// Inputs
reg clka;
reg [0:0] wea;
reg [12:0] addra;
reg [8:0] dina;
// Outputs
wire [8:0] douta;
// Instantiate the Unit Under Test (UUT)
memory uut (
.clka(clka),
.wea(wea),
.addra(addra),
.dina(dina),
.douta(douta)
);
always #5 clka = ~clka;
initial begin
// Test writing data
clka = 1;
wea = 1;
addra = 13'b0010001000101;
dina = 23;
// Test reading data
#100;
clka = 1;
wea = 0;
addra = 13'b0010001000101;
dina = 78; // this won't overwrite data because wea is 0
end
endmodule