- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I try to use a code but there are more WAIT. How can i change it ???? I change "wait until" to wait until Clk'event ????
StartTx <= '0';
DataToTx_M <= "0101010101010101";
DataToTx_S <= "1010101010101010";
--wait until Clk = '1';
wait until Clk'event and Clk='1';
reset <= '0';
--wait until Clk = '1';
wait until Clk'event and Clk='1';
StartTx <= '1';
wait until Clk = '1';
StartTx <= '0';
The error is Error (10398): VHDL Process Statement error at simpleSPI_M_S_tb.vhd(100): Process Statement must contain only one Wait Statement Thanks for your help Jennifer
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The rule is correct - you can only have 1 wait statement in a process if you want to compile the code for an fpga.
Your code looks like software, not hardware. I highly recommend you find a VHDL tutorial or VHDL textbook that has digital logic examples. VHDL is a hardware description language, not a programming language. Have you drawn your circuit on paper (or visio or something) before you tried to write the code? as a description language, you need to know what you are describing first.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- The rule is correct - you can only have 1 wait statement in a process if you want to compile the code for an fpga. Your code looks like software, not hardware. I highly recommend you find a VHDL tutorial or VHDL textbook that has digital logic examples. VHDL is a hardware description language, not a programming language. Have you drawn your circuit on paper (or visio or something) before you tried to write the code? as a description language, you need to know what you are describing first. --- Quote End --- Thanks BUT it is a sample that find on web !!!!! How can i change this code ??? Best regards Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
THis code sample you have found is probably from a testbench, where many wait statements are allowed and often required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- THis code sample you have found is probably from a testbench, where many wait statements are allowed and often required. --- Quote End --- Yes you are right, the name is "tb" I look for a SPI Master programme. Thanks Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When writing code for an FPGA it's best to avoid using wait, it will make code more difficult to read, and too tempting to put several of them, making it impossible for the software to synthesize. It's better to stick with the recommended template for a clocked process:<optional_label>:
process(reset, clk) is
-- Declaration(s)
begin
if(reset = '1') then
-- Asynchronous Sequential Statement(s)
elsif(rising_edge(clk)) then
-- Synchronous Sequential Statement(s)
end if;
end process;

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page