Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Functions in different libs

Reply
Thread Tools

Functions in different libs

 
 
Thomas Reinemann
Guest
Posts: n/a
 
      04-21-2004
Hello,

the following code generates an compile error in Modelsim. It complains
an "Incompatible types for assignment." error on the marked line,
see ====> <===.

Both the caller and called function have the same type and structure,
but belong to different libraries. Each function generates some Matlab
code. This has to be happen for the whole hierarchy. The call genetates
no error if both function belong to the same lib.
Function "pid_modal_delay" resides in pid_vg.pid_modal_pack.

library pid_vg;
library serelemente;
library ieee;
library sersupport;
use work.optimisation.all;
use std.textio.all;
use serelemente.basics.all;
use sersupport.general_units.all;
use work.basics.all;
use ieee.numeric_std.all;
use ieee.std_logic_1164.all;
use pid_vg.pid_modal_pack.all;

package body current_controller_struct_pack is
function current_controller_struct_delay

return zeile_rec_ret is
file outfile : text open write_mode is "current_controller_struct.m";
variable rtext : zeile_rec_ret := zeile_rec_ret'(null, null);
variable hd : zeile_ptr := zeile_ptr'(null);
variable letzer : zeile_ptr := zeile_ptr'(null);
-- General constants
constant current_set_d : integer := 0;
constant current_measured_d : integer := 0;
--constant index1 : integer := index + 1;

begin
-- initiate sub instances code generation

*==> rtext := pid_modal_delay; <==========================*

-- Generating m function
add_line (rtext, "function [c]= current_controller_struct
....
add_line (rtext, "c=flat_matrix (c);");
hd := rtext.hd;
while hd /= null loop
letzer := hd;
writeline (outfile, hd.zeile);
hd := hd.nxt;
deallocate (letzer);
end loop;
rtext := zeile_rec_ret'(null, null);
return rtext;
end;
end current_controller_struct_pack;


Regards,

Tom
 
Reply With Quote
 
 
 
 
Eyck Jentzsch
Guest
Posts: n/a
 
      04-23-2004
Thomas Reinemann wrote:
> Hello,
>
> the following code generates an compile error in Modelsim. It complains
> an "Incompatible types for assignment." error on the marked line,
> see ====> <===.
>
> Both the caller and called function have the same type and structure,
> but belong to different libraries. Each function generates some Matlab
> code. This has to be happen for the whole hierarchy. The call genetates
> no error if both function belong to the same lib.
> Function "pid_modal_delay" resides in pid_vg.pid_modal_pack.
>
> library pid_vg;
> library serelemente;
> library ieee;
> library sersupport;
> use work.optimisation.all;
> use std.textio.all;
> use serelemente.basics.all;
> use sersupport.general_units.all;
> use work.basics.all;
> use ieee.numeric_std.all;
> use ieee.std_logic_1164.all;
> use pid_vg.pid_modal_pack.all;
>
> package body current_controller_struct_pack is
> function current_controller_struct_delay
>
> return zeile_rec_ret is
> file outfile : text open write_mode is "current_controller_struct.m";
> variable rtext : zeile_rec_ret := zeile_rec_ret'(null, null);
> variable hd : zeile_ptr := zeile_ptr'(null);
> variable letzer : zeile_ptr := zeile_ptr'(null);
> -- General constants
> constant current_set_d : integer := 0;
> constant current_measured_d : integer := 0;
> --constant index1 : integer := index + 1;
>
> begin
> -- initiate sub instances code generation
>
> *==> rtext := pid_modal_delay; <==========================*
>
> -- Generating m function
> add_line (rtext, "function [c]= current_controller_struct
> ....
> add_line (rtext, "c=flat_matrix (c);");
> hd := rtext.hd;
> while hd /= null loop
> letzer := hd;
> writeline (outfile, hd.zeile);
> hd := hd.nxt;
> deallocate (letzer);
> end loop;
> rtext := zeile_rec_ret'(null, null);
> return rtext;
> end;
> end current_controller_struct_pack;
>
>
> Regards,
>
> Tom


Does your package pid_vg.pid_modal_pack declares the type zeile_rec_ret
as well as another package?

-Eyck

 
Reply With Quote
 
 
 
 
Thomas Reinemann
Guest
Posts: n/a
 
      04-23-2004
Eyck Jentzsch wrote:
>> library pid_vg;
>> library serelemente;
>> library ieee;
>> library sersupport;
>> use work.optimisation.all;

> Does your package pid_vg.pid_modal_pack declares the type zeile_rec_ret
> as well as another package?

No, but it points in the right direction. The type zeile_rec_ret is
declared multiple in work.optimisation. I corrected it already.

Tom
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
do I need "ruby-libs" as a prerequisite to install/run ruby? what is"ruby-libs" exactly? Greg Hauptmann Ruby 4 02-07-2009 11:12 AM
How to eliminate multiple declaration error for a symbol present inboth libs( without modifying libs) Raman C Programming 5 05-09-2008 06:12 AM
Is it possible to loadlibrary() two different libs for the "same" java class? John Java 2 04-07-2005 12:32 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM
including libs by #pragma comment -> order of libs Christoph C Programming 2 09-17-2003 01:29 PM



Advertisments