搜索
bottom↓
回复: 3

请教一个用CPLD做接口电路的问题!

[复制链接]

出0入0汤圆

发表于 2009-7-5 08:49:41 | 显示全部楼层 |阅读模式
我现在用单片机和CPLD以总线的方式连接,
我的想法是,数据总线传输数据,然后到CPLD里面处理,处理后以不同的通讯方式传输出去,如:UART.IIC,SPI等方式!
但是我把所有的IO分组,每组4个IO口,这4个IO口可以用来做UART,SPI,IIC和4个IO口,这个可以通过2根控制总线来选择!
我所有组的通讯方式可以变化,也就是说,如果我这个组的想做UART,我下个时刻我想做IIC,
我现在用的VHDL语言来实现,但是我如果用case语句来做的话,总是提示有警告!不知道怎么解决!我贴出代码!希望能帮我解决下!
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity MODULE is
------------------------------------------
port (
      MODULE_RST:        in  std_logic;
                MODULE_ADDRIN:     in  std_logic_vector( 1 downto 0 );
                MODULE_OUT:        out  std_logic_vector( 3 downto 0 );
                MODULE_IN:         in  std_logic_vector( 3 downto 0 )
                );
------------------------------------------
end MODULE;

architecture Behavioral of MODULE is
------------------------------------------
component BUFGP
    port ( I: in std_logic; O: out std_logic );
end component;
------------------------------------------
------------------------------------------
signal MoudleOUT:          std_logic;
signal MoudleIN:           std_logic;
------------------------------------------
begin

MODULE_ADDR_SEL:
    process ( MODULE_RST,MODULE_ADDRIN )
         begin
         if ( MODULE_RST = '0' ) then
             case MODULE_ADDRIN is
                      when "00" =>
                                MoudleIN      <= MODULE_IN(0);
            MODULE_OUT(0) <= MoudleOUT ;
            
            when "01" =>
                                MoudleIN      <= MODULE_IN(1);
            MODULE_OUT(1) <= MoudleOUT ;           
                               
                                when "10" =>
                                MoudleIN      <= MODULE_IN(2);
            MODULE_OUT(2) <= MoudleOUT ;
                               
                                when "11" =>
                                MoudleIN      <= MODULE_IN(3);
            MODULE_OUT(3) <= MoudleOUT ;
                               
                      when others     =>
            null;
                               
                  end case;
         end if;
         end process MODULE_ADDR_SEL;

end Behavioral;
但是总是有警告,大概意思就是说有latch什么的!
WARNING:Xst:819 - "G:/MG/MGLM/code/CPLD/PJ092703T/src/MODULE.vhd" line 53: One or more signals are missing in the process sensitivity list. To enable synthesis of FPGA/CPLD hardware, XST will assume that all necessary signals are present in the sensitivity list. Please note that the result of the synthesis may differ from the initial design specification. The missing signals are:
WARNING:Xst:653 - Signal <MoudleOUT> is used but never assigned. This sourceless signal will be automatically connected to value 0.
WARNING:Xst:646 - Signal <MoudleIN> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_0>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:1710 - FF/Latch <0> (without init value) has a constant value of 0 in block <MODULE_OUT_0>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <0> (without init value) has a constant value of 0 in block <MODULE_OUT_1>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <0> (without init value) has a constant value of 0 in block <MODULE_OUT_2>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <0> (without init value) has a constant value of 0 in block <MODULE_OUT_3>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <MODULE_OUT_3> (without init value) has a constant value of 0 in block <MODULE>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <MODULE_OUT_2> (without init value) has a constant value of 0 in block <MODULE>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <MODULE_OUT_1> (without init value) has a constant value of 0 in block <MODULE>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <MODULE_OUT_0> (without init value) has a constant value of 0 in block <MODULE>. This FF/Latch will be trimmed during the optimization process.
WARNING:Cpld:1006 - Design 'MODULE' has no inputs.
WARNING:Cpld:997 - Error during loading TIMESPEC AUTO_TS_F2F =
WARNING:Cpld:310 - Cannot apply TIMESPEC AUTO_TS_P2P =
WARNING:Cpld:997 - Error during loading TIMESPEC AUTO_TS_P2F =
WARNING:Cpld:310 - Cannot apply TIMESPEC AUTO_TS_F2P =
希望能帮我解决下!

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2009-7-5 09:06:24 | 显示全部楼层
latch的提示好像是你在一个case里面只是对一位进行改变而没对其他位如何处理给出说明,所以其他位就保持原状态,即相当于锁存了。如果你在case里面加入对所有其他位的赋值,比如others<=last_value就不会提示这个警告了
这个警告没什么关系的吧。。。
我初学,个人体会,望高手指正

出0入0汤圆

发表于 2009-7-5 09:19:20 | 显示全部楼层
WARNING:Xst:819 - "G:/MG/MGLM/code/CPLD/PJ092703T/src/MODULE.vhd" line 53: One or more signals are missing in the process sensitivity list. To enable synthesis of FPGA/CPLD hardware, XST will assume that all necessary signals are present in the sensitivity list. Please note that the result of the synthesis may differ from the initial design specification. The missing signals are:

这个警告不是很明显的吗,敏感信号没有写到敏感列表里面
楼主写的HDL像写的C语言。建议新手把C语言忘了再来学习CPLD吧。

出0入0汤圆

 楼主| 发表于 2009-7-5 09:39:39 | 显示全部楼层
哦!谢谢了1呵呵!我也觉得!
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <MODULE_OUT_3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
这个警告有点烦人!
呵呵!我还是先从基本的数字电路开始吧!这个硬件不是软件,有的时候软件算法没问题,但是硬件会有问题的1呵呵!谢谢指教!
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-24 19:26

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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