Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Error: Multiple constant drivers

Status
Not open for further replies.

Hugo17

Junior Member level 1
Joined
Oct 8, 2015
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
162
I do have following VHDL code example:

Code:
	LIBRARY ieee;
	USE ieee.std_logic_1164.all; 

	LIBRARY work;

	ENTITY Test IS 
		PORT
		(	Nios_Reset_n :  IN  STD_LOGIC;
			UserLed :  OUT  STD_LOGIC_VECTOR(4 DOWNTO 0)
		);
	END Test;

	ARCHITECTURE bdf_type OF Test IS 


	COMPONENT misc
		PORT( reset_reset_n : IN STD_LOGIC;
			 userleds_external_connection_export : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)
		);
	END COMPONENT;


	BEGIN 

	b2v_M1 : misc
	PORT MAP(	 reset_reset_n => Nios_Reset_n,
			 userleds_external_connection_export => UserLed);

	UserLed(0) <= '0';

	END bdf_type;



After compiling I get following error message: Error (10028): Can't resolve multiple constant drivers for net "UserLed[0]" at Test.vhd(28)



What I figured out is, that the line UserLed(0) <= '0'; gives the problem but I do not fully understand why because I have not used the signal UserLed elsewhere. It looks like an easy 'problem' here...

Thanks in advance!
 

UserLed(0) is used in two places.


Code VHDL - [expand]
1
2
3
4
5
-- first time here as an output...
userleds_external_connection_export => UserLed);  -- e.g. UserLed(4 downto 0)
 
-- second time here with the assignment...
UserLed(0) <= '0';

 

Ok I see the problem. When I introduce a new signal led_int and change the code like this:

Code:
architecture bdf_type of Test is 
  signal led_int : STD_LOGIC_VECTOR(4 downto 0);

  component misc
    port (
      reset_reset_n                       : IN  STD_LOGIC;
      userleds_external_connection_export : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)
    );
  end component;
begin 
  b2v_M1 : misc
    port map (
      reset_reset_n =>                       Nios_Reset_n,
      userleds_external_connection_export => led_int
    );

  led_int(0) <= '0';
  UserLed <= led_int;
end architecture;


Why do I get the same error message but here with Error (10028): Can't resolve multiple constant drivers for net "led_int[0]" at Test.vhd(11)?
 

its the same problem. You're driving led_int(0) to '0', and also driving it from the misc component.
 

Ok but how can I avoid it?
I simply would like to write a value to the output UserLed. As it is not possible (see first post) I introduced an internal signal but it is the same problem again.
 

You avoid it by not assigning a signal from multiple places. Simple as that.

how about:

Code:
UserLed(0) <= '0';
UserLed(4 downto 1) <= led_int(4 downto 1);
 
  • Like
Reactions: Hugo17

    Hugo17

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top