-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvending_testbench.v
More file actions
71 lines (63 loc) · 1.37 KB
/
Copy pathvending_testbench.v
File metadata and controls
71 lines (63 loc) · 1.37 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
63
64
65
66
67
68
69
70
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: NONE
// Engineer: ADARSH PAL
//
// Create Date: 10:26:31 06/11/2020
// Design Name: vending_Controller
// Module Name: C:/Users/asus/Xilinx/vending/vending_testbench.v
// Project Name: vending
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: vending_Controller
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module vending_testbench;
// Inputs
reg [1:0] coin;
reg coin_insert;
reg coin_return;
reg [1:0] product;
reg enable;
reg clk;
reg reset;
// Outputs
wire [1:0] pro;
wire [2:0] change;
// Instantiate the Unit Under Test (UUT)
vending_Controller uut (
.coin(coin),
.coin_insert(coin_insert),
.coin_return(coin_return),
.product(product),
.enable(enable),
.clk(clk),
.reset(reset),
.pro(pro),
.change(change)
);
initial begin
// Initialize Inputs
coin = 2'b11;
coin_insert = 0;
coin_return = 0;
product = 2'b01;
enable = 0;
clk = 0;
reset = 1;
// Add stimulus here
enable = 1;
#10 reset = ~reset;
coin_insert = 1;
#30 coin_insert = 0;
end
always #5 clk = ~clk; // Clock Generation
endmodule