[Edited]I'm working on a DMA controller model now and I'm writing 3 processes to work in parallel with the same clock, The two main processes access the same registers but I've made sure that they will never conflict using "if" cases to check for certain values, the first case to clear the data of the registers using "clr" signal the problem here is that the values are always "xxxx" and the If condition in the second process there is always true [edit : the signal 'x' is used to determine whether the if condition is true or false, the output on the waveform is '1' which means that this condition is not the one which make a conflict for data_out , although data_out is still X's , So what's making the conflict ?
library ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
USE ieee.numeric_std.ALL;
ENTITY DMAC_CHANNEL_REG_BANK IS
port(
clr : IN STD_LOGIC; -- async. clear.
clk : IN STD_LOGIC; -- clock.
-- Slave Signals
HRData : OUT STD_LOGIC_vector(31 downto 0); -- Data to be READ by the AHB SLAVE INTERFACE
HWData : in std_logic_vector(31 DOWNTO 0); -- data to be written in the REGISTER from the AHB SLAVE INTERFACE
HAddr : in std_logic_vector(9 downto 0); -- Address for the Register to be programmed -- from AHB SLAVE INTERFACE
);
END DMAC_CHANNEL_REG_BANK;
ARCHITECTURE description OF DMAC_CHANNEL_REG_BANK IS
Component Register32 is
PORT(
input : IN STD_LOGIC_VECTOR(31 DOWNTO 0); -- input.
enable : IN STD_LOGIC; -- Write/enable.
clr : IN STD_LOGIC; -- async. clear.
clk : IN STD_LOGIC; -- clock.
output : OUT STD_LOGIC_vector(31 downto 0)
); -- end of port
end component;
type Arr40x32 is array (39 downto 0) of std_logic_vector(31 downto 0);
signal data_out : Arr40x32;
signal data_in : STD_LOGIC_vector(31 downto 0);
type State_type_logic is (IDLELOGIC);
signal PresentStateLOGIC, NextStateLOGIC : State_type_logic := IDLELOGIC;
signal C0Config: std_logic_vector(31 downto 0);
signal x : std_logic := '0';
BEGIN
--CHANNEL 0 REGISTERS--
DMACC0_SRCADD : Register32 port map (data_in,channel_enable(0),clr,clk,data_out(0));
DMACC0_Config : Register32 port map (data_in,channel_enable(1),clr,clk,data_out(1));
Logic : process (clk,PresentStateLogic,DMAC_ENABLE)
begin
case PresentStateLogic is
when IDLELOGIC =>
C0Config <= data_out(1);
--- Cleaning data of the inactive channels
if C0CONFIG(0) = '0' and C0CONFIG(17) = '0' and C0CONFIG(18) = '0' and PresentStateREG /= WRITE1 and clr /= '0' then -- checking for Enable , Halt , and Active
data_out(0) <= x"00000000";
else
x <= '1';
end if;
end case;
end process Logic ;
process (clk)
begin
if (rising_edge(clk)) then
PresentStateREG <= NextStateREG;
PresentStateLogic <= NextStateLogic;
end if;
end process;
END description;