How do i fix this error? 
Author Message
 How do i fix this error?

Hi,

I've written a function which is suppose to split std_logic_vectors into
sub array groups
the function takes in a vector of (39 downto 0) and return an array of
vectors like so.
Note: all the prilimanary stuff has been done like creating libraries,
compilation etc...

package body utils_pkg is

FUNCTION port_type_convert(DATA: std_logic_vector(39 downto 0)) RETURN
scan_type IS
        variable scan_line : scan_type;
BEGIN
        scan_line(4) := DATA(39 downto 32);
        scan_line(3) := DATA(31 downto 24);
        scan_line(2) := DATA(23 downto 16);
        scan_line(1) := DATA(15 downto 8);
        scan_line(0) := DATA(7 downto 0);

        RETURN scan_line;

END port_type_convert;

.... scan_line is of type scan_type which is declare as
type scan_type is array (integer range 0 to 4) of std_logic_vector(7
downto 0);

At the moment this is how I am calling the function.
    window_load: process(sysclk, reset, DATA)
        begin
                if reset = '1' then

                        window(4) <=
"0000000000000000000000000000000000000000";
                        window(3) <=
"0000000000000000000000000000000000000000";
                        window(2) <=
"0000000000000000000000000000000000000000";
                        window(1) <=
"0000000000000000000000000000000000000000";
                        window(0) <=
"0000000000000000000000000000000000000000";

                elsif(sysclk'event and sysclk = '1') then

Quote:
>>>                        window(4) <= port_type_convert(DATA(39 downto

0));
                        window(3) <= window(4);
                        window(2) <= window(3);
                        window(1) <= window(2);
                        window(0) <= window(1);
                end if;
   end process;

The problem is with this line.
  window(4) <= port_type_convert(DATA(39 downto 0));

This is the error msg i got.
Error, no matching definition for subprogram port_type_convert found.

My guess is that the package in which the above function was built,
wasn't compiled into the library
properly but I could be mistaken because the compiler said it had.

Any ideas? ,

Harry.



Sat, 26 Jan 2002 03:00:00 GMT  
 How do i fix this error?
Harry,
   As far as I know you need to declare the function in a package
declaration.

package utils_pkg is

  FUNCTION port_type_convert(DATA: std_logic_vector(39 downto 0)) RETURN
 scan_type;

end utils_pkg ;

Try this and see.
                   - Dave


Quote:
> Hi,

> I've written a function which is suppose to split std_logic_vectors into
> sub array groups
> the function takes in a vector of (39 downto 0) and return an array of
> vectors like so.
> Note: all the prilimanary stuff has been done like creating libraries,
> compilation etc...

> package body utils_pkg is

> FUNCTION port_type_convert(DATA: std_logic_vector(39 downto 0)) RETURN
> scan_type IS
>         variable scan_line : scan_type;
> BEGIN
>         scan_line(4) := DATA(39 downto 32);
>         scan_line(3) := DATA(31 downto 24);
>         scan_line(2) := DATA(23 downto 16);
>         scan_line(1) := DATA(15 downto 8);
>         scan_line(0) := DATA(7 downto 0);

>         RETURN scan_line;

> END port_type_convert;

> .... scan_line is of type scan_type which is declare as
> type scan_type is array (integer range 0 to 4) of std_logic_vector(7
> downto 0);

> At the moment this is how I am calling the function.
>     window_load: process(sysclk, reset, DATA)
>         begin
>                 if reset = '1' then

>                         window(4) <=
> "0000000000000000000000000000000000000000";
>                         window(3) <=
> "0000000000000000000000000000000000000000";
>                         window(2) <=
> "0000000000000000000000000000000000000000";
>                         window(1) <=
> "0000000000000000000000000000000000000000";
>                         window(0) <=
> "0000000000000000000000000000000000000000";

>                 elsif(sysclk'event and sysclk = '1') then
> >>>                        window(4) <= port_type_convert(DATA(39 downto
> 0));
>                         window(3) <= window(4);
>                         window(2) <= window(3);
>                         window(1) <= window(2);
>                         window(0) <= window(1);
>                 end if;
>    end process;

> The problem is with this line.
>   window(4) <= port_type_convert(DATA(39 downto 0));

> This is the error msg i got.
> Error, no matching definition for subprogram port_type_convert found.

> My guess is that the package in which the above function was built,
> wasn't compiled into the library
> properly but I could be mistaken because the compiler said it had.

> Any ideas? ,

> Harry.



Sat, 26 Jan 2002 03:00:00 GMT  
 How do i fix this error?


Quote:
> I've written a function which is suppose to split std_logic_vectors
> into sub array groups the function takes in a vector of (39 downto
> 0) and return an array of vectors like so.  Note: all the
> prilimanary stuff has been done like creating libraries, compilation
> etc...

> package body utils_pkg is

> FUNCTION port_type_convert(DATA: std_logic_vector(39 downto 0)) RETURN
> scan_type IS
> ...

> At the moment this is how I am calling the function.
> ...
>                 elsif(sysclk'event and sysclk = '1') then
>>>>                        window(4) <= port_type_convert(DATA(39 downto
> 0));
> ...

> The problem is with this line.
>   window(4) <= port_type_convert(DATA(39 downto 0));

> This is the error msg i got.
> Error, no matching definition for subprogram port_type_convert found.

> My guess is that the package in which the above function was built,
> wasn't compiled into the library properly but I could be mistaken
> because the compiler said it had.

More probably, you're missing a use clause that makes the function
visible.  You need something along the lines of:

        use work.utils_pkg.all;

either in the declarative part of the process or architecture, or in
the context clause of the architecture.

Hope this helps,

Paul

--

Cadence Design Systems | www.orcad.com   | spread fear, uncertainty and
P.O. Box 71767         | 919-479-1670[v] | doubt in the users' minds."
Durham, NC  27722-1767 | 919-479-1671[f] |  --Don Jones, MS's Y2K Product Mgr



Sat, 26 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. R6003 error on HP WinMe (I've already done the usual)

2. Calling Matlab from Labview returns a 1047 error - what am I doing wrong

3. Doing assembly and really doing assembly

4. Doing assembly and really doing assembly

5. Violation error when doing a mov ds,ax

6. Rounding error when doing float-to-integer

7. What has to be done to correct this error

8. Linker error when doing MSVC debug builds

9. errors when doing 'make test'

10. Please take a look at this expect script doing in loop with error checking

11. HttpDist - getting errors, What I'm doing wrong

12. Error when doing [.list delete active]--HELP!!

 

 
Powered by phpBB® Forum Software