一个关于VHDL的问题,求助…………
eda吧
全部回复
仅看楼主
level 1
zhrj87 楼主
ALibrary IEEE;
Use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
USE IEEE.STD_LOGIC_ARITH.all;
ENTITY CLOCK_DIVIDER is
generic (N: positive);
port (CLK,RST:in STD_LOGIC;CTRL:in BIT_VECTOR(0 TO 6);CLK_DIV:out STD_LOGIC);
end CLOCK_DIVIDER;
Architecture behavior of CLOCK_DIVIDER is
BEGIN
  PROCESS (CLK,RST,CTRL)
  variable N:integer;
  variable COUNT:NATURAL;
  variable a :STD_LOGIC:='0';
  BEGIN
  CASE CTRL is
  when "0000001" => N:=1193;
  when "0000010" => N:=1063;
  when "0000100" => N:=947;
  when "0001000" => N:=896;
  when "0010000" => N:=797;
  when "0100000" => N:=710;
  when "1000000" => N:=633;
  when others => N:=0;
    end CASE;
    IF (RST='0') then
    COUNT := 0;
    CLK_DIV <= '0';
  ELSIF (CLK'EVENT and CLK ='1') then
    COUNT := COUNT + 1;
    IF (COUNT = N) then
     --a <= not a;
     --CLK_DIV <= a;
     COUNT := 0;
    end IF;
  end IF;
  end PROCESS;
end BEHAVIOR 
这是一个关于分频的程序,我在用MAXPLUSS2模拟的时候出现了这样的一个错误…………
error:line41:file e:\zhrj87\clock_divider.vhd:VHDL syntax error;unexpected end-of-file -try using the Text Editor's Syntax Coloring command to find the missing delimiter or keyword
2009年03月13日 10点03分 1
level 1
max plus 或者quartus中vhdl语言要求非常严格, 同样的程序我再modelsim里面能过,但在quartus里面却不行,网上没有一个解决方法,折腾了半夜终于搞明白了,特来传道解惑,原来是这样:
entity结束是要用:end entity CLOCK_DIVIDER;-----------entity和entity 名clock_divider都不能少;
architecture结束时也是如此:end architecture rtl;------两个都不能少
2012年06月05日 17点06分 2
1