-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsim_hb3.v
46 lines (42 loc) · 1.17 KB
/
sim_hb3.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
/* ------------------------------------------------ *
* Title : Pmod HB3 Simulation *
* Project : Pmod HB3 Interface *
* ------------------------------------------------ *
* File : sim_hb3.v *
* Author : Yigit Suoglu *
* Last Edit : 28/05/2021 *
* ------------------------------------------------ *
* Description : Simulation for HB3 Interface *
* ------------------------------------------------ */
`timescale 1ns / 1ps
// `include "Pmods/HB3/Sources/hb3.v"
module tb_hb3();
reg clk, rst, direction_control;
wire motor_direction, motor_enable;
reg [7:0] speed;
always #5 clk <= ~clk;
hb3 uut(clk, rst, motor_direction, motor_enable, direction_control, speed);
initial
begin
clk <= 0;
rst <= 0;
direction_control <= 0;
speed <= 0;
#3
rst <= 1;
#10
rst <= 0;
#10000
speed <= 8'h80;
#10000
speed <= 8'h40;
#10000
speed <= 8'hFF;
#10000
direction_control <= 1;
#10000
speed <= 8'h4A;
#10000
speed <= 8'h05;
end
endmodule