-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsim.v
52 lines (46 loc) · 1.27 KB
/
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
48
49
50
51
52
/* ------------------------------------------------ *
* Title : Pmod MIC3 interface simulation *
* Project : Pmod MIC3 interface *
* ------------------------------------------------ *
* File : sim.v *
* Author : Yigit Suoglu *
* Last Edit : 12/12/2020 *
* ------------------------------------------------ *
* Description : Simulation code for Pmod MIC3 *
* interface *
* ------------------------------------------------ */
`timescale 1ns / 1ps
// `include "Sources/mic3.v"
module tb();
reg clk, rst, MISO, read;
wire SPI_SCLK, CS, new_data;
wire [11:0] audio;
always #5 clk <= ~clk;
always #70 MISO <= ~MISO; //Alternating MISO
mic3 uut(clk, rst, SPI_SCLK, CS, MISO, read, audio, new_data);
initial //initilizations and reset
begin
clk <= 0;
rst <= 0;
MISO <= 0;
read <= 0;
#3
rst <= 1;
#10
rst <= 0;
end
initial //Testcases
begin
#402
read <= 1;
#100
read <= 0;
#2500
read <= 1;
end
// initial //Tracked signals & Total sim time
// begin
// #10000
// $finish;
// end
endmodule//tb