Hello, My code is not running , it says synthesys XST failed but it doesnt say why. i fixed every error shown before but now its not showing whats wrong Thanks
1 | library IEEE; |
2 | use IEEE.STD_LOGIC_1164.ALL; |
3 | use IEEE.STD_LOGIC_arith.ALL; |
4 | use IEEE.STD_LOGIC_unsigned.ALL; |
5 | -- Uncomment the following library declaration if using |
6 | -- arithmetic functions with Signed or Unsigned values |
7 | --use IEEE.NUMERIC_STD.ALL; |
8 | |
9 | -- Uncomment the following library declaration if instantiating |
10 | -- any Xilinx primitives in this code. |
11 | --library UNISIM; |
12 | --use UNISIM.VComponents.all; |
13 | |
14 | entity voting_machine is |
15 | Port
|
16 | (
|
17 | clk: in std_logic; |
18 | reset: in std_logic; |
19 | party1: in std_logic; |
20 | party2: in std_logic; |
21 | party3: in std_logic; |
22 | select_party: in std_logic; |
23 | count1_op : out std_logic_vector(5 downto 0); |
24 | count2_op : out std_logic_vector(5 downto 0); |
25 | count3_op : out std_logic_vector(5 downto 0) |
26 | );
|
27 | |
28 | end voting_machine; |
29 | |
30 | architecture Behavioral of voting_machine is |
31 | |
32 | signal count1,count2,count3: std_logic_vector(5 downto 0); |
33 | signal state: std_logic_vector(5 downto 0); |
34 | constant initial: std_logic_vector(5 downto 0):="000001"; |
35 | constant check: std_logic_vector(5 downto 0):="000010"; |
36 | constant party1_state: std_logic_vector(5 downto 0):="000100"; |
37 | constant party2_state: std_logic_vector(5 downto 0):="001000"; |
38 | constant party3_state: std_logic_vector(5 downto 0):="010000"; |
39 | constant done: std_logic_vector(5 downto 0):="100000"; |
40 | |
41 | |
42 | begin
|
43 | |
44 | process( clk, party1, party2, party3,reset) |
45 | |
46 | begin
|
47 | |
48 | if (reset='1') then |
49 | count1<=(others=>'0'); |
50 | count2<=(others=>'0'); |
51 | count3<=(others=>'0'); |
52 | state<=initial; |
53 | elsif (rising_edge(clk) and reset='0') then |
54 | |
55 | case state is |
56 | |
57 | when initial=> |
58 | --NSL |
59 | if (party1='1' or party2='1' or party3='1') then |
60 | state<=check; |
61 | |
62 | else
|
63 | state<=initial; |
64 | --OFL |
65 | end if; |
66 | when check => |
67 | --NSL |
68 | if(party1='1') then |
69 | state<=party1_state; |
70 | elsif (party2='1') then |
71 | state<=party2_state; |
72 | elsif (party3='1') then |
73 | state<=party3_state; |
74 | else
|
75 | state<=check; |
76 | end if; |
77 | --OFL |
78 | when party1_state => |
79 | --NSL |
80 | if (select_party='1') then |
81 | state<=done; |
82 | else
|
83 | state<=party1_state; |
84 | |
85 | end if; |
86 | --OFL |
87 | count1<=count1 + 1; |
88 | |
89 | |
90 | when party2_state => |
91 | --NSL |
92 | if (select_party='1') then |
93 | state<=done; |
94 | else
|
95 | state<=party2_state; |
96 | |
97 | end if; |
98 | --OFL |
99 | count2<=count2 + 1; |
100 | |
101 | when party3_state => |
102 | --NSL |
103 | if (select_party='1') then |
104 | state<=done; |
105 | else
|
106 | state<=party3_state; |
107 | |
108 | end if; |
109 | --OFL |
110 | count3<=count3 + 1; |
111 | |
112 | when done => |
113 | --NSL |
114 | state<=initial; |
115 | --OFL |
116 | when others=> |
117 | state<=initial; |
118 | end case; |
119 | end if; |
120 | |
121 | end process; |
122 | count1_op<=count1; |
123 | count2_op<=count2; |
124 | count3_op<=count3; |
125 | |
126 | end Behavioral; |