FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2005, 01:37 AM
thomasc
Guest
 
Posts: n/a
Default "Error loading design" error

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



Reply With Quote
  #2 (permalink)  
Old 03-05-2005, 01:52 AM
[email protected]
Guest
 
Posts: n/a
Default Re: "Error loading design" error

It looks like you are trying to call task zero_check outside of any
procedural code (i.e. not in an initial or always block). You can't
have procedural statements sitting naked at the module level.

An identifier followed by a parenthesized list at the module level
can only be an instantiation. Since you haven't provided an
instance name for it, it must be a UDP rather than a module.
But since you haven't provided a definition for such a UDP,
it tells you it can't find it.

Reply With Quote
  #3 (permalink)  
Old 03-05-2005, 02:51 AM
Jason Zheng
Guest
 
Posts: n/a
Default Re: "Error loading design" error

[email protected] wrote:
> It looks like you are trying to call task zero_check outside of any
> procedural code (i.e. not in an initial or always block). You can't
> have procedural statements sitting naked at the module level.
>
> An identifier followed by a parenthesized list at the module level
> can only be an instantiation. Since you haven't provided an
> instance name for it, it must be a UDP rather than a module.
> But since you haven't provided a definition for such a UDP,
> it tells you it can't find it.
>

It appears to me that zero_check is a module, since it says
"instantiation failure." I'm guess he didn't put the file containing
zero_check in the modelsim project file.

-jz
Reply With Quote
  #4 (permalink)  
Old 03-06-2005, 03:40 AM
thomasc
Guest
 
Posts: n/a
Default Re: "Error loading design" error

Hi sharp,
Thanks much for your kind reply.

1)I'm not certain whether you meant that I must specify an instance name
when calling the task?
->As you can see at the bottom portion the code, zero_check is a task
inside the same module.

2)If I want to call a task, should I do so inside a procedural block?
->The reason why I called the task outside the procedural block is that
the parameters of the task are nets, which can't be LHS of an assignment
in procedural block.

3) Let's say I need to call tasks, functions and other modules from a
higher level module in a procedural construct and that the parameters(for
those tasks, functions and modules) and LHS of assignment in the
procedural block consists of both regs and nets.

Then do I need to declare temporary regs for the wires to use in
procedural block? And assign those temp regs back to wires outside the
procedural block?

Please let me know if my understanding is correct. If not, let me know
what I should do in such a case.

Reply With Quote
  #5 (permalink)  
Old 03-06-2005, 03:54 AM
thomasc
Guest
 
Posts: n/a
Default Re:

Hi sharp,
Thanks so much for your kind reply.
I'd like to ask a few question about your reply.

1) Can I call a module inside a procedural block? If so, is there any
conditions that I need to follow? (i.e., if the output parameters in the
module calling parameter list are nets, do I need to use temp nets to to
call the module inside a procedural block?)

2) Say I need to call tasks, functions and other modules from a higher
level module in a procedural construct and that the parameters(for those
tasks, functions and modules) and LHS of assignment in the procedural
block consists of both regs and nets.

Then do I need to declare temporary regs for the wires and assign those
temp regs back to wires outside the procedural block?

Please let me know if my understanding is correct. If not, let me know
what I should do in such a case. Thanks!


Reply With Quote
  #6 (permalink)  
Old 03-07-2005, 09:22 AM
Stefan Frank
Guest
 
Posts: n/a
Default Re: "Error loading design" error

thomasc wrote:
> 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.


Hello,

as far as I know, you have to call the task from an always block,
initial block, or from another task.

HTH & HAND,
Stefan
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
*RANT* Ridiculous EDA software "user license agreements"? license_rant_master Verilog 35 04-29-2005 05:48 PM
"port not found in module definition" compile error Junk0 Verilog 2 01-17-2005 05:36 PM
Why do we need "check" "call" "misc" in PLI? Lee Verilog 1 05-17-2004 04:42 PM
Design Compiler "ACS" feature? synop_user Verilog 0 01-16-2004 08:17 AM
SystemVerilog: "logic" or "ulogic?" Cliff Cummings Verilog 1 09-21-2003 12:55 AM


All times are GMT +1. The time now is 02:32 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved