nesta
Junior Member level 2
- Joined
- Feb 19, 2010
- Messages
- 20
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,283
- Activity points
- 1,466
latch your <ready_conditions> in a flip-flop,
say ready_reg;
then assign the ready signal as:
<ready_conditions> TRUE and ready_reg FALSE;
this should generate one clock cycle pulse
---
J.A
process (clk)
begin
if rising_edge(clk) then
rdy_reg(2 downto 0) <= rdy_reg(1 downto 0) & rdy
if rdy_reg(2 downto 1) = "01" then -- positive edge detected
--- do some processing;
end if;
end if;
end process;
/.../
input rdy;
reg rdy_reg; // flip-flop to store rdy value
always @(posedge clk)
rdy_reg <= rdy; // clocked process in vhdl
wire ready = (rdy && !rdy_reg); // rdy HIGH and rdy_reg LOW
// one cycle pulse when rdy changes from 'L' to 'H'
if ( ready == 1'b1 )
< do some processing >
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ------------------------------------------------------------------ ----- -- FileName: flancter.vhd -- Author: Rob Weinstein ----------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; entity flancter is port ( ASYNC_RESET:in std_logic; SET_CLK :in std_logic; SET_CE :in std_logic; RESET_CLK :in std_logic; RESET_CE :in std_logic; FLAG_OUT :out std_logic); end flancter; architecture flancter of flancter is signal SetFlop: std_logic; signal RstFlop: std_logic; begin --The Set flip-flop set_proc:process(ASYNC_RESET, SET_CLK) begin if ASYNC_RESET = '1' then SetFlop <= '0'; elsif rising_edge(SET_CLK) then if SET_CE = '1' then -- Flops get opposite logic levels. SetFlop <= not RstFlop; end if; end if; end process; --The Reset flip-flop reset_proc:process(ASYNC_RESET, RESET_CLK) begin if ASYNC_RESET = '1' then RstFlop <= '0'; elsif rising_edge(RESET_CLK) then if RESET_CE = '1' then -- Flops get the same logic levels. RstFlop <= SetFlop; end if; end if; end process; FLAG_OUT <= SetFlop xor RstFlop; end flancter;
Sorry for not being very /.../
data = ____(-----)(invalid data)_(invalid data)~___(xxxx)____(-----)_____
ready = ____|--|____________~__________________________|--|______
My problem is i know how to make ready go high but am unable to pull it low which causes ready to be high forever.
ready = _____|--------------------------------------- ( high always)
This is my main issue.
Looks like you are exactly copying the non-working code from the original post.I try to guess what you need, possible I guess wrong
but may be this example helps ?
The only suggested "change" is an empty asynchronous reset condition. Do you really mean, that it will change anything? It doesn't. All errors in the original code are kept.just make these changes in your code
Looks like you are exactly copying the non-working code from the original post.
The only suggested "change" is an empty asynchronous reset condition. Do you really mean, that it will change anything? It doesn't. All errors in the original code are kept.
I try to guess what you need, possible I guess wrong
but may be this example helps ?
just make these changes
you better compile it yourself first then talk. And yes, till now my codes are working perfectly using this condition. And Who said its a Asynchronous Reset, did I mentioned that?? I just initialized signal with name 'rst', it dosent mean its a reset signal.
Code VHDL - [expand] 1 2 3 4 5 6 if rst='1' then (dont write anything here) elsif (clk ='1' and clk'event) then if (rdy = '1') then --- do some processing; rdy <= '0';
You should read the complete code first.
Code VHDL - [expand] 1 2 3 4 5 6 if rst='1' then (dont write anything here) elsif (clk ='1' and clk'event) then if (rdy = '1') then --- do some processing; rdy <= '0';
It looks like a typical asynchronous reset code, you just haven't written any code in it.
How do you expect it to work when you assign a value to the input rdy <= '0';
Alex
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?