错误:VHDL编译器正在退出
我正在使用modelsim。我写了简单的代码,但我得到了错误错误:VHDL编译器正在退出,vhdl,Vhdl,我正在使用modelsim。我写了简单的代码,但我得到了错误 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity clk_counter is port(output : out bit; clk : in bit ); end clk_counter; architecture rtl of clk_counter_arch is signal clo
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity clk_counter is
port(output : out bit;
clk : in bit
);
end clk_counter;
architecture rtl of clk_counter_arch is
signal clock_counter_output_flag: bit;
constant clock_max_count : integer := 20000;
begin
process (clock_counter_output_flag, clk,CLK'event )
variable clock_count : integer := 0;
--constant clock_max_count : integer := 20000;
variable clock_out : bit := 0;
-- wait until CLK'event and CLK='1';
begin
if (CLK'event and CLK='1') then
clock_count := clock_count+1;
if (clock_count = clock_max_count) then
clock_out := 1;
else
clock_out := 0;
end if
end if
clock_counter_output_flag <= clock_out;
end process;
END Architecture;
# ** Error: (vcom-11) Could not find work.clk_counter_arch.
#
# ** Error: C:/Modeltech_pe_edu_10.4a/examples/work/src/clk_counter(13): VHDL Compiler exiting
您的实体名称是clk_counter,您已经定义了clk_counter的体系结构rtl。因此,您将得到错误。将时钟计数器拱门更改为时钟计数器
# ** Error: (vcom-11) Could not find work.clk_counter_arch.
#
# ** Error: C:/Modeltech_pe_edu_10.4a/examples/work/src/clk_counter(13): VHDL Compiler exiting
第二,您应该将体系结构结束为end rtl
# ** Error: (vcom-11) Could not find work.clk_counter_arch.
#
# ** Error: C:/Modeltech_pe_edu_10.4a/examples/work/src/clk_counter(13): VHDL Compiler exiting
另外,为什么要使用另外两个变量clock_out和clock_counter_output_flag?如果希望将这些值作为代码的输出,只需编写
# ** Error: (vcom-11) Could not find work.clk_counter_arch.
#
# ** Error: C:/Modeltech_pe_edu_10.4a/examples/work/src/clk_counter(13): VHDL Compiler exiting
if (CLK'event and CLK='1') then
clock_count := clock_count+1;
if (clock_count = clock_max_count) then
output<='1';
else
output <='0';
end if;
end if;
if(CLK'event和CLK='1'),则
时钟计数:=时钟计数+1;
如果(时钟计数=时钟最大计数),则
输出是的,我刚刚做到了。在发布这个问题之前,我应该仔细检查代码。无论如何,谢谢你宝贵的回答。你的第一点是正确的第二,您应该以end rtl结束体系结构。这是您通常无法成功地在第三方上实施的风格。至于剩下的编码风格,您还需要指出end if
s后面缺少的分号(您的答案中仍然存在)。灵敏度列表错误和冗余。将数字文字指定给类型位(3个位置)。原始版本中从时钟计数器输出标志
到输出
的缺失赋值(显然)。指出所有错误绝对是一种很好的做法。但是,由于他已经解决了他的问题,我没有修改我的答案。