Hi,
Can someone help me understand why the signals values are different even though under the same interface?
Also 3 vendors give all different results.
VCS Compile Error
Incisive Waveform
Aldec Waveform
Snoposis: compile error
Incisive: compile pass. Comparing 2 modport signals, two rst are identical, one cnt4 is lagging the other one clk.
Aldec : compile pass. Comparing 2 modport signals, two rst are slightly different, one cnt4 is lagging the other one clk.
Three questions:
1.how to mapping rst, cnt4 to corresponding modport if it shows in the same waveform?
2.which simulation result is more reliable among those 3 simulator for this specific case?
3.is it possible to modify the code so that 3 simulator can get the same result, especially for VCS taking it without compilation error?
interface bus(input bit clk);
logic rst;
logic [1:0] cnt4;
clocking master_cb @(posedge clk);
//only specify the direction
default input #1step output #1ns;
output rst;
input cnt4;
endclocking
//async modport for DUT connection
modport dut_async_mp(input clk, input rst, output cnt4);
//sync modport containing clocking block for TB
modport master_mp(clocking master_cb);
endinterface
module tb();
bit clk;
bus busA(clk);
/* VCS compilation issue version
cnt dut(busA.dut_async_mp);
*/
cnt dut(busA.clk, busA.rst, busA.cnt4);
tc tc(busA);
always
#5 clk = ~clk; //10ns
initial begin
//$monitor($time,, busA.dut_async_mp.clk,, busA.dut_async_mp.rst,, busA.dut_async_mp.cnt4);
$monitor($time,, busA.clk,, busA.rst,, busA.cnt4);
end
initial begin
$dumpfile("dump.vcd");
$dumpvars(0,tb);
end
endmodule
program tc(bus.master_mp mp);
class driver;
virtual bus.master_mp mp;
function new(virtual bus.master_mp mp);
this.mp = mp;
endfunction
//assign value to the modport-mp
task assign_mp();
**//why 0ns ~ 6ns, rst get 'X?**
mp.master_cb.rst <= 1;
@mp.master_cb;
mp.master_cb.rst <= 0;
repeat(8) @mp.master_cb;
endtask
task run();
assign_mp();
assign_mp();
endtask
endclass
initial begin
driver drv=new(mp);
drv.run();
end
endprogram
/* VCS compilation issue version
module cnt(bus.dut_async_mp mp);
always@(posedge mp.clk)
if(mp.rst)
mp.cnt4 <= 0;
else
mp.cnt4 <= mp.cnt4 + 1;
endmodule
*/
module cnt(input clk, rst, output reg[1:0] cnt4);
always@(posedge clk)
if(rst)
cnt4 <= 0;
else
cnt4 <= cnt4 + 1;
endmodule