Mutiple source drivers - How to resolve it??

OP #3639487
Rate this post
• ▲ useful
▼ not useful
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 #3639559
Rate this post
• ▲ useful
▼ not useful
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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

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.