J
john
Guest
Hello,
I am having communication problems between two processes. I am getting
data from the USB and I am getting it to the
data bus of the SRAM.I write correct data to the SRAM, if I do not
check the status of "Flag1" but if I insert "Flag1"into
the process then I get garbage data from the SRAM and it screws up the
writing to the SRAM.
Please Advice!
Thanks
john
Process ( State1 )
Begin
Case State1 is
When 0 =>
Flag1 <= '0';
Data_Bus ( 7 downto 0) <=USB_Data ( 7 downto 0);
nextstate1 <= 1 ;
When 1 =>
Flag1 <= '1';
Data_Bus ( 13 downto 8) <=USB_Data ( 5 downto 0);
nextstate1 <= 0 ;
When others =>
nextstate1 <= 0 ;
End Case;
End Process;
-- USB PROCESS
Process ( USB_CLK)
Begin
If (USB_CLK 'event And USB_CLK='1' ) Then
State1 <= nextstate1;
End If;
End Process;
-- DPR FSM#2
Process ( State2 , Flag1 )
Begin
Case State2 is
When G0=>
If (Flag1 ='1') Then
inc <='1';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G1;
Else
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G0;
End If;
When G1 =>
inc <='0';
UBL <='0';
LBL <='0';
Read_write <='0';
nextstate2 <=G2;
When G2 =>
If (Flag1 ='0') Then
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G0;
Else
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G2;
End If;
When others =>
nextstate2 <=G0;
End case;
End Process;
--DPR Process
Process ( DPR_CLK , State, nextstate )
Begin
If ( DPR_CLK 'event And DPR_CLK='1') Then
State <= nextstate;
State2 <= nextstate2;
End If;
End Process;
I am having communication problems between two processes. I am getting
data from the USB and I am getting it to the
data bus of the SRAM.I write correct data to the SRAM, if I do not
check the status of "Flag1" but if I insert "Flag1"into
the process then I get garbage data from the SRAM and it screws up the
writing to the SRAM.
Please Advice!
Thanks
john
Process ( State1 )
Begin
Case State1 is
When 0 =>
Flag1 <= '0';
Data_Bus ( 7 downto 0) <=USB_Data ( 7 downto 0);
nextstate1 <= 1 ;
When 1 =>
Flag1 <= '1';
Data_Bus ( 13 downto 8) <=USB_Data ( 5 downto 0);
nextstate1 <= 0 ;
When others =>
nextstate1 <= 0 ;
End Case;
End Process;
-- USB PROCESS
Process ( USB_CLK)
Begin
If (USB_CLK 'event And USB_CLK='1' ) Then
State1 <= nextstate1;
End If;
End Process;
-- DPR FSM#2
Process ( State2 , Flag1 )
Begin
Case State2 is
When G0=>
If (Flag1 ='1') Then
inc <='1';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G1;
Else
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G0;
End If;
When G1 =>
inc <='0';
UBL <='0';
LBL <='0';
Read_write <='0';
nextstate2 <=G2;
When G2 =>
If (Flag1 ='0') Then
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G0;
Else
inc <='0';
UBL <='1';
LBL <='1';
Read_write <='0';
nextstate2 <=G2;
End If;
When others =>
nextstate2 <=G0;
End case;
End Process;
--DPR Process
Process ( DPR_CLK , State, nextstate )
Begin
If ( DPR_CLK 'event And DPR_CLK='1') Then
State <= nextstate;
State2 <= nextstate2;
End If;
End Process;