星空最火知名网站

登录 免费注册 星空最火知名网站 | 行业黑名单 | 帮助
维库电子市场网
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统
驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe

请教VHDL的Can't resolve multiple constant drivers 问题

作者:dpirly 栏目:EDA技术
请教VHDL的Can't resolve multiple constant drivers 问题
我写的VHDL数字钟
用QuartusII 5.0 编译的
总是出现 Error: Can't resolve multiple constant drivers for et "reg_minute[5]" at clock.vhd(34) 的错误.
我试着多加了一些 访问控制信号 还是不管事啊? 请教一下

源代码:
-------------------------------
-- File:clock_core.vhd
--
-------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity clock_core is
    PORT(
        sys_clk:in std_logic;        --系统时钟
        clk_1hz:in std_logic;        --表时钟
        
        hour:out std_logic_vector(5 downto 0);    --小时输出
        minute:out std_logic_vector(5 downto 0); --分
        second:out std_logic_vector(5 downto 0); --秒
        
        inc:in std_logic;    -- 加1
        dec:in std_logic;    -- 减1
        sel:in std_logic_vector(1 downto 0); --选择时\分\秒

        reset:in std_logic;  --复位
        mode:in std_logic    --  走表\设置 模式  1->设置  0->走表
        );
end entity;

architecture bhv of clock_core is
    -- 内部寄存器
    signal reg_hour:std_logic_vector(5 downto 0);
    signal reg_minute:std_logic_vector(5 downto 0);
    signal reg_second:std_logic_vector(5 downto 0);
begin
    -- 系统进程
    PROCESS(sys_clk,reset)
    begin
        if sys_clk'event and sys_clk = '1' then
            
            -- 同步复位
            if mode = '1' and reset = '1' then ---就在这!!!!!!!!
                reg_hour <= "000000";
                reg_minute <= "000000";
                reg_second <= "000000";
            
            -- 对表
            elsif mode = '1' and reset = '0' then
                case sel is
                    when "00"=>
                        if inc = '1' then
                            reg_hour <= reg_hour + 1;
                        elsif dec = '1' then
                            reg_hour <= reg_hour - 1;
                        end if;
                    when "01"=>
                        if inc = '1' then
                            reg_minute <= reg_minute + 1;
                        elsif dec = '1' then
                            reg_minute <= reg_minute - 1;
                        end if;
                    when "10"=>
                        if inc = '1' then
                            reg_second <= reg_second + 1;
                        elsif dec = '1' then
                            reg_second <= reg_second - 1;
                        end if;
                    when others =>
                        null;
                end case;
            end if;
        end if;
    end PROCESS;

    -- 走表进程
    PROCESS(clk_1hz)
    begin
        if clk_1hz'event and clk_1hz='1' then
            -- 走表模式
            if mode = '0' and reset = '0' then --还有这!!!!!!!!
                reg_second <= reg_second + 1;
                if reg_second = 59  then
                    reg_second <="000
2楼: >>参与讨论
dpirly

等啊....

3楼: >>参与讨论
pearcaoer
电路无法实现
sys_clk'event and sys_clk = '1'
clk_1hz'event and clk_1hz='1'
两个地方都有reg_hour=XXXXX,电路无法实现

4楼: >>参与讨论
pearcaoer
--看这里
CAUSE: In the current design, multiple constant (non-tri-state) drivers are contending for the specified net, which was created by Integrated Synthesis to represent one or more signals. This condition usually occurs when a Verilog Design File (.v) or VHDL Design File (.vhd) contains multiple concurrent assignments to the same signal. Integrated Synthesis attempted to resolve the electrically equivalent assignments, but cannot resolve the contending assignments into a SINGLE equivalent driver.

The message(s) immediately below this message indicate the constant drivers to the net that conflict with the net's first constant driver.

During analysis and elaboration, Integrated Synthesis merges electrically equivalent signals when no pragmas or attributes prevent the merger. As a result, the net NAME specified in this message may not REFER to the signal with multiple concurrent assignments; instead, the message may REFER to a equivalent signal in the same design file that was merged to the problematic signal. For example, in the following code, the signal contention is assigned a VALUE in both the Concurrent Signal Assignment Statement and the PROCESS.html">PROCESS Statement. However, during optimization but prior to conflict checking, Integrated Synthesis may merge contention with its equivalent signal no_contention, and report in this message that no_contention (and not contention) is the net with multiple constant drivers.

contention <= data; --看这里
PROCESS (enable)
BEGIN     
   IF enable = '1' THEN        
          contention <= '0';    --看这里
  
       no_contention <= '0';    
   ELSE        
           contention <= '1';      --看这里
  
             no_contention <= '1';    
   END IF;
END_PROCESS;


ACTION: Check the design for multiple concurrent assignments to the same signal. As explained in the information above, the net NAME specified in this message may REFER to either the signal with multiple concurrent assignments or an equivalent signal that was merged with the problematic signal during optimization.


5楼: >>参与讨论
dpirly
谢谢
我的英文实在是太差了,看的稀里糊涂的

6楼: >>参与讨论
dpirly
回3楼
" sys_clk'event and sys_clk = '1'
clk_1hz'event and clk_1hz='1'
两个地方都有reg_hour<=XXXXX,电路无法实现"

我的意思是在reg_hour<=XXXXX赋值之前用mode信号区分两个进程的赋值
应该不会出现两个进程同时对一个信号赋值的情况

如果把PROCESS(clk_1hz)中的
            hour <= reg_hour;
            minute <= reg_minute;
            second <= reg_second;
删除就可以编译通过

我又修改了一下,增加了一个新的进程,它检测clk_1hz的下降沿,
把结果输出
PROCESS(clk_1hz,mode)
    begin
        if mode = '0' and reset = '0' then
            if clk_1hz'event and clk_1hz='0' then
                hour <= reg_hour; --在这
                minute <= reg_minute; -- 这
                second <= reg_second; -- 这
            end if;
        end if;
    end PROCESS;
结果还一样,编译失败


* - 本贴最后修改时间:2006-12-11 19:46:18 修改者:dpirly

7楼: >>参与讨论
pearcaoer
这个可以编译

-------------------------------
-- File:clock_core.vhd
--
-------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity clock_core is
    PORT(
        sys_clk:in std_logic;        --系统时钟
        clk_1hz:in std_logic;        --表时钟
        
        hour:out std_logic_vector(5 downto 0);    --小时输出
        minute:out std_logic_vector(5 downto 0); --分
        second:out std_logic_vector(5 downto 0); --秒
        
        inc:in std_logic;    -- 加1
        dec:in std_logic;    -- 减1
        sel:in std_logic_vector(1 downto 0); --选择时\分\秒

        reset:in std_logic;  --复位
        mode:in std_logic    --  走表\设置 模式  1->设置  0->走表
        );
end entity;

architecture bhv of clock_core is
    -- 内部寄存器
    signal reg_hour:std_logic_vector(5 downto 0);
    signal reg_minute:std_logic_vector(5 downto 0);
    signal reg_second:std_logic_vector(5 downto 0);
    signal tmp_reg_hour:std_logic_vector(5 downto 0);
    signal tmp_reg_minute:std_logic_vector(5 downto 0);
    signal tmp_reg_second:std_logic_vector(5 downto 0);
begin
    -- 系统进程
    PROCESS(sys_clk)
    begin
        if sys_clk'event and sys_clk = '1' then
            
            -- 同步复位
            if mode = '1' and reset = '1' then ---就在这!!!!!!!!
                tmp_reg_hour <= "000000";
                tmp_reg_minute <= "000000";
                tmp_reg_second <= "000000";
            
            -- 对表
            elsif mode = '1' and reset = '0' then
                case sel is
                    when "00"=>
                        if inc = '1' then
                            tmp_reg_hour <= tmp_reg_hour + 1;
                        elsif dec = '1' then
                            tmp_reg_hour <= tmp_reg_hour - 1;
                        end if;
                    when "01"=>
                        if inc = '1' then
                            tmp_reg_minute <= tmp_reg_minute + 1;
                        elsif dec = '1' then
                            tmp_reg_minute <= tmp_reg_minute - 1;
                        end if;
                    when "10"=>
                        if inc = '1' then
                            tmp_reg_second <= tmp_reg_second + 1;
                        elsif dec = '1' then
                            tmp_reg_second <= tmp_reg_second - 1;
                        end if;
                    when others =>
                        null;
                end case;
            end if;
        end if;
    end PROCESS;

    -- 走表进程
    PROCESS(clk_1hz,mode)
    begin
        if mode='1' then
            reg_hour <= tmp_reg_hour;
            reg_minute <= tmp_reg_minute;
            reg_second <= tmp_reg_second;            
        
        elsif clk_1hz'event and clk_1hz='1' then
            -- 走表模式
&
8楼: >>参与讨论
dpirly
谢谢
谢谢了

不过还是有问题,又仔细看了以下发现里面的问题还挺多呢!

* - 本贴最后修改时间:2006-12-12 21:10:39 修改者:dpirly

9楼: >>参与讨论
lzwsdu
  两个不同的process中不能对同一信号进行赋值
参与讨论
昵称:
讨论内容:
 
 
相关帖子
license 问题?
请问:FPGA和Flash是怎样连接的
帮我看看这个VHD程序
大虾帮帮忙:verilog的一句话困扰了我好久
请问有没有这样得CPLD


Copyright © 1998-2006 www.j71x6.cn 浙ICP证030469号
博鱼最火网上大全(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 网络188BET导航(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 外围权威利记官方(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 真人利记足球大全(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 永利网络足球网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 雷火竞技正规权威网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 188BET线上外围(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 永利最新网上足球(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新)