Crazy problem with FSM in VHDL already synchronized the input signals

background:
To Let FPGA communicate with a DSP board. i am trying to send three datas from DSP board to the FPGA board. 
code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity dsp_com is port
     clock :   in std_logic;
FPGA_CLK : out std_logic;
led1: out std_logic_vector(3 downto 0) := (others => '1');
Reset: in std_logic :='Z';
    dsp_db   : inout std_logic_vector(12 downto 0) := (others =>'Z');
dsp_db_output : out std_logic_vector(12 downto 0);
dsp_db_input : in std_logic_vector(12 downto 0);
wr_en : out std_logic:='0';  -- initial state is input
FPGA_ACK : out std_logic := '0';  --default state is 0
DSP_ACK : in std_logic := 'Z'
end dsp_com;
architecture FSM_Moore of dsp_com is
TYPE State_type IS (S0, S1, S8, S9, S10, S11);  -- 12 States
signal PresentState: State_type;
signal s_DSP_ACK : std_logic ;
signal s_Reset : std_logic;
signal s_dsp_db_input : std_logic_vector(12 downto 0);
signal Adc_address : std_logic_vector(3 downto 0);
signal Adc_buffer : std_logic_vector(12 downto 0);
signal data_from_dsp1 : std_logic_vector(3 downto 0);
signal data_from_dsp2 : std_logic_vector(3 downto 0);
signal data_from_dsp3 : std_logic_vector(3 downto 0);
begin
--5k Hz signal work as FPGA_CLK
clkdsp :  process(clock)
variable count : integer range 0 to 2000 :=0;
variable n :std_logic := '0';
begin 
if rising_edge(clock) then
count := count + 1;
if(count >= 2000) then
n := not n;
FPGA_CLK <= n ;
count := 0;
end if;
end if;
end process clkdsp;
synchronous : process(clock)
begin
if rising_edge(clock)then
s_DSP_ACK <= DSP_ACK;
s_Reset <= Reset;
s_dsp_db_input <= dsp_db_input;
else
null;
end if;
 end process synchronous;
 --read the address and get the data
--first:  process(clock,s_Reset)
-- begin 
-- if (s_Reset = '0') then
-- PresentState <= S0;
--elsif rising_edge(clock) then
-- PresentState <= PresentState;
-- end if;
--   end process;
first : process(s_Reset, clock)
begin
if (s_Reset = '0') then
 PresentState <= S0;
elsif(rising_edge(clock)) then
case PresentState is
when S0 => if s_DSP_ACK = '1' then PresentState <= S1;
else PresentState <= S0; end if;
-- wr_en <= '0'; -- input
-------------------------------single read ADC------------------------------------
when S1 => 
if ((s_DSP_ACK = '0') and (s_dsp_db_input(3 downto 0) = "0100")) then PresentState <= S8;
else  PresentState <= S1;end if; 
-- wr_en <= '0'; -- input
--------------------------receive 3 datas in sequence ------------------------------------
when S8 => if s_DSP_ACK = '1' then  PresentState <= S9;
else PresentState <= S8 ; end if;
--wr_en <= '0'; -- input
when S9 => if s_DSP_ACK = '0' then  PresentState <= S10;
else PresentState <= S9 ; end if;
--wr_en <= '0'; -- input
when S10 => if s_DSP_ACK = '1' then  PresentState <= S11;
else PresentState <= S10; end if;
--wr_en <= '0'; -- input
when S11 => if s_DSP_ACK = '0' then PresentState <= S0;
else PresentState <= S11; end if;
-- wr_en <= '0';
  end case;
  end if;
end process;
-- Output depends solely on the current state
second :   process(PresentState, data_from_dsp1, data_from_dsp2, data_from_dsp3, s_dsp_db_input(3 downto 0))
--variable DATA &colon; std_logic_vector(12 downto 0);
begin 
case PresentState is
when S0 => 
FPGA_ACK <= '0';  
led1 <= "0000";
wr_en <= '0'; -- input
-----------------get the adc-buffer--------------
when S1 =>
adc_address <= s_dsp_db_input(3 downto 0);  -- get the address
FPGA_ACK <= '1';
      led1 <= "0001";
wr_en <= '0'; -- input
when S8 =>
FPGA_ACK <= '0';
led1 <= "1000";
wr_en <= '0'; -- input
when S9 =>
FPGA_ACK <= '1';
data_from_dsp1(3 downto 0) <= s_dsp_db_input(3 downto 0);
if(data_from_dsp1 = "0101")then
led1 <= "1001";
else
led1 <= "0000";
end if;
wr_en <= '0'; -- input
when S10 =>
FPGA_ACK <= '0';
data_from_dsp2(3 downto 0) <= s_dsp_db_input(3 downto 0);
if(data_from_dsp2 ="0111")then
led1 <= "1010";
else
led1 <= "0000";
end if;
wr_en <= '0'; -- input
when S11 =>
FPGA_ACK <= '1';
data_from_dsp3(3 downto 0) <= s_dsp_db_input(3 downto 0);
if(data_from_dsp3 ="1000")then
led1 <= "1011";
else
led1 <= "0000";
end if;
wr_en <= '0'; -- input
end case;
end process;
end FSM_Moore ;
i have already synchronize the input signals e.g. dsp_ack, and db_input to the FSM. this is the most frequency problem that cause FSM runs misbehavior
Issue:
Issues:
when i debug the c program in DSP board and FPGA, every thing is ok ! FSM can switch to the next state according to the DSP_ACK. 
but if i let the program run. i saw the state is alway stuck at S0 in FPGA, but for the DSP side, the code are still running.
anyone has any ideas to this problem?
appreciate for you guys' reply !
regard,
napon

As a bit of a guess with the limited detail you provided on your overall control mechanism I would say you are missing  s_DSP_ACK = 1 when you allow the code to execute at full speed.
What is the period of your FPGA clock vs the minimum  s_DSP_ACK = 1 length? I would just probe this up using CS.. Pretty simple to figure out where it is going wrong then.

Similar Messages

  • Is it somebody Except for me Who has problems With waching videos on ipad after the 5.0.1 update

    Is it somebody Except for me Who has problems With waching videos on ipad after the 5.0.1 update

    Hi,
    yes I have big problems as soon as I open the video app i get a total black screen, even the upper bar with the time disappears. I already tried to:
    1. closing the app and reopen it
    2. restart the iPad
    3. restore the iPad via iTunes
    4. Begging the app to work again.

  • There is a problem with this connection's security certificate The remote computer cannot be authenticated due to problems with its security certificate. Security certificate problems might indicate an attempt to fool you or intercept any data you send

    Hi,
    I have this Windows 2008 R2 on which I installed remoteapp some years ago.
    Now the certificate expired and I get the message
    "There is a problem with this connection's security certificate
    The remote computer cannot be authenticated due to problems with its security certificate.
    Security certificate problems might indicate an attempt to fool you or intercept any data you send to the remote computer."
    How should I renew the certificate? I already went to certification store and tried to renew certificate with same key but then it says "the request contains nor certificate template information".
    Please advise.
    J.
    J.
    Jan Hoedt

    Does the computer account have Enroll permission to the certificate template?
    From the Server running your CA, run mmc, click File then Add/Remove Snap-in...
    Add Certificate Templates and click OK.
    Find the certificate template, then right click and select properties.  On my CA its call ed RemoteDesktopComputers but might be called something different depending on what what template your certificate is based on.
    On the security tab, click Oblect types, check Computers then OK. Enter the Computername and click OK.  Then give your computer account Enroll permisssion.
    HTH,
    JB

  • Problems with seeing photos while working on the Ken Burns Effect

    I am having difficulty seeing my photos when I use the Ken Burns Effect. All I get is a black screen. It won't let me adjust anything on the photos because the screen is black. Please Help

    So I have kind of the same issue here but it is slightly different. I tried all of the tricks that have been posted here but I am getting the black screen on brand new pictures that are imported both with and without the ken burns effect on them. I don't seem to have the problems on pictures that are already in the video with/without the KB effect.
    I have also tried to do it under another user account, downgraded iMovie HD 6 from 6.0.3 down to 6.0 and 6.0.2 and nothing seems to help. I have even removed the plists on both ~/Library/Preferences/com.apple.iMovie.plist along with anything in /Library/Preferences having to do with iMovie without any success. The only solution that I am resorting to is to just use a different computer all together or format the drive on my computer.
    Any solutions? I have a video that needs to be down by the end of next week...

  • Have a  problem with Lightroom 5.4.  Since the program crashed yesterday it won't launch, it comes up with the message "Lightroom encountered an error when reading its preview cache and needs to quit".  "  Lightroom will attempt to fix this problem net ti

    Have a  problem with Lightroom 5.4.  Since the program crashed yesterday it won't launch, it comes up with the message "Lightroom encountered an error when reading its preview cache and needs to quit".  "  Lightroom will attempt to fix this problem next time it launches".  Except that it doesn't, I keep getting the same message and the program closes.  Does anyone know what I  can do to repair it?  Can't back up, can't do anything.

    There are dozens of threads in this forum that describe the fix

  • HT1871 Hello i have one IPhone 4S and I use 3G net in my mobile sometime I have problem with temperature in my phone at the SIM card or battery how can I fix this problem. By update or version of 6.1.3

    Hello i have one IPhone 4S and I use 3G net in my mobile sometime I have problem with temperature in my phone at the SIM card or battery how can I fix this problem. By update or version of 6.1.3

    Could it be because the SIM card got damaged while I cut it to fit the IPhone?
    Very likely. Hard to believe the carrier in Mexico doesn't have a micro-SIM card available.
    Or somehow the Chinese carrier found out and locked it?
    No, which is not possible.
    What can I do? Get a new SIM and see if it works again?
    Get a micro-SIM from the carrier in Mexico that you don't have to manually cut down. If that carrier doesn't provide one, switch to another carrier that is not so low-budget.

  • I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    http://www.apple.com/support/itunes/contact/

  • Ive downloaded some apps onto my pc yet only 1 has synced to my ipad, it says something about theres a problem with my billing, yet I purchased the 1 app I got for $20, but 1 free app and another paid, wont sync, i di have money in my account

    Ive downloaded some apps onto my pc yet only 1 has synced to my ipad, it says something about theres a problem with my billing, yet I purchased the 1 app I got for $20, but 1 free app and another paid, wont sync, i di have money in my account

    Right click on your iPad's name in the iTunes app on your computer and choose to transfer purchases. That should transfer anything that you have bought with the App Store app on the iPad to the iTunes app on your computer.

  • Hi i have a problem with my iphone 3gs. i updated the software to ios 6 but now when trying to activate the phone it comes up with a message saying that the activation server is currently unavailable, also it always says no sim! what can i do?

    i have an activation problem with my iphone 3gs. i updated the software to io6 using itunes but now the phone will not complete activation because it keeps saydin the activation server is not available and to re try later. ive been trying for 6 hours but it still wont activate. if i try using itunes then it sayd no sim inserted when there is one inserted, what can i do?

    You are right, but how could i send it to Apple? when the phone company first replaced my iphone they had in stock alots of iphones and they just sent mine back to Apple and gave me a new one, so all i did is to give them my phone, but now how could i sent it to Apple? and i cant send it by myself, and the store wont do that, its a lost for them.. so sending it to Apple wasnt an option from the begining.
    and for the record, i dont think the store where i bought it is an authorized shop.. its just a store who boughts phone's from Apple in a low price and sells it in much more money..

  • I have a problem with my iPhone 5 stopped working the sleep / power and simultaneously refused to obey the HOME button. I can not use either one or the other. I can not enable or disable the device, display lights up when you plug the charger. same displa

    I have a problem with my iPhone 5 stopped working the sleep / power and simultaneously refused to obey the HOME button. I can not use either one or the other. I can not enable or disable the device, display lights up when you plug the charger. same display works fine as it is surprising. or maybe someone knows what is the reason for this? is there any way to solve this problem?

    More than likely its a hardware issue, I have never encountered such a problem and best bet is to just go get it replaced. If you have insurance on your device apple will replace it as long as there was no water damage, if you dont have insurance they will charge $200 more or less. Hope you get it fixed

  • TS1702 I had this Scrabble on my iPad2 and began to have connection problems, it would lock in the "connecting" position. This is not the first time Scrabble has had problems with interface. Typically customers delete the Ap then download it again to rein

    I have contacted EA about this and can find no help. I had this Scrabble on my iPad2 and began to have connection problems, it would lock in the "connecting" position. This is not the first time Scrabble has had problems with interface. Typically customers delete the Ap then download it again to reinstall it. During the process you sign in and approve the purchase KNOWING that another window will open saying that you have previously purchased it and that there is no charge. So what happened this time? It will not connect and all of my saved and current games are wiped out. I want my money back, this game interface is pretty junk and operates like some ancient DOS program,,bug,bug,buggy. I want my money back.

    Go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • I bought a new MacBook Pro several months ago.  I keep losing my wireless connection (my wife, sitting several feet from me has no problem with her iPad2).  I find the quickest fix ix to turn Airport off and back on.  Very annoying.   Suggestions please?

    I bought a new MacBook Pro several months ago.  I keep losing my wireless connection (my wife, sitting several feet from me has no problem with her iPad2).  I find the quickest fix ix to turn Airport off and back on.  Very annoying.   Suggestions please?

    What kind of wireless router are you using? more importantly which protocol are you connecting with? Are you and wife connecting using the 2.4Ghz band? or do you have a dual band router that offers the 5GHZ band?  Are you both connecting vie 802.11 a/b/g or n?
    The best thing to do is to go into SYSTEM PREFERENCES and select NETWORK, then select AIRPORT and click on the ADVANCED button.
    Under the AirPort tab you should delete all the preferred networks and only add back in your network with the proper security settings and passwords.
    If you hold down the option key on your keyboard while clicking on the airport icon at the top on your macbook pro. you'll seesome data that will tell you what band and mode you're connecting at, as well as in an indication of signal strength (RSSI) if you write down and post back that information it'll tell us what's going on.

  • I have a problem with my iphone5. I don't have signal, but I can check my email, facebook... The operator is identified but I can't call

    I have a problem with my iphone5. I don't have signal, but I can check my email, facebook... The operator is identified but I can't call

    You probably don't need to do that.
    How to Remove MacKeeper or use the Uninstall option in MacKeeper.
    To erase and reinstall:
    Install or Reinstall Lion/Mountain Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Erase the hard drive:
      1. Select Disk Utility from the main menu and click on the Continue button.
      2. After DU loads select your startup volume (usually Macintosh HD) from the
          left side list. Click on the Erase tab in the DU main window.
      3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on
            the Security button and set the Zero Data option to one-pass. Click on
          the Erase button and wait until the process has completed.
      4. Quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Install button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

  • I have a problem with my PC mobile device that the keyboard stop working and the mouse also

    I have a problem with my PC mobile device that the keyboard stop working and the mouse also

    All I can suggeset is:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    or
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Have you looked at the AMDS topic of:
    iOS: Device not recognized in iTunes for Windows
    Do you have han image capture programs linstalled like for a camers or scanner?

  • After installed mavericks i cannot sign in to my facetime and i messages. i tried it 100 times, but it is showing couldn't sign in check your network and try again. there is no problem with my network. if anyone knows the solution please help me .

    After installed mavericks i cannot sign in to my facetime and i messages. i tried it 100 times, but it is showing couldn't sign in check your network and try again. there is no problem with my network. if anyone knows the solution please help me .

    Hi,
    What version of the OS did you upgrade from ?
    Anything before OS X 10.8.2 may have an issue if the Logic/Mother board has been replaced and the Serial Number not "flashed" back to it.
    In the Apple Icon menu use the About this Mac item.
    In the new panel click twice on the line that tells you the current OS level
    It will change to the Build number (and alternative count to the OS versions) and then the Serial Number.
    If it is missing you need to get it replaced.
    (It is supposed to be done on Repair or Refurbishment).
    An Apple Store or Apple Authorised Service Provider as the best choices.
    There are apps you can download (They are Mac Model specific) but needs careful typing as it is a once only trip.
    8:56 pm      Sunday; November 24, 2013
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    Message was edited by: Ralph Johns (UK)

Maybe you are looking for

  • Oracle report 'XML Report Publisher' error 2 step process

    We're getting error 'Invalid UTF8 encoding' when running the above report. This is a second step of the two step process when creating XML output in Oracle Apps. The first step is report 'PO Output for Communication'. This one error out with the foll

  • Quality of service

    I had internet services with verizon when i lived in new york and i absolutely loved it. The service was the best, the customer service was excellent. Now that I have moved to the Atlanta metro area there is no available coverage from you in this are

  • Trouble synching movies to new iPad

    I recently migrated my Itunes library to an external drive. I can connect to it from either my iMac (to which it is tethered) or MacBook Pro via my wireless router (Time Capsulte). So far good. I only open one library at a time, which I understand is

  • Best format for pics thats compatable with PE3

    I'm scannig in some photos and stuff for a project and wondering what is th best format to save the pictures as. This scanner offers several different formats, jpeg, bitmap, tiff, just to name a few. Alot of the stuff is old newspaper clippings so pi

  • What is the T-code for Viewing the Payment Advices....

    Hi, What is the T-code for Viewing the Payment Advices.... Regards Sap Guru