微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 高手,请问VHDL 的 WHEL 怎么用才可以?

高手,请问VHDL 的 WHEL 怎么用才可以?

时间:10-02 整理:3721RD 点击:

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 为自定型态

SDCNT 是状态,怎么可能比较大小。

谢谢说明,没注意到,,改这样又错了,不知道又错什么?
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


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
这样也不行....

自己的問題全部都解決了,看來 VHDL 實在在型態上弄的好複雜..

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top