找回密码
 注册
搜索
查看: 1012|回复: 0

[讨论] 包集合中调用函数,请教

[复制链接]
发表于 2010-4-10 10:27:17 | 显示全部楼层 |阅读模式
我在文件名 为uart_serial.vhd中定义了如下包集合:
library ieee;
use ieee.std_logic_1164.all;
package uart_serial is
        function get_parity(get_parity_type :std_logic;
                                                get_parity_data :std_logic_vector(7 downto 0))
                                        return std_logic ;
end uart_serial;
package body uart_serial is
        function get_patity(get_parity_type :std_logic;
                                                get_parity_data :std_logic_vector(7 downto 0))
                        return std_logic is
                        variable tmp: std_logic :='1';
                        variable return_value :std_logic;
        begin
                略。。。               
                if(get_parity_type ='1')then
                        return_value :=tmp;
                else
                        return_value := not tmp;
                end if;
                return return_value;
        end get_patity;
end uart_serial;

而在文件名为my_uart_Tx.vhd中调用了包集合中的函数get_patity,
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use work.uart_serial.all;
Entity my_uart_Tx is
        Port(。。。略。。。
               );
end my_uart_Tx;

Architecture my_uart_Tx_behavior of my_uart_Tx is

begin
  。。。略
tx <=get_parity(parity_type,data_mid);
                                                
end my_uart_Tx_behavior;

编译后出现:
VHDL Subprogram Declaration error at uart_serial.vhd(4): declaration of function or procedure "get_parity" must have corresponding Subprogram Body

请问该怎么办?是不是还需做什么动作呀?
高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-5-6 19:04 , Processed in 0.047433 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表