hardware - Persisting an output in comb logic block -
i'm having issue persisting value of gpo. want change @ point in code below.
gpo_int <= gpo_int when n_wr = '1'; gpo <= gpo_int; write : process(n_en, n_wr) begin if n_wr = '0' , n_en='0' case addr(15 downto 12) when x"f" => -- i/o case addr(11 downto 8) when x"0" => -- gpo gpo_int <= data; when others => gpo_int <= gpo_int; end case; when others => gpo_int <= gpo_int; end case; end if; end process;
gpo_int signal of std_logic_vector(7 downto 0) := x"00";
firstly gpo_int not persisted (i can see gpo change x"00" when n_rw goes '1'. there way of doing more neatly (defining truth table comb logic)?
it seems asking latch. in fpgas particularly, that's not right thing (for variety of reasons).
can not use clocked process create persistence need using flipflop?
process (clk) begin if rising_edge(clk) if n_wr = '0' , n_en ='0' , addr(11 downto 8) = x"f0" gpo_int <= data; end if; end if; end process; gpo <= gpo_int;
Comments
Post a Comment