RE: [vhdl-200x] FSM safe design

From: Martin.J Thompson <Martin.J.Thompson@trw.com>
Date: Fri Feb 21 2014 - 01:48:46 PST
My understanding is that the problem goes much further than just non-power-of-two state counts.

Even if you have (for example) 4 states in your state machine, the tools will (often) pick an encoding with redundant states.  Especially in FPGA-land, where one-hot encoding is popular for efficiency reasons, a 4-state FSM would have 4 flipflops, and therefore 12 "redundant" (and unpredictably behaved) states!

I agree that a well-defined standard attribute would be useful to handle this behaviour, as the two synthesisers I am familiar with (XST and Synplify) currently operate in different ways.

XST has 

  attribute safe_implementation of
      entity_name|component_name|signal_name}:entity|component|signal is "{yes|no}}";

along with 
  attribute safe_recovery_state: string; 

for when you need control over which state to "recover to". If unused, XST will include logic to return to the reset (or startup, if no reset logic is present) state if any undefined states are entered.

Synplify offers:
   attribute syn_safe_case of architectureName : architecture is TRUE;

along with separate error monitoring functionality

and
   attribute syn_fsm_correction of architectureName : architecture is "hamming3";

which provides single bit error correction.

The only overlap there is the function to provide a "safe" encoding, but the mitigation actions are also different between the tools.  

My current feeling is that an XST-like approach (where safe-encodings are produced along with a defined return to a particular state) would be a useful standardised functionality, vendors are still free to provide further attributes for more complex functions.

Cheers,
Martin

-- 
Martin Thompson BEng(Hons) MIET CEng
TRW Conekt, Stratford Road, Solihull, B90 4GW
martin.j.thompson@trw.com  +44 121 627 3569  
http://www.conekt.co.uk/

This message, together with any of its attachments, is strictly confidential and intended solely for the addressee(s).  It may contain information which is covered by legal, professional or other privilege.  If you are not the intended recipient, you must not disclose, copy or take any action in reliance of this transmission.  If you have received this message in error, please notify us as soon as possible.

TRW Limited, Registered in England, No. 872948, Registered Office Address: Stratford Road, Solihull B90 4AX

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Feb 21 01:49:02 2014

This archive was generated by hypermail 2.1.8 : Fri Feb 21 2014 - 01:49:44 PST