-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcon3_sim.v
47 lines (43 loc) · 1.24 KB
/
con3_sim.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
/* ------------------------------------------------ *
* Title : Pmod CON3 Simulation *
* Project : Pmod CON3 Interface *
* ------------------------------------------------ *
* File : con3_sim.v *
* Author : Yigit Suoglu *
* Last Edit : 30/05/2021 *
* ------------------------------------------------ *
* Description : Simulation for CON3 interface *
* ------------------------------------------------ */
`timescale 1ns / 1ps
// `include "Pmods/CON3/Sources/con3.v"
module testbench();
reg clk, rst, clk_sim, en;
wire servo,clk_256kHz;
reg [7:0] angle;
always #5 clk <= ~clk;
always #50 clk_sim <= ~clk_sim;
con3 uut(clk, rst, clk_sim, en, servo, angle);
con3_clk_gen uut_clkgen(clk,rst, clk_256kHz);
con3 #(1,1) uut1(clk, rst, clk_sim, en, , angle);
con3 #(1,8) uut2(clk, rst, clk_sim, en, , angle);
con3 #(1,18) uut3(clk, rst, clk_sim, en, , angle);
initial begin
clk = 0;
rst = 0;
clk_sim = 0;
en = 0;
angle = 8'h0;
#3
rst = 1;
#10
rst = 0;
#1000
en = 1;
#100000
angle = 8'h80;
#100000
angle = 8'hFF;
#100000
angle = 8'h21;
end
endmodule