Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Error (10028): Can't resolve multiple constant drivers for net"light" at LED.vhd(25) NEED HELP!

Reply
Thread Tools

Error (10028): Can't resolve multiple constant drivers for net"light" at LED.vhd(25) NEED HELP!

 
 
willmann817
Guest
Posts: n/a
 
      01-24-2013
Below is the entity where the error is occurring. I understand the error message but I do not know how to fix. Can anyone please tell me how to fix it? I know it is something simple (at least I hope so!). Thanks.
Here are the error message:
Error (1002: Can't resolve multiple constant drivers for net "light" at LED.vhd(25)
Error (10029): Constant driver at LED.vhd(1



library IEEE;
use IEEE.STD_LOGIC_1164.all;

entity LED is
port(
numSoldiersMissing : in STD_logic_vector(15 downto 0);
light : out STD_Logic
);
end LED;

architecture LED of LED is
signal sig1 : std_logic;

begin

process (numSoldiersMissing)
begin
if numSoldiersMissing <= "0000000000000000" then
light <= '0';
else
light <= '1';
end if;
end process;
--output logic
light <= sig1;

end LED;
 
Reply With Quote
 
 
 
 
goouse99@gmail.com
Guest
Posts: n/a
 
      01-24-2013
Am Donnerstag, 24. Januar 2013 04:52:57 UTC+1 schrieb willmann817:
> Below is the entity where the error is occurring. I understand the error message but I do not know how to fix. Can anyone please tell me how to fix it? I know it is something simple (at least I hope so!). Thanks.
>
> Here are the error message:
>
> Error (1002: Can't resolve multiple constant drivers for net "light" at LED.vhd(25)
>
> Error (10029): Constant driver at LED.vhd(1
>
>
>
>
>
>
>
> library IEEE;
>
> use IEEE.STD_LOGIC_1164.all;
>
>
>
> entity LED is
>
> port(
>
> numSoldiersMissing : in STD_logic_vector(15 downto 0);
>
> light : out STD_Logic
>
> );
>
> end LED;
>
>
>
> architecture LED of LED is
>
> signal sig1 : std_logic;
>
>
>
> begin
>
>
>
> process (numSoldiersMissing)
>
> begin
>
> if numSoldiersMissing <= "0000000000000000" then
>
> light <= '0';
>
> else
>
> light <= '1';
>
> end if;
>
> end process;
>
> --output logic
>
> light <= sig1;
>
>
>
> end LED;


Hi,
that's a simple one.
Just delete the sig1 stuff.

You are assigning the output light directly in the process, which is OK here.

The signal and the output assignment are not needed in this case.
Just when you have some feedback situation you need an intermediate signal or variable, since you can't read from an output port.

But sth. else looks strange:
Can there be a value less than zero in a std logic vector?
Std_logic_vectors are not integers so they have no negative values.

Have a nice synthesis
Eilert
 
Reply With Quote
 
 
 
 
willmann817
Guest
Posts: n/a
 
      01-24-2013
On Wednesday, January 23, 2013 10:52:57 PM UTC-5, willmann817 wrote:
> Below is the entity where the error is occurring. I understand the error message but I do not know how to fix. Can anyone please tell me how to fix it? I know it is something simple (at least I hope so!). Thanks.
>
> Here are the error message:
>
> Error (1002: Can't resolve multiple constant drivers for net "light" at LED.vhd(25)
>
> Error (10029): Constant driver at LED.vhd(1
>
>
>
>
>
>
>
> library IEEE;
>
> use IEEE.STD_LOGIC_1164.all;
>
>
>
> entity LED is
>
> port(
>
> numSoldiersMissing : in STD_logic_vector(15 downto 0);
>
> light : out STD_Logic
>
> );
>
> end LED;
>
>
>
> architecture LED of LED is
>
> signal sig1 : std_logic;
>
>
>
> begin
>
>
>
> process (numSoldiersMissing)
>
> begin
>
> if numSoldiersMissing <= "0000000000000000" then
>
> light <= '0';
>
> else
>
> light <= '1';
>
> end if;
>
> end process;
>
> --output logic
>
> light <= sig1;
>
>
>
> end LED;


Hey thanks a lot. That fixed the problem and I fully compiled.
 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      01-25-2013
On 24 Jan., 07:43, goous...@gmail.com wrote:
> But sth. else looks strange:
> Can there be a value less than zero in a std logic vector?
> Std_logic_vectors are not integers so they have no negative values.


Slv are also not unsigned. So if they are not unsigned, they might be
signed and therefore have negative values?
A good solution to this is to use an explicit conversion to signed or
unsigned in case of "<" or ">" operations. This safes a lot of
trouble.

bye Thomas
 
Reply With Quote
 
GaborSzakacs
Guest
Posts: n/a
 
      01-25-2013
Thomas Stanka wrote:
> On 24 Jan., 07:43, goous...@gmail.com wrote:
>> But sth. else looks strange:
>> Can there be a value less than zero in a std logic vector?
>> Std_logic_vectors are not integers so they have no negative values.

>
> Slv are also not unsigned. So if they are not unsigned, they might be
> signed and therefore have negative values?
> A good solution to this is to use an explicit conversion to signed or
> unsigned in case of "<" or ">" operations. This safes a lot of
> trouble.
>
> bye Thomas


In this case it was probably a typical slip of the fingers. Using
<= when you meant = is quite common when you're used to typing <=
for assignments. If the arguments are unsigned, then <= 0 would
have the same effect as = 0, so he got lucky...

-- Gabor
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      01-28-2013
On Friday, January 25, 2013 12:55:48 PM UTC-6, Gabor Sz wrote:
> Thomas Stanka wrote: > On 24 Jan., 07:43, goous...@gmail.com wrote: >> But sth. else looks strange: >> Can there be a value less than zero in a std logic vector? >> Std_logic_vectors are not integers so they have no negative values. > > Slv are also not unsigned. So if they are not unsigned, they might be > signed and therefore have negative values? > A good solution to this is to use an explicit conversion to signed or > unsigned in case of "<" or ">" operations. This safes a lot of > trouble. > > bye Thomas In this case it was probably a typical slip of the fingers. Using <= when you meant = is quite common when you're used to typing <= for assignments. If the arguments are unsigned, then <= 0 would have the same effect as = 0, so he got lucky... -- Gabor


He got REALLY lucky...

Without a package to add numeric interpretation of SLV, the "<=" operatorwould also return true if the LH argument is shorter than the RH argument (regardless of there relative numeric values!). This is one risk of using magnitude comparisons with SLV (in the absense of an overriding package), that the compiler will silently apply a comparison that may not have been apparent to the user. So if he'd been missing one of those '0's (or added an extra bit), it would not have behaved as he expected, but would have happilycompiled and executed without warning! Synthesis might issue a warning, ifyou're lucky.

Numeric_std (and numeric_std_unsigned) comparison functions (operators) remove the vector length from the comparison, and apply a strictly numeric interpretation of the arguments. Metavalues will result in a warning, and a returned value of false.

The OP would have been best served to either use numeric_std_unsigned, and:

if numSoldiersMissing = 0 then -- unsigned numeric comparison

or use numeric_std, and:

if unsigned(numSoldiersMissing) = 0 then -- unsigned numeric comparison

Note that both of these use an integer literal as an argument, which is independent of the bit width of the SLV.

Andy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant doesn't resolve at runtime goscottie@gmail.com ASP .Net 4 04-14-2009 08:36 AM
multiple constant drivers for net IOP_ jasonkee111 VHDL 0 12-29-2008 07:16 AM
How to debug & resolve constant gsview crash on pstoedit.dll software.installer@yahoo.com Digital Photography 1 02-01-2008 02:15 AM
src-resolve: Cannot resolve the name ... ivanet@gmail.com XML 1 03-23-2007 12:10 PM
"error C2057: expected constant expression", "error C2466: cannot allocate an array of constant size 0". Why doesn't my simple program work??? hn.ft.pris@gmail.com C++ 13 01-22-2007 02:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57