Xilinx ISE WebPack 5.2 & VHDL : wait synthesis

M

max

Guest
I tried this source code: <p>entity main is <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Port ( clk , en : in std_logic; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sout : out std_logic); <BR>
end main; <p>architecture Behavioral of main is <BR>
begin <BR>
&amp;nbsp;&amp;nbsp;process <BR>
&amp;nbsp;&amp;nbsp;variable a : std_logic; <BR>
&amp;nbsp;&amp;nbsp;begin <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sout &lt;= '0'; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a := '0'; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wait until rising_edge(en); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while en = '1' loop <BR>
-- wait until rising_edge(clk); <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wait until clk'event and clk = '1'; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a := not a; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sout &lt;= a; <BR>
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end loop; <BR>
&amp;nbsp;&amp;nbsp;end process; <p>end Behavioral; <p>and I obtain this error: <p>Analyzing Entity &lt;main&gt; (Architecture &lt;behavioral&gt;). <BR>
ERROR:Xst:825 - C:/Lavori/menfis/prova_xilinx/prova_2/main.vhd line xx: Wait statement in a procedure is not accepted. <p>The question is: can I use wait or not? <BR>
I found a lot of manual on the internet (eg. <a href="http://mikro.e-technik.uni-ulm.de/vhdl/anl-engl.syn/html/node8.html)">http://mikro.e-technik.uni-ulm.de/vhdl/anl-engl.syn/html/node8.html)</a>, and all of them sais that 'wait' is allowed in synthesis. <p>thanks
 
max wrote:
I tried this source code:

entity main is
Port ( clk , en : in std_logic;
sout : out std_logic);
end main;

architecture Behavioral of main is
begin
process
variable a : std_logic;
begin
sout &lt;= '0';
a := '0';
wait until rising_edge(en);
while en = '1' loop
-- wait until rising_edge(clk);
wait until clk'event and clk = '1';
a := not a;
sout &lt;= a;
end loop;
end process;

end Behavioral;

and I obtain this error:

Analyzing Entity &lt;main&gt; (Architecture &lt;behavioral&gt;).
ERROR:Xst:825 - C:/Lavori/menfis/prova_xilinx/prova_2/main.vhd line xx: Wait
statement in a procedure is not accepted.

The question is: can I use wait or not?
I found a lot of manual on the internet (eg.
http://mikro.e-technik.uni-ulm.de/vhdl/anl-engl.syn/html/node8.html), and all of
them sais that 'wait' is allowed in synthesis.

thanks
Your code is NOT a synthesable code.

Don't use 'wait' for synthesis code, but use 'wait' for your testbench
tester.

A synthesisable code will follow the rules:
- reset signal can be asynchro. or synchro.
- enable signal is ever synchro.
- if possible use only signal (don't use variable for synthesable code)

LOOK:

entity main is
Port ( clk , en : in std_ulogic;
sout : out std_ulogic);
end main;

architecture Behavioral of main is
signal a : std_ulogic;
begin
process (clk)
begin
if rising_edge(clk) then
if en = '1' then
a &lt;= not a;
sout &lt;= a;
end if ;
end if;
end process;

end Behavioral;

PS: 'wait' and 'variable' are GREAT for simulation
try http://www.amontec.com/vhdl_part.shtml

Laurent Gauch
www.amontec.com
 
"Amontec Team, Laurent Gauch" wrote:
max wrote:
I tried this source code:

entity main is
Port ( clk , en : in std_logic;
sout : out std_logic);
end main;

architecture Behavioral of main is
begin
process
variable a : std_logic;
begin
sout &lt;= '0';
a := '0';
wait until rising_edge(en);
while en = '1' loop
-- wait until rising_edge(clk);
wait until clk'event and clk = '1';
a := not a;
sout &lt;= a;
end loop;
end process;

end Behavioral;

and I obtain this error:

Analyzing Entity &lt;main&gt; (Architecture &lt;behavioral&gt;).
ERROR:Xst:825 - C:/Lavori/menfis/prova_xilinx/prova_2/main.vhd line xx: Wait
statement in a procedure is not accepted.

The question is: can I use wait or not?
I found a lot of manual on the internet (eg.
http://mikro.e-technik.uni-ulm.de/vhdl/anl-engl.syn/html/node8.html), and all of
them sais that 'wait' is allowed in synthesis.

thanks


Your code is NOT a synthesable code.

Don't use 'wait' for synthesis code, but use 'wait' for your testbench
tester.

A synthesisable code will follow the rules:
- reset signal can be asynchro. or synchro.
- enable signal is ever synchro.
- if possible use only signal (don't use variable for synthesable code)

LOOK:

entity main is
Port ( clk , en : in std_ulogic;
sout : out std_ulogic);
end main;

architecture Behavioral of main is
signal a : std_ulogic;
begin
process (clk)
begin
if rising_edge(clk) then
if en = '1' then
a &lt;= not a;
sout &lt;= a;
end if ;
end if;
end process;

end Behavioral;

PS: 'wait' and 'variable' are GREAT for simulation
try http://www.amontec.com/vhdl_part.shtml

Laurent Gauch
www.amontec.com
Yeah, I would second that opinion. Reading your code it looks like you
are treating VHDL as a software language rather than a hardware
language. To see what I mean, consider what you are trying to tell the
compiler to generate. If you can't figure out what the hardware should
look like, how can you expect the software to figure it out? I know
that I can't figure out what hardware you are trying to describe or what
could be built that would do what your software does. It clearly does
not describe a FF with logic feeding the D input and a clock enable
signal. There are too many waits for that.

Take a look at some synthesis templates for FFs and other hardware items
that you might want to generate. Don't think in terms of the language,
think in terms of the hardware you want to build. Then you should get
synthesizable code.

--

Rick "rickman" Collins

rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX
 

Welcome to EDABoard.com

Sponsor

Back
Top