counter_startut std_logic; ---计数器使能信号
counter_lock ut std_logic; ---计数器锁存信号
counter_clr ut std_logic; ---计数器清零信号
data_io:inout std_logic_vector(7 downto 0)); ---8位数据线
end data_bus;
architecture Behavioral of data_bus is
signal cs_n:std_logic_vector(13 downto 0);
signal hin:std_logic_vector(7 downto 0);
signal lin:std_logic_vector(7 downto 0);
signal dout:std_logic;
begin
hin<=counter_0(15 downto 8);
lin<=counter_0(7 downto 0);
counter_start<=dout;
cs_n <= cs_b400_n & cs_b000_n & cs_ac00_n & cs_a800_n &cs_a400_n &
cs_a000_n & cs_9c00_n & cs_9800_n & cs_9400_n & cs_9000_n & cs_8c00_n &
cs_8800_n & cs_8400_n & cs_8000_n;
--读
Process(rd_n,counter_0,cs_n)
begin
if rd_n = '0' then
case cs_n is
when "11111111111110" =>
dout <=hin
when "11111111111101" =>
dout <=lin
when others =>
dout <= "ZZZZZZZZ";
end case;
else
dout <= "ZZZZZZZZ";
end if;
end process;
--写
PROCESS(wr_n)
begin
if falling_edge(wr_n) then
if cs_bc00_n = '0' then
dout<=din(0); --start输出
end if;
end if;
end process;
counter_lock <= cs_b800_n;
counter_clr <= cs_c000_n;
另外编译的时候老是出现如下警告:
WARNING:SpeedCalc:42 - Cannot find referenced model "bel_d_min_period". This generally indicates that there is an inconsistency between versions of the speed and device data files. Please check to ensure that the XILINX environment variable is set correctly, if the MYXILINX variable is set, make sure that it is pointing to patch files that are compatable with the version of software that the XILINX variable points to.
WARNING:SpeedCalc:42 - Cannot find referenced model "bel_d_min_period". This generally indicates that there is an inconsistency between versions of the speed and device data files. Please check to ensure that the XILINX environment variable is set correctly, if the MYXILINX variable is set, make sure that it is pointing to patch files that are compatable with the version of software that the XILINX variable points to.
环境变量设置不正确?不明白什么意思,对最后结果会有影响吗?
我用的芯片是XC2S15,
各位帮帮忙啊,42度啊,热死了晕死了急死了
另外若将写过程改为:
PROCESS(wr_n)
begin
if falling_edge(wr_n) then
if cs_bc00_n = '0' then
dout<='1'; --start输出
end if;
end if;
end process;
编译时则直接将wr_n信号去掉啦,也不懂
加一句
else dout<='0'; 好了,start一直输出为高!!还是不懂
高手帮忙解答啊