![]() |
|
|
|||||||
![]() |
VHDL - Do I have a race condition for clk33_div? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I am looking to determine if the following VHDL process block creates
a race condition for clk33_div, given that it is a signal that is being updated seemingly at same time it is being evaluated if I understand VHDL constructs. Any thoughts or guidelines would be greatly appreciated. Regards, Tim Doyle Here is the code: CLOCK_DIV: process (clk33, resetn) begin if resetn = '0' then clk33_div <= (others =>'0'); clock_out <= '0'; elsif clk33'event and clk33 = '1' then if clk33_div = "11000" then clk33_div <= (others => '0'); clock_out <= not(clock_out); else clk33_div <= clk33_div + '1'; clock_out <= clock_out; end if; end if; end process; Tim Doyle |
|
|
|
|
#2 |
|
Posts: n/a
|
On Jun 12, 8:29*am, Tim Doyle <tim9doy...@gmail.com> wrote:
> I am looking to determine if the following VHDL process block creates > a race condition for clk33_div, given that it is a signal that is > being updated seemingly at same time it is being evaluated if I > understand VHDL constructs. > > Any thoughts or guidelines would be greatly appreciated. > > Regards, > > Tim Doyle > > Here is the code: > > CLOCK_DIV: process (clk33, resetn) > * * * * begin > * * * * * * * * if resetn = '0' then > * * * * * * * * * * * * clk33_div <= (others =>'0'); > * * * * * * * * * * * * clock_out <= '0'; > * * * * * * * * elsif clk33'event and clk33 = '1' then > * * * * * * * * * * * * if clk33_div = "11000" then > * * * * * * * * * * * * * * * * clk33_div <= (others => '0'); > * * * * * * * * * * * * * * * * clock_out <= not(clock_out); > * * * * * * * * * * * * else > * * * * * * * * * * * * * * * * clk33_div <= clk33_div + '1'; > * * * * * * * * * * * * * * * * clock_out <= clock_out; > * * * * * * * * * * * * end if; > * * * * * * * * end if; > * * * * end process; Hi Tim, In VHDL, a signal is not assigned its new value until you reach the "end process" statement (or a wait statement). This is different from the behavior of a variable in a process. Barry Barry |
|
|
|
#3 |
|
Posts: n/a
|
> On Jun 12, 8:29 am, Tim Doyle <tim9doy...@gmail.com> wrote: >> I am looking to determine if the following VHDL process block creates >> a race condition for clk33_div, given that it is a signal that is >> being updated seemingly at same time it is being evaluated As long as I use clk33 as the only clock and clk_div as an enable input for other logic on the same clock, there will be no timing problems. Think of the right side of an assignment as gates on the D side of the flop Barry wrote: > In VHDL, a signal is not assigned its new value until you reach the > "end process" statement Which happens once every clock tick in Tim's example. The code looks functional to me. clock_out <= clock_out; is not necessary. -- Mike Treseler Mike Treseler |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Any tips to keep DVD player in good condition. | Karan Lobana | DVD Video | 1 | 09-13-2005 09:43 AM |
| Re: Condition | Jay Santos | DVD Video | 0 | 12-23-2004 07:28 PM |
| Lot of 44 Used DVD Titles - MINT condition | Sean McLean | DVD Video | 0 | 02-03-2004 09:46 AM |
| FS: Alien Legacy Region 1 Box Set - Mint Condition - Bargain! | WORX A4 | DVD Video | 0 | 01-22-2004 08:57 AM |
| FS: Certification books (A+, Network +). New condition. | Skywarner | A+ Certification | 1 | 01-02-2004 10:03 PM |