interface bus_A (input clk);//定义interface的外部接口
logic [15:0] data;
logic write;
modport test (input data, output write);
modport dut (output data, input write);
endinterface
interface bus_B (input clk);//定义interface的外部接口
logic [8:1] cmd;
logic enable;
modport test (input enable);
modport dut (output enable);
endinterface
program test( bus_A.testa, bus_B.test b );//例化interface分别为a,b
clocking cd1 @(posedge a.clk);(声明时钟块,其中的信号是此时钟域里的同步信号)
input a.data;
output a.write;
inout state = top.cpu.state;
endclocking
clocking cd2 @(posedge b.clk);
input #2 output #4psb.cmd;// ?(这一句是什么意思?有谁能给我解释一下吗?)
input b.enable;
endclocking
initialbegin
// program begins here
...
// user can access cd1.a.data , cd2.b.cmd , etc…
end
endprogram
The testmodule can be instantiated and connected as before:
module top;
logic phi1, phi2;
bus_A a(phi1);
bus_B b(phi2);
test main( a, b );
cpu cpu1( a );
mem mem1( b );
endmodule
红色的部分是我不太明白的,有谁能给我点启发吗?谢谢。
欢迎光临 EETOP 创芯网论坛 (原名:电子顶级开发网) (https://bbs.eetop.cn/) | Powered by Discuz! X3.4 |