【发布时间】:2017-03-28 15:08:07
【问题描述】:
我尝试在 Xilinx 中运行以下代码,但遇到多个错误。
代码:
Library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use work.rng.all;
entity mutation is
port(
mut:in std_logic;
pop_size:in integer range 0 to 15:=10;
mem_mutated,bits_mutated:out arr
);
end mutation;
architecture Behavioral of mutation is
begin
process(mut)
Variable s1,s4:integer:=1 ;
Variable s2:integer range 0 to 15;
Variable s3:integer range 0 to 1000:=5;
variable s5:integer range 0 to 1000:= 8;
variable ind_no, bit_mut:integer;
variable mut_ind, bit_pos:arr;
begin
s2:= pop_size;
if mut=’1’ then
for i in 1 to mut_bits loop
randg(s1,s2,s3,ind_no);
mut_ind(i):=ind_no;
s3:= s3+ 2;
randg(s1,s5,s4,bit_mut);
bit_pos(i):= bit_mut;
s4:=s4 + 1;
end loop;
mem_mutated<= mut_ind;
bits_mutated<= bit_pos;
end if;
end process;
end Behavioral;
以下是运行代码的错误:
ERROR:HDLCompiler:104 - "D:\mutation\mutation.vhd" 第 6 行:找不到 在图书馆。请确保库已编译, 并且 VHDL 文件中存在库和使用子句。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 9 行:未声明。 ERROR:HDLCompiler:854 - "D:\mutation\mutation.vhd" 第 7 行:由于先前的错误而忽略了单元。 错误:HDLCompiler:374 - “D:\mutation\mutation.vhd” 第 11 行:实体尚未编译。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 14 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 15 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 16 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 17 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 18 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 19 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 21 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 23 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 24 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 25 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 26 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 27 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 28 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 29 行:未声明。 错误:HDLCompiler:69 - "D:\mutation\mutation.vhd" 第 31 行:未声明。
我可以做些什么来消除这些错误?
【问题讨论】:
-
无法理解您使用的是哪个程序。但是,通常重新安装程序就足够了