D
Daku
Could some VHDL guru please help ? My VHDL simulator is giving error
message as:
"multiple driver on unguarded signal `index 0`"
What would be a good way to get around this problem ? The source code
is below for reference:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
use IEEE.NUMERIC_STD.ALL;
ENTITY ram IS
port ( CEB : in std_logic;
WEB : in std_logic;
REB : in std_logic;
INN : in std_logic_vector(0 to 31);
OUTT : out std_logic_vector(0 to 31)
);
END ram;
ARCHITECTURE dataflow_view OF ram IS
CONSTANT MAX : integer := 32;
SIGNAL index : std_logic_vector (0 to 31) :=
('0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
SIGNAL cpriority : std_logic_vector (0 to 7) :=
('0','0','0','0','0','0','0','0');
SIGNAL spriority : std_logic_vector (0 to 7) :=
('0','0','0','0','0','0','0','0');
SUBTYPE TYPE_WORD IS std_logic_vector (0 to 31);
TYPE TYPE_RAM IS ARRAY(0 TO 31) OF TYPE_WORD;
SIGNAL memory : TYPE_RAM := ((OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'),
(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),
(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'));
BEGIN
RAM_0 : PROCESS( WEB )
BEGIN
IF RISING_EDGE(WEB) THEN
IF (REB='0') THEN
FOR I IN index'RANGE LOOP
IF index(I) = '0' THEN
index(I) <= '1';
cpriority <= INN(24 TO 31);
memory(I) <= INN;
EXIT;
END IF;
END LOOP;
END IF; -- REB='0'
IF (CONV_INTEGER(spriority) <
CONV_INTEGER(cpriority)) THEN
spriority <= cpriority;
END IF;
END IF; -- rising_edge
END PROCESS RAM_0;
RAM_1 : PROCESS( REB )
BEGIN
IF RISING_EDGE(REB) THEN
IF (WEB='0') THEN
FOR I IN index'RANGE LOOP
IF index(I) = '1' THEN
index(I) <= '0';
EXIT;
END IF;
END LOOP;
OUTT <= memory(I);
END IF; -- WEB='0'
END IF; -- rising
END PROCESS RAM_1;
END dataflow_view;
Any hints, suggestions would be of immense help. Thanks in advance for
your help.
message as:
"multiple driver on unguarded signal `index 0`"
What would be a good way to get around this problem ? The source code
is below for reference:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
use IEEE.NUMERIC_STD.ALL;
ENTITY ram IS
port ( CEB : in std_logic;
WEB : in std_logic;
REB : in std_logic;
INN : in std_logic_vector(0 to 31);
OUTT : out std_logic_vector(0 to 31)
);
END ram;
ARCHITECTURE dataflow_view OF ram IS
CONSTANT MAX : integer := 32;
SIGNAL index : std_logic_vector (0 to 31) :=
('0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
SIGNAL cpriority : std_logic_vector (0 to 7) :=
('0','0','0','0','0','0','0','0');
SIGNAL spriority : std_logic_vector (0 to 7) :=
('0','0','0','0','0','0','0','0');
SUBTYPE TYPE_WORD IS std_logic_vector (0 to 31);
TYPE TYPE_RAM IS ARRAY(0 TO 31) OF TYPE_WORD;
SIGNAL memory : TYPE_RAM := ((OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'), (OTHERS=>'0'),
(OTHERS=>'0'),
(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),
(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'),(OTHERS=>'0'));
BEGIN
RAM_0 : PROCESS( WEB )
BEGIN
IF RISING_EDGE(WEB) THEN
IF (REB='0') THEN
FOR I IN index'RANGE LOOP
IF index(I) = '0' THEN
index(I) <= '1';
cpriority <= INN(24 TO 31);
memory(I) <= INN;
EXIT;
END IF;
END LOOP;
END IF; -- REB='0'
IF (CONV_INTEGER(spriority) <
CONV_INTEGER(cpriority)) THEN
spriority <= cpriority;
END IF;
END IF; -- rising_edge
END PROCESS RAM_0;
RAM_1 : PROCESS( REB )
BEGIN
IF RISING_EDGE(REB) THEN
IF (WEB='0') THEN
FOR I IN index'RANGE LOOP
IF index(I) = '1' THEN
index(I) <= '0';
EXIT;
END IF;
END LOOP;
OUTT <= memory(I);
END IF; -- WEB='0'
END IF; -- rising
END PROCESS RAM_1;
END dataflow_view;
Any hints, suggestions would be of immense help. Thanks in advance for
your help.