Abstract:
A system for synchronizing the operation of a circuit with a control signal includes synchronization flip-flops operating in cascade for receiving a control signal to be synchronized and providing a corresponding control signal synchronized with a clock signal, and a circuit including a finite state machine for receiving the clock signal having state flip-flops for storing the current state of the finite state machine, wherein a last synchronization flip-flop includes one of the state flip-flops.

Description:
RELATED APPLICATION 
       [0001]    The present application claims priority of Italian Patent Application No. TO2010A000194 filed Mar. 15, 2010, which is incorporated herein in its entirety by this reference. 
       BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    The present disclosure relates to techniques for synchronizing operation of a circuit with a control signal. 
         [0004]    The disclosure has been developed in view of the possible use for optimizing the latency of a synchronization system comprising a plurality of flip-flops. 
         [0005]    2. Description of the Relevant Art 
         [0006]    Complex electronic systems frequently envisage various hardware subsystems that operate in a concurrent way, each of which has a dedicated timing clock. In general, said clocks may not be correlated to one another; whence the term “concurrent asynchronous systems”. 
         [0007]    There may, however, arise the need of linking the behaviour of any of these subsystems to the state of any other subsystem, in general of co-ordinating the evolution and the interaction of said processes so as to provide a perfectly predictable global behaviour. 
         [0008]    It is thus necessary to tackle the problem of how to convey the information of synchronization from one clock domain to the other preventing said information from being erroneously interpreted. For this reason synchronization protocols are used, for example synchronization protocols of the “VALID” or “VALID/ACK” type, according to whether said communication is of a unidirectional type or of a bidirectional type. 
         [0009]    For instance,  FIG. 1  shows an example of a unidirectional synchronization, in which a system represented by a finite-state machine (FSM) FSM 1  receives a control signal sync through a synchronization circuit  20 . 
         [0010]    For example, the circuit  20  may comprise a chain of registers (for example, flip-flops), in which the registers are driven with the clock signal CLK 1  of the receiving system FSM 1 . In the example considered, the circuit  20  comprises two flip-flops  20   a  and  20   b  connected in series. 
         [0011]      FIG. 2  shows, instead, an example of a bidirectional synchronization, in which two systems FSM 1  and FSM 2  exchange control signals through respective synchronization circuits. 
         [0012]    In the example shown, the circuit FSM 2  transmits to the circuit FSM 1  through a synchronization circuit  20  a control signal VALID. In substantially the same way, the circuit FSM 1  transmits to the circuit FSM 2  through a synchronization circuit  22  a control signal ACK. This type of communication can be used, for example, to acknowledge proper reception of the signal VALID. 
         [0013]    The number of flip-flops can be determined, for example, by the ratio between the operating frequency of the receiving system and the setup time of the particular type of flip-flop used so as to guarantee a complete immunity from the so-called phenomenon of metastability, which is typical in the case of signals that traverse different clock domains. 
         [0014]    A “complete synchronization” of the above sort hence guarantees a unique determination of the value of the signal received, which may thus be used by the receiving machine. 
       SUMMARY OF THE INVENTION 
       [0015]    The object of the invention is to reduce as much as possible the latency in the communication between two clock domains. 
         [0016]    In fact, the inventors have noted that it is possible to reduce by one the number of flip-flops that must form part of the synchronization chain. In particular, the inventors have noted that it is possible to exploit one of the flip-flops used for encoding the current state of a finite-state machine as synchronization flip-flop, still obtaining a “complete synchronization”. 
         [0017]    With a view to achieving the aforesaid purpose, the subject of the invention is a system for synchronizing operation of a circuit with a control signal having the characteristics as specified: a system for synchronizing the operation of a circuit with a control signal comprising: a plurality of synchronization flip-flops operating in cascade for receiving as input a control signal to be synchronized and providing as output a corresponding control signal synchronized with a clock signal; and a circuit comprising a finite state machine cadenced with said clock signal having a plurality of state flip-flops for storing the current state of said finite state machine, and having at least one first state, wherein said finite state machine is configured for: remaining in said first state codified with a first bit sequence if said synchronized control signal has a first logic value, proceeding to a second state codified with a second bit sequence if said synchronized control signal has a second logic value, wherein said first bit sequence and said second bit sequence differ by the value of a single bit, and wherein a last synchronization flip-flop comprises a state flip-flop in which is stored said single bit. 
         [0018]    The invention also includes a corresponding integrated circuit. Further advantageous characteristics of the invention form the subject of the dependent claims. 
         [0019]    The claims form an integral part of the technical disclosure provided herein in relation to the invention. 
         [0020]    Various embodiments envisage a sequential circuit, i.e., a finite-state machine, that can be driven with a corresponding clock signal. In particular, said circuit comprises a plurality of state flip-flops for storing a bit sequence that identifies the current state of the finite-state machine, and a combinational circuit that determines the next state of the finite-state machine as a function of the current state and of a control signal. 
         [0021]    In various embodiments, the finite-state machine comprises at least one wait state, namely,
       if the control signal has a first logic value, the finite-state machine remains in the wait state; and   if the control signal has a second logic value, the finite-state machine proceeds to the next state.       
 
         [0024]    For example, such a wait state can be obtained by configuring the combinational circuit that determines the next state in such a way that, when the current state indicates that the finite-state machine is in the wait state (encoded with a first bit sequence), the combinational circuit assigns to the next state:
       the bit sequence of the wait state, if the control signal has the first logic value, or   the bit sequence of the next state, if the control signal has the second logic value.       
 
         [0027]    In various embodiments, the system also comprises a synchronization circuit that can be driven with the clock signal of the finite-state machine. In particular, said synchronization circuit receives at input a control signal and supplies to the finite-state machine a synchronized control signal. 
         [0028]    The inventors have noted in this context that it is possible to exploit one of the flip-flops used for encoding the current state of the finite-state machine as synchronization flip-flop. This makes it possible to reduce the number of flip-flops in the synchronization circuit, thus optimizing the latency of the overall system. 
         [0029]    In various embodiments, it is envisaged that the bit sequence of the wait state and the bit sequence of the next state differ for the value of a single bit. This enables determination of the value of said bit directly as a function of the control signal when the finite-state machine is in the wait state. 
         [0030]    For example, when the finite-state machine is in the wait state, the combinational circuit can associate directly to said bit the synchronized control signal. Alternatively, if a conversion of the logic levels is required, the combinational circuit can invert the control signal and associate to said bit the inverted control signal. 
         [0031]    In general, the system synchronizes the operation of a sequential circuit with a control signal via a plurality of synchronization flip-flops operating in cascade. In particular, the circuit is configured as a finite-state machine that comprises at least one wait state in which a check is made on the logic value of the control signal. According to the solution described here, the bit sequence that identifies the wait state and the bit sequence that identifies the next state differ only for the value of a single bit. In this way, the last synchronization flip-flop can be obtained via the state flip-flop that stores said bit. 
         [0032]    In various embodiments, this solution is applied to all the states in which a check is made on the logic value of said synchronized control signal. 
         [0033]    In general, the solution can be applied to all state machines in which there is a dependence upon one or more external signals, where, however, said dependence applies for just one signal at a time in a particular state. There may thus be a number of states in which the transaction depends upon external signals, but each time with a single signal in each of the states involved. 
         [0034]    The solution described here hence enables use of a synchronization circuit that comprises just one flip-flop, whereas the second synchronization flip-flop is implemented via one of the state flip-flops. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0035]    The invention will now be described purely by way of non-limiting example with reference to the drawing figures, wherein: 
           [0036]      FIG. 1  is an example of undirected synchronization according to the prior art; 
           [0037]      FIG. 2  is an example of undirected synchronization according to the prior art; 
           [0038]      FIGS. 3 and 4  show synchronization systems according to the solution described herein; and 
           [0039]      FIGS. 5 to 7  show examples of finite-state machines that can be used in the solution described herein. 
       
    
    
     DETAILED DESCRIPTION 
       [0040]    In the ensuing description various specific details aimed to an in-depth understanding of the embodiments are illustrated. The embodiments can be obtained without one or more of the specific details, or with other methods, components, materials etc. In other cases, known structures, materials, or operations are not shown or described in detail so that various aspects of the embodiments will not be obscured. 
         [0041]    Reference to “an embodiment” or “one embodiment” in the context of this description indicates that a particular configuration, structure, or characteristic described in relation to the embodiment is comprised in at least one embodiment. Hence, phrases such as “in an embodiment” or “in one embodiment” and the like, that may be present in different parts of this description, do not necessarily all refer to one and the same embodiment. Furthermore, the particular configurations, structures, or characteristics can be combined in any adequate way in one or more embodiments. 
         [0042]    The references used herein are only for convenience and do not define the sphere of protection or the scope of the embodiments. 
         [0043]      FIG. 3  shows an embodiment of a unidirectional-synchronization system in which a finite-state machine FSM 1  receives a control signal SYNC through a synchronization circuit  20 . 
         [0044]    For example, said control signal SYNC can be generated by an asynchronous circuit or a sequential circuit that forms part of a different clock domain. 
         [0045]    In the embodiment considered, the circuit  20  comprises a chain of flip-flops, in which the flip-flops are driven with the clock signal CLK 1  of the receiving system FSM 1 . 
         [0046]    In the embodiment considered, the state of the finite-state machine FSM 1  is stored in a state register  24  comprising a plurality of flip-flops. For example, in the embodiment considered, the state of the finite-state machine FSM 1  is encoded with a sequence of four state bits b 3 , b 2 , b 1  and b 0 . 
         [0047]    As has been mentioned previously, the inventors have noted that the last flip-flop of the synchronization chain  20  to be introduced on the control signal can be equated to one of the flip-flops used for encoding the current state of the receiving finite-state machine. 
         [0048]    For example, in the embodiment considered, the circuit  20  comprises just one flip-flop  20   a , and the function of the second synchronization flip-flop is implemented by a state flip-flop, for example, the flip-flop in which the state bit b 1  is stored. 
         [0049]      FIG. 4  shows an embodiment of a bidirectional-synchronization architecture in which two systems FSM 1  and FSM 2  exchange control signals through respective synchronization circuits. 
         [0050]    In the example shown, the circuit FSM 2  transmits to the circuit FSM 1  through a synchronization circuit  20  a control signal VALID. In substantially the same way, the circuit FSM 1  transmits to the circuit FSM 2  through a synchronization circuit  22  a control signal ACK. This type of communication can be used for acknowledging proper reception of the signal VALID. 
         [0051]    In the embodiment considered, the states of the finite-state machines FSM 1  and FSM 2  are stored in respective state registers  24  and  26  comprising a plurality of flip-flops. For example, in the embodiment considered, the state of the finite-state machine FSM 1  is encoded with four bits b 3 , b 2 , b 1  and b 0  that are stored in the register  24 , and the state of the finite-state machine FSM 2  is encoded with four bits b 3 , b 2 , b 1  and b 0  that are stored in the register  26 . 
         [0052]    Also in this case, it is possible to use one of the flip-flops used for encoding the current state of the receiving state machine to implement the function of a synchronization flip-flop. 
         [0053]    For example, in the embodiment considered, the circuit  20  comprises just one flip-flop  20   a , and the function of the second synchronization flip-flop for the signal VALID is implemented by a state flip-flop of the machine FSM 1 , for example, the flip-flop of the register  24  in which the state bit b 1  is stored. 
         [0054]    In substantially the same way, the circuit  22  can comprise just one flip-flop  22   a , and the function of the second synchronization flip-flop for the signal ACK is implemented by a state flip-flop of the machine FSM 2 , for example, the flip-flop of the register  24  in which the state bit b 2  is stored. 
         [0055]      FIG. 5  shows an example of a generic description in a hardware description language (HDL) of a finite-state machine. 
         [0056]    The code provided by way of example describes the logic circuit that determines for a machine with six states, idle, state A, state_B, state_C, state_D and state_E, the next state next_state as a function of the current state current_state and of an input signal SYNC. 
         [0057]    This machine will behave so as to evolve freely, controlled just by its own clock, in all the states except for a special state, i.e., the state state_B. The state state_B represents a wait state in which the machine may proceed to the state state_C only in the case where the synchronization command SYNC arrives; otherwise, the machine remains in the state state_B. 
         [0058]    According to the solution described herein, the code used for these two states (state_B and state_C) is a bit sequence, in which just one bit is different. 
         [0059]      FIG. 6  shows a possible encoding for said states by means of three bits b 2 , b 1 , and b 0 . 
         [0060]    In the embodiment considered, only the least significant bit b 0  changes its value for the state state_B (“010”) and the state state_C (“011”). 
         [0061]    In the embodiment considered, the logic of definition of the new state next_state (i.e., the next state of the finite-state machine) imposes that, when the current state (current_state) is the state state_B, the most significant state bits (b 2  and b 1 ) remain unvaried, i.e., that these bits be independent of the value of the synchronization signal SYNC, whereas the state bits b 0  may vary from zero to one. 
         [0062]    In this case, the logic circuit that implements the determination of the state bits b 0  will have the function of a buffer (or an inverter if the logic level is to be inverted). For example, for the code chosen previously and in the case where the command SYNC is active high, the state machine passes from the state state_B to the state state_C only when the signal SYNC has the logic level “1”, namely,
       when the signal SYNC has the logic level “1”, the state bit b 0  for the next state also assumes the logic level “1”, and   when the signal SYNC has the logic level “0”, the state bit b 0  for the next state also assumes the logic level “0”.       
 
         [0065]    This means that the logic for the state bit b 0  assumes the function of a buffer, and the state bit b 0  behaves as the last synchronization stage for the signal SYNC. 
         [0066]    Said example can in any case be extended to all the bits of the state code, which can assume the same meaning (of last synchronization stage) for other control signals and in other wait states. 
         [0067]    What is important is only that the control signal should be associated in a specific state only to a single state bit to prevent problems of metastability. 
         [0068]    In various embodiments, to guarantee that the last synchronization stage is always present, said scheme of association of the bit sequences is applied to all the wait states in which a check is made on the logic value of the control signal itself. 
         [0069]    The inventors have noted that this mechanism does not introduce uncertainties in the determination of the new state of the machine, since, if the command is detected, the machine evolves correctly into the new state. Otherwise, the machine remains in the current state waiting for said command. 
         [0070]    The advantage achieved with said solution is multiple:
       the number of the flip-flops required for synchronization of the control signals (and hence the area dedicated thereto) is reduced;   the latency of the communication between the various systems, i.e., a control device and the controlled finite-state machine, is reduced; and   the power dissipated in the synchronization process is reduced, because both the logic for determination of the next state and the number of flip-flops of the synchronization circuit is reduced.       
 
         [0074]    The solution described herein for a simple machine with six states and a single external control signal, can be extended also to more complex machines and with a higher number of external signals that interact therewith. In this case, it is necessary to elaborate, accordingly, the encoding of the states so as to associate different flip-flops to the last stage for synchronization of the incoming signals. 
         [0075]    For example,  FIG. 7  shows the description of a finite-state machine in which a check is made on two control signals SYNC 1  and SYNC 2 . 
         [0076]    In the embodiment considered, the state machine monitors in a state state_F the signal SYNC 1 , and the machine proceeds to a state state_G only if the signal SYNC 1  has the logic value “1”. 
         [0077]    Also in this case, it is sufficient to associate one bit of the bit sequence used for encoding the states state_F and state_G to the signal SYNC 1 . For example, the state state_F could be encoded with the bit sequence “0010” and the state state_G could be encoded with the bit sequence “0011”. This means that the logic for the next state could associate directly the signal SYNC 1  to the least significant bit when the finite-state machine is in the state state_F. 
         [0078]    In substantially the same way, in a state state_M the signal SYNC 2  is monitored, and the machine proceeds to a state state_N only if the signal SYNC 2  has the logic level “1”. 
         [0079]    Also in this case, it is sufficient to associate one bit of the bit sequence used for encoding the states state_M and state_N to the signal SYNC 2 . For example, the state state_M could be encoded with the bit sequence “0111”, and the state state_N could be encoded with the bit sequence “1111”. This means that the logic for the next state could associate the signal SYNC 2  directly to the most significant bit when the finite-state machine is in the state state_M. 
         [0080]    The synchronization system described herein can hence be designed, for example, via a hardware description language that defines the synchronization circuit  20  and the finite-state machine FSM 1 . The assignment of the bit sequences to the states may be carried out directly in the source code or may be carried out automatically via a synthesis program. 
         [0081]    Of course, without prejudice to the principle of the invention, the details of construction and the embodiments may vary widely with respect to what has been described and illustrated herein purely by way of example, without thereby departing from the scope of the present invention, as defined by the ensuing claims.