hi,all
i have written a code for 2:1mux using system verilog.there is no compilation error in the code…but when i am simulating it is showing “Error loading design”.plz anyone help me to rectify my code or tell the reason why there is error loading design .below there is my code.
program muxtb(muxinfr.TEST ob2);
initial
begin
begin
ob2.cb.a={1};
ob2.cb.b={0};
ob2.cb.sel={0};
end #5
begin
ob2.cb.a={1};
ob2.cb.b={0};
ob2.cb.sel={1};
end #5
begin
ob2.cb.a={0};
ob2.cb.b={1};
ob2.cb.sel={1};
end
end
initial $display(“output is %d”,ob2.out_put);
endprogram
module mux_1(muxinfr.DUT ob1);
parameter s0=0;
parameter s1=1;
always@(posedge ob1.clk)
begin
case(ob1.sel)
s0:
ob1.out_put=ob1.a;
s1:
ob1.out_put=ob1.b;
default:
ob1.out_put=0;
endcase
end
endmodule
module top;
bit clk;
always #5 clk = !clk;
muxinfr ob(clk);
mux_1 t2(ob);
muxtb t1(ob);
endmodule
interface muxinfr(input bit clk);
logic a,b,sel;
logic out_put;