T
thomasc
Guest
Hi,
I'd like to ask a question about "Error loading design" error. My module
compiles fine without an error. However, when I tried to simulate it with
a testbench for the module, ModelSim gives an error message, saying "Error
loading design". I copied & pasted the error message and my code below. I
haven't been able to find out how to fix this error. If you see any
problem in my code, please let ne know.
Thanks.
vsim work.test_SaXSb
# vsim work.test_SaXSb
# Loading work.test_SaXSb
# Loading work.SaXSb
# ** Warning: (vsim-3009) [TSCALE] - Module 'SaXSb' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1
# ** Error: (vsim-3033) D:/ ....... /SaXSb.v(11): Instantiation of
'zero_check' failed. The design unit was not found.
# Region: /test_SaXSb/X1
# Searched libraries:
# work
# Loading work.exp_elem
# ** Warning: (vsim-3009) [TSCALE] - Module 'exp_elem' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1/E1
# Loading work.alpha_elem
# ** Warning: (vsim-3009) [TSCALE] - Module 'alpha_elem' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1/A1
# Error loading design
module SaXSb (Sx_val, Sx_exp, Sa, Sb);
input [7:0] Sa, Sb;
output [7:0] Sx_val, Sx_exp;
wire [7:0] Sx_val, Sx_exp;
wire [7:0] Sa_temp, Sb_temp;
parameter mask = 8'h0F;
zero_check(Sx_val, Sx_exp, Sa, Sb); // <= THIS IS LINE (11) WHERE THE
ERROR OCCURED
exp_elem E1 (.exp_val(Sa_temp), .index(Sa));
exp_elem E2 (.exp_val(Sb_temp), .index(Sb));
assign Sa_temp = wraparound_check(Sa_temp);
assign Sa_temp = Sa_temp & mask; // mask out 4 unnecessary MSB's
alpha_elem A1 (.alpha_val(Sb_temp), .index(Sa_temp));
assign Sx_val = Sb_temp;
assign Sx_exp = Sa_temp;
task zero_check;
inout [7:0] x_val, x_exp;
input [7:0] a, b;
reg [7:0] x_val, x_exp;
begin
if ((a==0)||(b==0)) begin
x_val = 8'h00;
x_exp = 8'h10; //if a==0 and b==0, Sx_val and
disable SaXSb; // Sx-exp values should not be
// modified by the codes below
end //if
end //begin
endtask
function wraparound_check;
input [7:0] a_temp;
begin
if (a_temp >= 15) wraparound_check = a_temp+1;
end
endfunction
endmodule
I'd like to ask a question about "Error loading design" error. My module
compiles fine without an error. However, when I tried to simulate it with
a testbench for the module, ModelSim gives an error message, saying "Error
loading design". I copied & pasted the error message and my code below. I
haven't been able to find out how to fix this error. If you see any
problem in my code, please let ne know.
Thanks.
vsim work.test_SaXSb
# vsim work.test_SaXSb
# Loading work.test_SaXSb
# Loading work.SaXSb
# ** Warning: (vsim-3009) [TSCALE] - Module 'SaXSb' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1
# ** Error: (vsim-3033) D:/ ....... /SaXSb.v(11): Instantiation of
'zero_check' failed. The design unit was not found.
# Region: /test_SaXSb/X1
# Searched libraries:
# work
# Loading work.exp_elem
# ** Warning: (vsim-3009) [TSCALE] - Module 'exp_elem' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1/E1
# Loading work.alpha_elem
# ** Warning: (vsim-3009) [TSCALE] - Module 'alpha_elem' does not have a
`timescale directive in effect, but previous modules do.
# Region: /test_SaXSb/X1/A1
# Error loading design
module SaXSb (Sx_val, Sx_exp, Sa, Sb);
input [7:0] Sa, Sb;
output [7:0] Sx_val, Sx_exp;
wire [7:0] Sx_val, Sx_exp;
wire [7:0] Sa_temp, Sb_temp;
parameter mask = 8'h0F;
zero_check(Sx_val, Sx_exp, Sa, Sb); // <= THIS IS LINE (11) WHERE THE
ERROR OCCURED
exp_elem E1 (.exp_val(Sa_temp), .index(Sa));
exp_elem E2 (.exp_val(Sb_temp), .index(Sb));
assign Sa_temp = wraparound_check(Sa_temp);
assign Sa_temp = Sa_temp & mask; // mask out 4 unnecessary MSB's
alpha_elem A1 (.alpha_val(Sb_temp), .index(Sa_temp));
assign Sx_val = Sb_temp;
assign Sx_exp = Sa_temp;
task zero_check;
inout [7:0] x_val, x_exp;
input [7:0] a, b;
reg [7:0] x_val, x_exp;
begin
if ((a==0)||(b==0)) begin
x_val = 8'h00;
x_exp = 8'h10; //if a==0 and b==0, Sx_val and
disable SaXSb; // Sx-exp values should not be
// modified by the codes below
end //if
end //begin
endtask
function wraparound_check;
input [7:0] a_temp;
begin
if (a_temp >= 15) wraparound_check = a_temp+1;
end
endfunction
endmodule