draaknar
Newbie level 3
- Joined
- Oct 1, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 45
19 Hours Ago
Hello, i got alot of latches wich i dont know how to remove, ive tried all kind of methods to remove the latches, but i cant get anywhere. The big problem here is that i get inferring latches for data and data temp.
Note that when test is "00" (write-mode ) it will just write when we clock and the value it writes is the data_temp which is equal to data. I would be very grateful if u gave me some hints or feedback to solve this problem and make the code Synthesizable.
regards
John Schaizar
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 52 53 54 55 56 57 library ieee; use IEEE.std_logic_1164.all; use ieee.numeric_std.all; use work.assembler_code.all; use work.cpu_package.all; ENTITY RW_MEMORY IS PORT( adr : IN adress_bus; data : INOUT data_bus; clk : IN std_logic; ce : IN std_logic; -- active low rw : IN std_logic); -- read on high END ENTITY RW_MEMORY; ARCHITECTURE Behaviour OF RW_MEMORY IS type rwm_type is array(0 to 2**(adress_bus'length)-1) of std_logic_vector(3 downto 0); signal regs: rwm_type:=(others=>(others=> '0')); signal test: std_logic_vector(1 downto 0); signal data_temp: std_logic_vector(3 downto 0); begin test <= ce&rw; --This is my signal which i use for ce and rw together. process(test,data_temp) begin if test ="00" then data_temp <= data; elsif test= "01" then data <= regs(to_integer(unsigned(adr))); else data <= (others => 'Z'); data_temp <= (others => '0'); end if; end process; test1: process(clk) begin if rising_edge(clk) then if test = "00" then regs(to_integer(unsigned(adr))) <= data_temp; end if; end if; end process; end Behaviour;
Hello, i got alot of latches wich i dont know how to remove, ive tried all kind of methods to remove the latches, but i cant get anywhere. The big problem here is that i get inferring latches for data and data temp.
Note that when test is "00" (write-mode ) it will just write when we clock and the value it writes is the data_temp which is equal to data. I would be very grateful if u gave me some hints or feedback to solve this problem and make the code Synthesizable.
regards
John Schaizar
Last edited by a moderator: