Mahati
Newbie level 3
- Joined
- Dec 20, 2012
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,310
Hi everyone,
I tried to implement a code for simulating an ADC in VHDL, in ModelSim, and the code got compiled.
But it is getting struck while simulation and says:
So I checked the line 40 and am unable to find what is wrong with the code.
Please Help !
I tried to implement a code for simulating an ADC in VHDL, in ModelSim, and the code got compiled.
But it is getting struck while simulation and says:
"Stopped at F:/adc1_sim.vhd 40 Process A1"
So I checked the line 40 and am unable to find what is wrong with the code.
Please Help !
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 library IEEE; use IEEE.std_logic_1164.all; --use work.std_arith.all; use IEEE.numeric_std.all; entity adc1_sim is port ( adc1_rbc: in std_logic; data_mux1: in natural; adc1_data: out std_logic; adc1_busy: out std_logic; adc1_dclk: out std_logic ); end adc1_sim; architecture Behaviour72 of adc1_sim is signal rbc, busy, ds, clk_d: std_logic; signal digital : std_logic_vector(15 downto 0):=X"0000"; signal V_max, data_An, res : natural range 0 to 65535; signal i, j, AD : natural range 0 to 65535; begin clk_d<='0'; --I/P port to Signal map rbc<=adc1_rbc; data_An<= data_mux1; --O/P port to Signal map adc1_busy<=busy; A1: process(rbc) begin if(rbc='0' and rbc'event)then res<=V_max/65535; AD<=data_AN/res; digital<= std_logic_vector(to_unsigned(AD,16)); busy<='1'; for i in 0 to 15 loop exit when i = 16 ; j<=15-i; ds<=digital(j) after 78ns; adc1_data<=ds; clk_d<='1'after 78ns; adc1_dclk<=clk_d; clk_d<='0' after 156ns; adc1_dclk<=clk_d; end loop; end if; busy<='1'; end process; end Behaviour72;
Last edited by a moderator: