- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I faced some problem when I trying to compile my following code. The error replied was only one wait statement is allowed in the process. I have tried putting IF statement but it took 10,000 iterations. May I know how can i change my code? Main : process variable counter : counter_type := 0; begin -- HWY green, SRD red wait on (CLOCK until CLOCK = '1' and SRDcar = '1'); if (HWYcar = '1') then Counter := 0; loop wait until CLOCK = '1'; exit when (HWYcar = '0' or Counter = long_cycle); Counter := Counter + 1; end loop; end if ; Thank you so muchLink Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Main : process
variable counter : counter_type := 0; begin if rising_edge(CLOCK) then if SRDcar = '1' then if HWYcar = '1' then counter := 0; elsif counter = long_cycle then null; else counter := counter + 1; end if; end if; end if; end process; I think this should be something like what you want. Ben- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you ben. but the error return now is rising_edge is used but not declared. sorry for bothering. I'm very very new this software.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you included the std_logic_1164 library because that is where the rising_edge function is declared.
use ieee.std_logic_1164.all;- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yup... i included that...
library ieee; use ieee.std_logic_1164.all; was trying to figure this out for the past 2 days...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can replace "if rising_edge(CLOCK) then" with "if CLOCK'event and CLOCK = '1' then" or you open the std_logic_1164 library and check that the rising_edge function is in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you so much for yr help mate. good luck :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I'm very very new this software. --- Quote End --- You might benefit from references suggested at http://www.alteraforum.com/forum/showthread.php?t=1025. Start with the coding style guidelines in the Quartus handbook and the examples in the Quartus text editor templates.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page