-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterface_clocking.sv
More file actions
49 lines (39 loc) · 849 Bytes
/
interface_clocking.sv
File metadata and controls
49 lines (39 loc) · 849 Bytes
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
`timescale 1ns/1ps
module des (output reg[3:0] gnt);
always #1 gnt <= $random;
endmodule
interface _if (input bit clk);
logic [3:0] gnt;
clocking cb_0 @(posedge clk);
input #0 gnt;
endclocking
clocking cb_1 @(posedge clk);
input #1step gnt;
endclocking
endinterface
module tb;
bit clk;
always #5 clk = ~clk;
initial clk <= 0;
_if if0 (.clk (clk));
des d0 (.gnt (if0.gnt));
initial begin
fork
begin
@(if0.cb_0);
$display ("cb_0.gnt = 0x%0h", if0.cb_0.gnt);
end
begin
@(if0.cb_1);
$display ("cb_1.gnt = 0x%0h", if0.cb_1.gnt);
end
join
#10 $finish;
end
/*
initial begin
$dumpfile("dump.vcd");
$dumpvars("1");
end
*/
endmodule