Mutiple source drivers - How to resolve it??

OP #3639487
I have this process
1
state_fail_win <= test;
2
process(clk,anode,counter_1,counter_10, state_fail_win,anode,counter_1r,counter_10r)
3
variable prescaler: integer range 0 to 49999999 := 0;
4
begin
5
if rising_edge(clk) then
6
    if(prescaler < 49999999/200) then   
7
    prescaler := prescaler + 1;    
8
    else
9
      prescaler := 0;
10
      anode <= anode + '1';
11
    end if;
12
end if;    
13
      
14
if state_fail_win = '1' then 
15
  if (counter_1 < 9) then        
16
    counter_1 <= counter_1 + 1;
17
  else
18
    counter_1 <= 0;
19
      if (counter_10 < 9) then        
20
        counter_10 <= counter_10 + 1;  
21
      else 
22
        counter_10 <= 0;
23
        counter_1 <= 0;
24
      end if;
25
  end if;
26
end if;
27
state_fail_win <= '0';
28
  if state_fail_win = '0' then
29
    case anode is
30
      when "00" => SEG <= counter_1r; 
31
      when "01" => SEG <= counter_10r;
32
      when "10" => SEG <= d;
33
      when "11" => SEG <= r;    
34
      when others => SEG <= "00000000";
35
    end case;
36
  end if;
37
end process;
I don't quite see how i get this error message..
Multi-source in Unit <segment> on signal <test>; this signal is 
connected to multiple drivers.
But how can i Resolve it??
Guest
John Mayer wrote:
> process(clk,anode,counter_1,counter_10,
> state_fail_win,anode,counter_1r,counter_10r)
> variable prescaler: integer range 0 to 49999999 := 0;
> begin
> if rising_edge(clk) then
>     if(prescaler < 49999999/200) then
>     prescaler := prescaler + 1;
>     else
>       prescaler := 0;
>       anode <= anode + '1';
>     end if;
Uhh.
1. You mix up sequential (clk) and combinatorical (without clk) logic in 
the same process. That's very advanced and usally confusing for 
beginners.

2. At least the signal state_fail_win is driven on diffrent places: 
Outside the process and inside the process. That's construct cannot map 
to hardware.

Remember this: Drive a signal only at one point and read it wherever 
you need it. A process is like a chip in your circuit with inputs and 
outputs.

Duke
Guest
you should learn to describe any of the signals in a design only in one 
process rather than accesing it from various places.

Reply

A question of your own? This thread is over 12 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.