LatticeSemiconductor
Member level 2
- Joined
- Aug 31, 2013
- Messages
- 45
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 589
Hi,
i have a bunch of signals generated from a FSM. I want to use those to trigger certain operations, so i did the following:
and
those are my solutions and both are working quite well. I wonder however if that is the correct way to code, or if there are any techniques i could / should apply in those cases. Can i use any signal for a rising_edge? var is not a clock signal with very irregular transitions, though it's synchronous with 'CLK'. Could this cause timing problems?
i have a bunch of signals generated from a FSM. I want to use those to trigger certain operations, so i did the following:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 signal var : std_logic; -- output from FSM process (var) begin if rising_edge(var) then cnt <= cnt + 1; end if; end process;
and
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 process( CLK, RST, var ) begin if RST = '1' then CLK_SIG <= '0'; VAR_PREV <= '0'; elsif rising_edge (CLK) then VAR_PREV <= var; if VAR_PREV /= var then CLK_SIG <= not CLK_SIG; end if; end if ; end process ; process (CLK_SIG) begin if rising_edge (CLK_SIG) then cnt <= cnt + 1; end if; end process;
those are my solutions and both are working quite well. I wonder however if that is the correct way to code, or if there are any techniques i could / should apply in those cases. Can i use any signal for a rising_edge? var is not a clock signal with very irregular transitions, though it's synchronous with 'CLK'. Could this cause timing problems?
Last edited: