打印
[Actel FPGA]

包集合中调用函数,请教

[复制链接]
1473|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
S3C2440|  楼主 | 2010-4-17 16:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在文件名 为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
请问该怎么办?是不是还需做什么动作呀?

相关帖子

沙发
diny| | 2011-1-30 12:37 | 只看该作者
帮你把问题顶上去。

使用特权

评论回复
板凳
huzixian| | 2011-2-11 17:52 | 只看该作者
实在是不知道说啥呢

使用特权

评论回复
地板
ladygaga| | 2011-2-12 21:51 | 只看该作者
:$

使用特权

评论回复
5
coco11| | 2011-2-14 22:52 | 只看该作者
:$

使用特权

评论回复
6
黑发尤物| | 2011-2-15 17:29 | 只看该作者
不懂,期待高手来解答

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

95

主题

400

帖子

1

粉丝