EmbDev.net

Forum: FPGA, VHDL & Verilog Mutiple source drivers - How to resolve it??


von John M. (215)


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??

: Edited by User
von Duke Scarring (Guest)


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

von FPGA-advisor (Guest)


Rate this post
useful
not useful
you should learn to describe any of the signals in a design only in one 
process rather than accesing it from various places.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.