在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3768|回复: 4

[求助] 高手,请问VHDL 的 WHEL 怎么用才可以?

[复制链接]
发表于 2012-10-17 08:24:56 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 keyway 于 2012-10-17 08:36 编辑

library ieee;                              
        use ieee.std_logic_1164.all;      
        use ieee.std_logic_arith.all;      
        use ieee.std_logic_unsigned.all;   

ENTITY Controller IS                                                         
   PORT (                                                                        
         CLOCK                   : in        std_logic;                          
         TSCLK                   : out       std_logic;                          
         RESET_N                 : in        std_logic                           
        );                                                                       
   END Controller;                                                           

ARCHITECTURE RTL OF Controller IS

type SDCNT_type is   (A,B,C,D,E,F,G);
signal    SDCNT : SDCNT_type;

signal    SCLK  : std_logic;
begin
  TSCLK <= not CLOCK WHEN  (SCLK or ((SDCNT >= B) and (SDCNT <= G))) = '1' ELSE '0';  <--ERROR
Error (10327): VHDL error at Controller.vhd(56): can't determine definition of operator ""or"" -- found 0 possible definitions

  TSCLK <= not CLOCK WHEN (SCLK or ((SDCNT >= B) and (SDCNT <= G)))  ELSE '0'; <--ERROR
Error (10476): VHDL error at Controller.vhd(56): type of identifier "SCLK" does not agree with its usage as "boolean" type
.....??????????????????.....不知道怎么改?

因为 SDCNT 为自定型态
发表于 2012-10-17 13:36:35 | 显示全部楼层
SDCNT 是状态,怎么可能比较大小。
 楼主| 发表于 2012-10-17 16:36:23 | 显示全部楼层


谢谢说明,没注意到,,改这样又错了,不知道又错什么?
use ieee.numeric_std.all;
....................
signal    INDEX           : std_logic_vector(5 downto 0);
..........................
case to_integer(unsigned(INDEX)) is
when 1 =>
when 2 =>
more than one Use Clause imports a declaration of simple name "unsigned" -- none of the declarations are directly visible
 楼主| 发表于 2012-10-17 17:03:46 | 显示全部楼层
回复 3# keyway

case to_integer(INDEX) is
when 1 =>
when 2 =>
can't determine type of object at or near identifier "to_integer" -- found 0 possible types
这样也不行....
 楼主| 发表于 2012-10-17 20:36:41 | 显示全部楼层
自己的問題全部都解決了,看來 VHDL 實在在型態上弄的好複雜..
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-2-19 15:25 , Processed in 0.024619 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表