karan hans
Newbie level 3
hi,
the following is the mux design
module mux_using_assign(
din_0 , // Mux first input
din_1 , // Mux Second input
sel , // Select input
mux_out , // Mux output
);
//-----------Input Ports---------------
input din_0, din_1, sel ;
//-----------Output Ports---------------
output mux_out;
//------------Internal Variables--------
wire mux_out;
wire din_0, din_1, sel;
//-------------Code Start-----------------
assign mux_out = (sel) ? din_1 : din_0;
endmodule //End Of Module mux
the test bench is the following:
module test_mux ;
wire t_mux_out;
reg t_din_0,t_din_1,t_sel;
mux_using_assign(
.t_din_0(din_0),
.t_din_1(din_1),
.t_sel(sel),
.t_mux_out(mux_out)
);
initial
begin
t_din_0 = 0; t_din_1 = 0; t_sel = 0;
#10
t_sel = 1;
$finish;
end
initial
$monitor($stime,,t_mux_out,,t_din_0,,t_din_1,,t_sel);
endmodule
the design compiles successfuly
so does the test bench
but when it tries to simulate it following error
vsim work.test_mux
# vsim work.test_mux
# ** Note: (vsim-3812) Design is being optimized...
# ** Error: t_mux.v(12): Missing instance name in instantiation of 'mux_using_assign'.
# Optimization failed
# Error loading design
what could be wrong
the following is the mux design
module mux_using_assign(
din_0 , // Mux first input
din_1 , // Mux Second input
sel , // Select input
mux_out , // Mux output
);
//-----------Input Ports---------------
input din_0, din_1, sel ;
//-----------Output Ports---------------
output mux_out;
//------------Internal Variables--------
wire mux_out;
wire din_0, din_1, sel;
//-------------Code Start-----------------
assign mux_out = (sel) ? din_1 : din_0;
endmodule //End Of Module mux
the test bench is the following:
module test_mux ;
wire t_mux_out;
reg t_din_0,t_din_1,t_sel;
mux_using_assign(
.t_din_0(din_0),
.t_din_1(din_1),
.t_sel(sel),
.t_mux_out(mux_out)
);
initial
begin
t_din_0 = 0; t_din_1 = 0; t_sel = 0;
#10
t_sel = 1;
$finish;
end
initial
$monitor($stime,,t_mux_out,,t_din_0,,t_din_1,,t_sel);
endmodule
the design compiles successfuly
so does the test bench
but when it tries to simulate it following error
vsim work.test_mux
# vsim work.test_mux
# ** Note: (vsim-3812) Design is being optimized...
# ** Error: t_mux.v(12): Missing instance name in instantiation of 'mux_using_assign'.
# Optimization failed
# Error loading design
what could be wrong