esielec
Newbie level 6
- Joined
- Jul 5, 2015
- Messages
- 13
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 195
my code is:
Is the solution offered me the manager?please help me
Code VHDL - [expand] 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity mishee is port(clk,rst:in std_logic; bw:in std_logic ; rcvim:out std_logic; rma:in std_logic_vector(4 downto 0); test:out std_logic_vector(13 downto 0); rcvrmap:out std_logic ); end; architecture esi of mishee is ---------------------------------- function CONV_INT2STDLV(ARG: INTEGER; SIZE: INTEGER) return STD_LOGIC_VECTOR is variable result: STD_LOGIC_VECTOR (SIZE-1 downto 0):=x"00"; variable temp: integer:= 0; begin temp := ARG; for i in 0 to SIZE-1 loop if ((temp mod 2) = 1) then result(i) := '1'; else result(i) := '0'; end if; if temp > 0 then temp := temp / 2; elsif (temp > integer'low) then temp := (temp - 1) / 2; -- simulate ASR else temp := temp / 2; -- simulate ASR end if; end loop; return result; end CONV_INT2STDLV; ----------------------------------------- ----------------------------------------- component ram_hough is generic ( DATA_WIDTH :integer := 8; ADDR_WIDTH :integer := 14 ); port ( clk :in std_logic; -- Clock Input address :in std_logic_vector (ADDR_WIDTH-1 downto 0); -- address Input data :inout std_logic_vector (DATA_WIDTH-1 downto 0); -- data bi-directional cs :in std_logic; -- Chip Select we :in std_logic; -- Write Enable/Read Enable oe :in std_logic -- Output Enable ); end component; ---------------------------------------------- component ram_rma is generic ( DATA_WIDTH :integer := 5; ADDR_WIDTH :integer := 11 ); port ( clk :in std_logic; -- Clock Input address :in std_logic_vector (ADDR_WIDTH-1 downto 0); -- address Input data :inout std_logic_vector (DATA_WIDTH-1 downto 0); -- data bi-directional cs :in std_logic; -- Chip Select we :in std_logic; -- Write Enable/Read Enable oe :in std_logic -- Output Enable ); end component; ------------------------------------------ type vec2x is array (0 to 2)of integer range 0 to 105; signal circlec,circlex,circley,circler:vec2x; signal circle:std_logic_vector(7 downto 0); type state_machine is(s0_start,s1_rcvim,s2_rcvrmap,s3_index,s4_chek,s7_write, s8_mem,s9_plus,s10_hough,s11_wr,s12_wr,s15_index,s16_index, s18_index,s9_mem,s10_plus,s5_chek,s6_chek,s00start,s3_rcvrmap,s7_chek, s11_plus,s12_plus); signal state:state_machine:=s0_start; signal data :std_logic_vector(7 downto 0); signal address:std_logic_vector(13 downto 0); signal address1:std_logic_vector(10 downto 0); signal data1:std_logic_vector(4 downto 0); signal cs,we,oe,cs1,we1,oe1:std_logic; signal edgx,edgy:integer range 0 to 63; signal test1,test2:std_logic_vector(7 downto 0); signal test3 :std_logic_vector(7 downto 0); begin ha1: ram_hough port map(clk=>clk, address=>address, data=>data,cs=>cs,we=>we,oe=>oe); ha2: ram_rma port map(clk=>clk, address=>address1, data=>data1,cs=>cs1,we=>we1,oe=>oe1); process(clk) variable row,indexx:integer range 0 to 99:=0; variable clm,indexy:integer range 0 to 104:=0; variable row2,clm2,clm3,r19x,r19y:integer range 0 to 41:=0; variable ho,ho1,test1:std_logic_vector(7 downto 0):="00000000"; variable indexxx:integer range 0 to 10400; variable counter,counter2,counter3,counter4:std_logic_vector(13 downto 0):=(others=>'0'); variable counter5,counter6:std_logic_vector(10 downto 0):=(others=>'0'); variable data_rma:std_logic_vector(4 downto 0); begin if (clk'event and clk='1') then rcvrmap<='1'; if(rst='1')then if(state=s00start)then if(counter5<"11010010000") then address1<=counter5; data1<=rma; cs1 <= '1'; we1 <= '1'; counter5:=counter5+"00000000001"; else state<=s0_start; end if; elsif(state=s0_start)then if(counter<"10100010100000") then address<=counter; data<=ho; cs <= '1'; we <= '1'; counter:=counter+"00000000000001"; -- else state<=s1_rcvim; --kharej shodan az halqe tabdil hough -- cs <= '0'; we <= '0'; rcvim<='1'; end if; elsif(state=s1_rcvim) then if(clm>63) then clm:=0; row:=row+1; end if; if(row<59) then if(bw='1') then edgx<=row; edgy<=clm; rcvim<='0'; state<=s2_rcvrmap; end if; clm:=clm+1; else state<=s4_chek; clm:=0; row:=0; rcvim<='0'; end if; elsif(state=s2_rcvrmap)then if(clm2>40) then clm2:=0; row2:=row2+1; end if; if(row2<41) then cs1 <= '1'; we1 <= '0'; oe1 <= '1'; address1<=counter6; state<=s3_rcvrmap; clm2:=clm2+1; else state<=s1_rcvim; clm2:=0; row2:=0; rcvim<='1'; end if; elsif(state=s3_rcvrmap)then data_rma:=data1; counter6:=counter6+1; if(data_rma="10011")then R19x:=Row2-1; R19y:=clm2-2; state<=s3_index; end if; state<=s2_rcvrmap; elsif(state=s3_index)then cs <= '0'; we <= '0'; indexx:=R19x+row; indexy:=R19y+clm; state<=s15_index; elsif(state=s15_index)then indexxx:=104*indexx; state<=s16_index; elsif(state=s16_index)then indexxx:=indexxx+indexy; state<=s18_index; elsif(state=s18_index)then counter2:=conv_std_logic_vector(indexxx,14); state<=s8_mem; elsif(state=s8_mem)then address<=counter2; state<=s9_mem; elsif(state=s9_mem)then cs <= '1'; we <= '0'; oe <= '1'; state<=s9_plus; elsif(state=s9_plus)then state<=s10_plus; ho :=data; elsif(state=s11_plus)then ho1:=ho; ho1:=ho1+"00000001"; elsif(state=s12_plus)then ho:=ho1; elsif(state=s10_plus)then cs <= '1'; we <= '1'; data<=ho; state<=s2_rcvrmap; rcvrmap<='1'; elsif(state=s4_chek)then if(counter3<"10100010100000") then address<=counter3; cs <= '1'; we <= '0'; oe <= '1'; state<=s5_chek; else -- end if; elsif(state=s5_chek)then ho :=data; state<=s7_chek; elsif(state=s7_chek)then --test<="00000000000000"; test<="000000"&ho; if(ho >"00000011")then counter4:=counter3; state<=s6_chek; end if; counter3:=counter3+"00000000000001" ; state<=s4_chek; elsif(state=s6_chek)then --test<="00000000000000"; end if;--of state end if;-- of rst end if;-- of clk end process; end;
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[29]" has multiple drivers due to the non-tri-state driver "data[0]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[30]" has multiple drivers due to the non-tri-state driver "data[1]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[31]" has multiple drivers due to the non-tri-state driver "data[2]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[32]" has multiple drivers due to the non-tri-state driver "data[3]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[33]" has multiple drivers due to the non-tri-state driver "data[4]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[34]" has multiple drivers due to the non-tri-state driver "data[5]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[35]" has multiple drivers due to the non-tri-state driver "data[6]"
Error (13076): The node "ram_hough:ha1|mem_rtl_0_bypass[36]" has multiple drivers due to the non-tri-state driver "data[7]"
Is the solution offered me the manager?please help me
Last edited by a moderator: