Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Running for loop and stopping it in VHDL

Status
Not open for further replies.

info_req

Member level 5
Joined
Jun 20, 2007
Messages
81
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,288
Location
Pakistan
Activity points
1,764
Heloo dear,
I want to make cumulative histogram in VHDL. I am using for loop with wait ststement. It runs for ever. I need to run this for loop only once and then stop. Can any one tell me how it is possible.

Thanks
 

for loop

u have to put the for loop in an always block or a initial block according to verilog syntax which runs forever. so put a variable in the loop and check it before entering the loop.
this should work.
ex.
var=0;
if(var ==0)
begin
for()
var=1
end
end
regards
 

Re: for loop

1. If you are doing a design, and are using a 'wait' statement in it. Its not going to synthesize.
2. Anyway... here is how u exit a vhdl loop.
use 'exit' thats it.

example:

process blah_blah:
variable index_var : integer ;
begin
index_var := 0;
for i in 0 to 10 loop
index_var := index_var+1;
-- do your loop things here
if(index_var = 1) then
exit;
end if;
end loop;
end process bhah_blah;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top