M
Matt Clement
Guest
Hey Guys/Gals,
I have a design that needs 32 outputs to be started or asynchronously set to
high right after power up. I also have two clocked state machine processes
which run and act on those 32 outputs. I have tried just about everything I
can think of to get it to work. The closest I got was going to a dummy
state initially and setting them to high, but this of course requires a
clock prior to setting them high. I would like to set them high without
having to wait for a clock pulse. Here is a section of how I tried to use a
reset to set them to one and then output a 1 on the reset to ensure I dont
satisfy that condition again....doesnt work :-(
Please let me know if you see something I am missing. I tried to use the
STATE signal to do a conditional statement to set them while in S37 and that
did not work either.
ENTITY HALF_CLONE IS
PORT
(CLK : IN STD_LOGIC;
SEL : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
ADD : IN STD_LOGIC_VECTOR(5 DOWNTO 1);
DAT : OUT STD_LOGIC;
LED1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
BUTTONS : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
RESET : INOUT STD_LOGIC
);
END HALF_CLONE;
ARCHITECTURE ONE OF HALF_CLONE IS
TYPE STATE_TYPE IS
(S37,IDLE,S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S38,S39);
SIGNAL STATE1: STATE_TYPE;
SIGNAL STATE: STATE_TYPE;
SIGNAL TEMP : STD_LOGIC_VECTOR(31 DOWNTO 0);
BEGIN
PROCESS (clk, ADD)
VARIABLE DATA : STD_LOGIC_VECTOR(32 DOWNTO 0); --was 35
BEGIN
IF (RESET = '0') THEN --also tried IF (STATE = S37) THEN
LED1<="11111111111111111111111111111111";
--STATE<=IDLE;
ELSIF (CLK'EVENT AND CLK = '1') THEN
CASE STATE IS
WHEN IDLE =>
IF SEL(7 downto 2) = (ADD(5 DOWNTO 1) & '1') THEN
--DATA(35):=SEL(1);
STATE<=S0;
ELSE
STATE<=IDLE;
END IF;
........and so forth.
I have a design that needs 32 outputs to be started or asynchronously set to
high right after power up. I also have two clocked state machine processes
which run and act on those 32 outputs. I have tried just about everything I
can think of to get it to work. The closest I got was going to a dummy
state initially and setting them to high, but this of course requires a
clock prior to setting them high. I would like to set them high without
having to wait for a clock pulse. Here is a section of how I tried to use a
reset to set them to one and then output a 1 on the reset to ensure I dont
satisfy that condition again....doesnt work :-(
Please let me know if you see something I am missing. I tried to use the
STATE signal to do a conditional statement to set them while in S37 and that
did not work either.
ENTITY HALF_CLONE IS
PORT
(CLK : IN STD_LOGIC;
SEL : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
ADD : IN STD_LOGIC_VECTOR(5 DOWNTO 1);
DAT : OUT STD_LOGIC;
LED1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
BUTTONS : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
RESET : INOUT STD_LOGIC
);
END HALF_CLONE;
ARCHITECTURE ONE OF HALF_CLONE IS
TYPE STATE_TYPE IS
(S37,IDLE,S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S38,S39);
SIGNAL STATE1: STATE_TYPE;
SIGNAL STATE: STATE_TYPE;
SIGNAL TEMP : STD_LOGIC_VECTOR(31 DOWNTO 0);
BEGIN
PROCESS (clk, ADD)
VARIABLE DATA : STD_LOGIC_VECTOR(32 DOWNTO 0); --was 35
BEGIN
IF (RESET = '0') THEN --also tried IF (STATE = S37) THEN
LED1<="11111111111111111111111111111111";
--STATE<=IDLE;
ELSIF (CLK'EVENT AND CLK = '1') THEN
CASE STATE IS
WHEN IDLE =>
IF SEL(7 downto 2) = (ADD(5 DOWNTO 1) & '1') THEN
--DATA(35):=SEL(1);
STATE<=S0;
ELSE
STATE<=IDLE;
END IF;
........and so forth.