Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Wait statement in a Process

Reply
Thread Tools

Wait statement in a Process

 
 
leeaby@gmail.com
Guest
Posts: n/a
 
      02-18-2007
Hi,

How many wait statements can we use in a process statement?
I us Quartus II web edition for compilation. On compiling my code it
says, we cant use multiple wait statements in the same process.
However many books give examples of processes with multiple wait
statements.

I need to design a sample data transfer interface. For this i need to
find the clock events.
However i cannot use

* if clk'EVENT and clk = '1' then *

construct. What exactly i need is to wait till i get the next clock
edge. Hope you understood the question. Any solution to it, in logic
or code will be a great help for proceeding my project.

Thanking You all in advance.
Lee

 
Reply With Quote
 
 
 
 
HT-Lab
Guest
Posts: n/a
 
      02-18-2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi,
>
> How many wait statements can we use in a process statement?


This depends on your synthesis tool, most high-end tools like
Precision/Synplify can handle multiple "wait until" statements in a process
provided they use the same clock signal.

> I us Quartus II web edition for compilation. On compiling my code it
> says, we cant use multiple wait statements in the same process.
> However many books give examples of processes with multiple wait
> statements.
>
> I need to design a sample data transfer interface. For this i need to
> find the clock events.
> However i cannot use
>
> * if clk'EVENT and clk = '1' then *
>
> construct. What exactly i need is to wait till i get the next clock
> edge. Hope you understood the question. Any solution to it, in logic
> or code will be a great help for proceeding my project.


Google VHDL Finite State Machines (1,2,3 process statemachines, mealy versus
moore etc).

Hans
www.ht-lab.com



>
> Thanking You all in advance.
> Lee
>



 
Reply With Quote
 
 
 
 
backhus
Guest
Posts: n/a
 
      02-19-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) schrieb:
> Hi,
>
> How many wait statements can we use in a process statement?
> I us Quartus II web edition for compilation. On compiling my code it
> says, we cant use multiple wait statements in the same process.
> However many books give examples of processes with multiple wait
> statements.
>
> I need to design a sample data transfer interface. For this i need to
> find the clock events.
> However i cannot use
>
> * if clk'EVENT and clk = '1' then *
>
> construct. What exactly i need is to wait till i get the next clock
> edge. Hope you understood the question. Any solution to it, in logic
> or code will be a great help for proceeding my project.
>
> Thanking You all in advance.
> Lee
>

Hi Lee,
as Hans mentioned, there's only one Clock signal per Process allowed.
But when you write "...to wait till i get the next clock
edge." do you mean any clock edge?

For simulation you can do that easily with:

if clk'EVENT then

but for synthesis you need a target that supports dual edge FFs. I doubt
that these are in your desired FPGA.
AFAIK, the only devices that have Dual Edge FFs are some XILINX CPLDs.

There are lots of postings about this topic in comp.lang.vhdl and
comp.arch.fpga.

have a nice synthesis
Eilert
 
Reply With Quote
 
R Quijano
Guest
Posts: n/a
 
      02-19-2007
I have the code for a dual edge D flipflop and it seems to work fine
in the ISE synthesis tool

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity LatchDD is
Port (D,CLK,R : in STD_LOGIC;
Q,QN : out STD_LOGIC);
end LatchDD;

architecture Behavioral of LatchDD is
signal Q1,Q2 : std_logic;
begin
-- Positive Edge ---
process(D,clk,R)
begin
if R='1' then Q2<='0';
elsif(clk'event and clk='1') then Q2<=D;
else null; end if;
end process;
-- Negative Edge ---
process(D,clk,R)
begin
if R='1' then Q1<='0';
elsif(clk'event and clk='0') then Q1<=D;
else null; end if;
end process;

Q <= (Q1 or Q2);
QN <= not(Q1 or Q2);

end Behavioral;

------------------------------------

Or you can use this that only check the edges of the clk

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity LatchDD is
Port (D,CLK,R : in STD_LOGIC;
Q,QN : out STD_LOGIC);
end LatchDD;

architecture Behavioral of LatchDD is
signal Q1,Q2 : std_logic;
begin
-- Positive Edge ---
process(D,clk,R)
begin
if R='1' then Q2<='0';
elsif(rising_edge(clk)) then Q2<=D;
else null; end if;
end process;
-- Negative Edge ---
process(D,clk,R)
begin
if R='1' then Q1<='0';
elsif(falling_edge(clk)) then Q1<=D;
else null; end if;
end process;

Q <= (Q1 or Q2);
QN <= not(Q1 or Q2);

end Behavioral;

Hope this help you, I'm a student of vhdl, so plz don't be to harsh if
this is not the answer



On Feb 18, 2:18 am, (E-Mail Removed) wrote:
> Hi,
>
> How many wait statements can we use in a process statement?
> I us Quartus II web edition for compilation. On compiling my code it
> says, we cant use multiple wait statements in the same process.
> However many books give examples of processes with multiple wait
> statements.
>
> I need to design a sample data transfer interface. For this i need to
> find the clock events.
> However i cannot use
>
> * if clk'EVENT and clk = '1' then *
>
> construct. What exactly i need is to wait till i get the next clock
> edge. Hope you understood the question. Any solution to it, in logic
> or code will be a great help for proceeding my project.
>
> Thanking You all in advance.
> Lee



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL--usage of WAIT statement in PROCESS anil VHDL 2 03-04-2010 10:43 AM
VHDL Wait-Statement after Synthese Roman VHDL 2 03-04-2010 10:41 AM
wait for statement inside a process carbon9 VHDL 1 05-19-2008 08:02 PM
Child process wait father process excute some code then begin execute empriser C Programming 1 03-06-2007 02:24 AM
How to make "fork/wait" to WAIT longer? Huey C Programming 1 03-01-2004 02:01 PM



Advertisments