集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 9453|回复: 11

VHDL 不知道错在哪了 我是一个初学者

[复制链接]
zhangyasen_8 发表于 2010-12-7 21:46:13 | 显示全部楼层 |阅读模式
library ieee;
use ieee.std_logic_1164.all;

entity par_ser is
port(
      clock  :   in  std_logic;
      parallel_in  : in  std_logic_vector(7 downto 0);
      serial_out   : out  std_logic
     );
     
end par_ser;

architecture behavior of par_ser is
signal parallel: std_logic_vector(7 downto 0);
begin
  parallel(7 downto 0)<=parallel_in(7 downto 0);
  process(clock)
  begin
   if clock'event and clock='1' then
       serial_out<=parallel(0);
      for I in 0 to 6 loop
         parallel(I)<=parallel(I+1);
      end loop;
   end if;   
  end process;
end behavior;
 楼主| zhangyasen_8 发表于 2010-12-7 21:47:27 | 显示全部楼层
编译的时候说是
Error (10031): Net "parallel[6]" at par_ser.vhd(22) is already driven by input port "parallel_in[6]", and cannot be driven by another signal
Error (10032): "parallel_in[6]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[5]" at par_ser.vhd(22) is already driven by input port "parallel_in[5]", and cannot be driven by another signal
Error (10032): "parallel_in[5]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[4]" at par_ser.vhd(22) is already driven by input port "parallel_in[4]", and cannot be driven by another signal
Error (10032): "parallel_in[4]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[3]" at par_ser.vhd(22) is already driven by input port "parallel_in[3]", and cannot be driven by another signal
Error (10032): "parallel_in[3]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[2]" at par_ser.vhd(22) is already driven by input port "parallel_in[2]", and cannot be driven by another signal
Error (10032): "parallel_in[2]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[1]" at par_ser.vhd(22) is already driven by input port "parallel_in[1]", and cannot be driven by another signal
Error (10032): "parallel_in[1]" was declared at par_ser.vhd(7)
Error (10031): Net "parallel[0]" at par_ser.vhd(22) is already driven by input port "parallel_in[0]", and cannot be driven by another signal
Error (10032): "parallel_in[0]" was declared at par_ser.vhd(7)
zhouliang 发表于 2010-12-8 09:09:34 | 显示全部楼层
解决方法(官方):

Check the Verilog HDL module or VHDL entity to locate conflicting assignments to the same signal. Remove all but one of the assignments
我的理解是:你的parallel在16行已经赋值了,22行又赋值,这两个是同时进行的,所以出错了
zhouliang 发表于 2010-12-8 09:09:48 | 显示全部楼层
解决方法(官方):

Check the Verilog HDL module or VHDL entity to locate conflicting assignments to the same signal. Remove all but one of the assignments
我的理解是:你的parallel在16行已经赋值了,22行又赋值,这两个是同时进行的,所以出错了
zhouliang 发表于 2010-12-8 10:43:15 | 显示全部楼层
你试着把 ‘parallel(7 downto 0)<=parallel_in(7 downto 0);’这句放到process begin后面,看看行不行
 楼主| zhangyasen_8 发表于 2010-12-8 11:30:50 | 显示全部楼层
似乎也不行
zhouliang 发表于 2010-12-8 11:34:10 | 显示全部楼层
错误提示是什么
 楼主| zhangyasen_8 发表于 2010-12-8 11:35:46 | 显示全部楼层
Error (10818): Can't infer register for "parallel[0]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[1]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[2]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[3]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[4]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[5]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10818): Can't infer register for "parallel[6]" at par_ser.vhd(21) because it does not hold its value outside the clock edge
Error (10822): HDL error at par_ser.vhd(21): couldn't implement registers for assignments on this clock edge
 楼主| zhangyasen_8 发表于 2010-12-8 12:26:16 | 显示全部楼层
好了 把parallel(7 downto 0)<=parallel_in(7 downto 0);放到process里面 在给他加个使能信号就OK了
很谢谢你啊
zhouliang 发表于 2010-12-8 15:36:37 | 显示全部楼层
加使能信号,呵呵,又学了一课
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-12-28 08:34 , Processed in 0.088701 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表