u24c02
Advanced Member level 1
Hi.
I want to prove clocking statement in systemverilog by using simvision. I can't prove the inside clocking block(module tb).
I want to prove clocking statement in systemverilog by using simvision. I can't prove the inside clocking block(module tb).
Code Verilog - [expand] 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 module top(); logic clk; initial begin clk =0; forever #5 clk= ~clk; end itf u_itf(.clk(clk)); dut u_dut(u_itf); tb_u_tb(u_itf); initial begin $shm_open("./shm"); $shm_probe(top,"AS"); end endmodule module tb (itf tb); initial begin tb.read <= 0; repeat(3) #10 tb.read <= ~tb.read; $finish; end always @(posedge tb.clk) begin tb.cb.read <=tb.cb; if (tb.cb.enable) tb.data <= tb.data+1; end initial begin tb.data =0; end endmodule module dut(itf dut_itf); always @(posedge dut_itf.clk) begin if (dut_itf.read) dut_itf.enable <= 1; end initial begin dut_itf.enable <= 0; end endmodule interface itf(input clk); logic read,enable; logic [7:0] addr, data; modport dut(input read, addr, output data, enable); modport tb(clocking cb); clocking cb@(posedge clk); default input #3ns //output #5ns; //Here is my test point. output data, addr, read; input enable; endclocking endinterface
Last edited by a moderator: