US 5,210,856 AGrant
Non-Aligned DRAM State Machine for Page-Mode DRAM Control
Issue Date:1993-05-11
•11 Claims
•10 Drawing Sheets
Abstract
An apparatus and method for operating a system component in a microprocessor system. The component is operated by a component controller which runs off a clock having a frequency different than the system clock. The controller is synchronized with the system clock at the conclusion of a component access cycle. The state machine of the controller can thus operate independently of the system clock and timing options implemented by the controller need not have an even number of states.
Metadata
Assignee
- Chips and Technologies, Inc.
Inventors
- Stuart Auvinen
- Richard Sowell
Application Information
Application Number:US 7417780
Filing Date:1991-08-07
Priority Date:1991-08-07
Art Unit:237
Classifications
IPC:
G06F 104
Field of Search:
364395307DIG. 1;DIG. 2164;165;550;275269
Patent Drawings (10 sheets)
Description
Background of the Invention
This invention relates to state machines and in particular to state machines for use in DRAM controllers.
Original equipment manufacturers often design system components with many options to differentiate their products from other products made with the same chip set. Briefly summarized, options are the ability to support in an optimized fashion alternate cycle types or operating speeds. Each option requires that the component controller execute a unique series of states to generate the timing signals required to implement that option.
The practice of adding options to customize a device is particularly evident in the design of dynamic random access memory (DRAM) controllers. FIG. 1 shows a typical system architecture having a microprocessor 10, a DRAM 4 and a DRAM controller 5. Microprocessor 10 asserts an address request signal to controller 5 to begin a memory access. A state machine within controller 5 then transitions through the states necessary to issue the appropriate timing signals to DRAM 4 to perform the memory access. When DRAM 4 completes the memory access, controller 5 asserts a ready signal to microprocessor 10. Microprocessor 10 samples the ready signal on a given edge of the system clock and when the ready signal is detected reads the data retrieved from DRAM 4.
Memory access can occur using many different types of cycles such as page hit, page miss, RAS/CAS and RAS high. These cycles are diagrammed in FIG. 2. Memory access begins with the row address strobe (RAS) 11 going low to activate the memory row line, followed by the column address strobe (CAS) going low to activate a particular column within that row. The memory access cycle ends when CAS goes high. In the page hit cycle, the row address is assumed to be the same as the previous row address and there is no need to reassert RAS in this cycle type.
As can be seen from FIG. 2 each memory cycle type requires a different amount of time for completion. Ideally, each one of the memory access cycle types is individually optimized to provide the maximum operating speed for all cycles. For optimization of each cycle type to occur, the controller state machine must issue the strobe timing signals at different periods of time for each cycle. The state machine of the DRAM controller must thus transition through a different sequence of states to implement each cycle type.
In addition to the many memory access cycle types, DRAMs have many different operating speeds. Two common DRAM operating speeds are 80 and 100 nanoseconds. Within each different speed class, individual DRAM manufacturers specify their own unique timing parameters for each type of cycle. For example, the timing parameters of manufacturer A may require that a page hit cycle CAS be five clock cycles in duration, while the timing parameters of manufacturer B require CAS be six clock cycles in duration. Thus, there exists a plethora of DRAM optimization parameters which can be included as various timing options. One set of timing options is needed on the controller chip just to support multiple cycle types. Another set of timing options must be included, if the DRAM controller is designed to support more than one manufacturer's DRAM.
Typical chip set designs employ DRAM state machines having many states to allow for all the options. Because the microprocessor samples the ready signal on a given edge of the system clock, the states in the state machine must be explicitly synchronized, or aligned with, the correct phase of the system clock, SCLK. Therefore, options must insert an even number of states in the state machine to ensure that the state machine is aligned with SCLK at the completion of the memory cycle. Ensuring an even number of states often requires the addition of unnecessary idle states. Optionally, systems designers can refrain from combining options in such a way that an odd number of states occur. In this way, certain combinations of options become illegal.
The sheer number of options and the restrictions on implementing them, make controller state machine design complex and difficult. The need to insert idle states to ensure an even number of states greatly increases the number of states which must be incorporated into the controller state machine. In addition, options may be inadvertently combined in an illegal manner unbeknownst to the system user. These two facts complicate the debugging process, increase controller chip costs and delay delivery of new systems to the market place.
Summary of the Invention
The state machine of the present invention recognizes that although memory accesses must begin and end in phase with SCLK, the states in the middle of the state machine do not need to bear any relationship to the phase of SCLK. Thus, a number of states (even or odd) can be inserted in the middle of the state machine. The total number of states inserted are the sum of those appropriate for implementing the desired options. The state machine is synchronized with the system clock at the conclusion of the device access cycle. Synchronization can occur by sampling the states adjacent to the concluding state of the cycle and asserting a ready signal to the system microprocessor, when a given edge of the system clock is detected, such that this signal is present at the conclusion of the access cycle.
According to one aspect of the present invention, a controller device has a means for storing a given set of component timing options; a state machine for transitioning through a series of states to output a plurality of timing signals to said system component and coupled to said means for storing and to a second clock having a frequency different from said first clock; and means for synchronizing said state machine to said first clock when said state machine has completed said series of state transitions.
According to another aspect of the present invention, a method for operating a system component comprises the steps of storing a given set of component timing options; transitioning through a series of states using a state machine to output a plurality of timing signals to said system component according to said given set of timing options; operating said state machine using a second clock having a frequency different from said first clock; and synchronizing said state machine to said first clock when said state machine has completed said series of state transitions.
Brief Description of the Drawings
FIG. 1 is a block diagram of a system architecture having a DRAM, a microprocessor and a DRAM controller;
FIG. 2 is a set of timing diagrams illustrating different DRAM memory cycles;
FIG. 3 is a block diagram of a state machine architecture according to an embodiment of the present invention;
FIG. 4 is a timing diagram useful for illustrating operation of the present invention;
FIG. 5 is a state machine state transition diagram according to an embodiment of the present invention;
FIG. 6A and 6B are a logic diagram of a ready circuit according to an embodiment of the present invention;
FIG. 7 is a set of timing diagrams showing examples of read cycles as implemented by the state machine of FIG. 5 according to an embodiment of the present invention;
FIG. 8 is a set of timing diagrams showing examples of write cycles as implemented by the state machine of FIG. 5 according to an embodiment of the present invention; and
FIG. 9 is another set of timing diagrams showing examples of write cycles as implemented by the state machine of FIG. 5 according to an embodiment of the present invention.
Description of the Preferred Embodiment
FIG. 3 shows a top level block diagram of a state machine architecture according to an embodiment of the present invention. State machine 12 outputs timing signals to DRAM 4 to implement memory access cycles according to the DRAM operating speed and type of cycle desired. The speed and cycle options which can be implemented by the state machine are programmed into programmable registers 16. State machine 12 also contains ready circuitry 18 for asserting the ready signal when DRAM 4 completes a memory access. CPU 10 then responds by reading data from DRAM 4.
State machine 12 operates according to clock input CLK2 which has a frequency of two times the system clock frequency (SCLK). Clock signal CLK2 is generated by circuitry (not shown) elsewhere in the system according to hardware known to those of ordinary skill in the art. Clock divide logic 19, also well known to those of skill in the art is used to generate one clock signal when given the other. State machine 2 may operate using other multiples of the system clock or other clocks and the invention is not limited to a multiple of two of the system clock.
Because state machine 12 operates on a clock of a different frequency than the system clock, state machine 12 can operate independently of the system clock. Once the states necessary to execute a particular option, or set of options, are completed, the state machine can then be synchronized with the system clock. Synchronization can occur by timing the output of the ready signal to be aligned with the system clock once the state machine has transitioned through the desired states. Alternatively, synchronization can occur directly from the system clock. Thus, there is no need to insert a requisite number of states for each option to align the state machine with the system clock.
The operation and general principles of the state machine of the present invention is best illustrated by way of example. For purposes of this example, CPU 10 samples the ready signal on the rising edge of SCLK and there exists a requirement that the CAS pulse width be at least five CLK2 cycles in duration. According to the present invention, the desired CAS width can be selected from one of several options by programming programmable registers 16.
FIG. 4 contains timing diagrams for CAS of a page miss cycle constructed according to the example parameters. In example 1 of FIG. 4, the CAS pulse width is selected to be five CLK2 cycles and begins at time t1, on the falling edge of an SCLK pulse. The state machine transitions through states TC1-TC5 as shown to generate a CAS pulse of the desired length. Ready circuitry 18 samples the states on the rising edge of SCLK. When one of the two states adjacent to the programmed completion of the CAS pulse occurs, ready circuitry 18 detects this state and asserts the ready signal. The two states which are adjacent to the completion of the CAS pulse are known from the state machine equations that govern operation of the controller state machine. The limited number of states which occur adjacent to the completion of a particular memory cycle are known and are included as part of the ready circuit logic.
In example 1 of FIG. 4, ready circuitry 18 samples the states on the rising SCLK edges t2, t4. During time t2, state TC1 is detected. However, this state is not one of two states adjacent to the final state of this cycle and is thus not used by the ready circuit logic to assert a ready signal. At time t4, ready circuit 18 detects state TC3. This state is a state which occurs adjacent to the completion state of the page miss read cycle of example 1. When ready circuitry 18 detects this state at time t4, the circuit asserts a ready signal of two CLK2 pulse widths. When CPU 10 samples the ready signal on the next rising edge of SCLK, CPU 10 will detect the ready signal and read the data retrieved from DRAM 4. Note that in example 1 of FIG. 4 the total number of states is odd.
In example 2 of FIG. 4, the CAS pulse width is also selected to be five CLK2 pulse widths, however, in this example the CAS pulse does not begin until time t2. Thus, five CLK2 pulse widths later, the state machine is not aligned with the rising edge of SCLK. Also, in this example, unlike in example 1, when ready circuitry 18 samples the state machine at time t4, state TC3 or TC4 are not detected. Ready circuitry 18 next samples the state machine at time t6 and detects state TC4. Since TC4 is one of the states which occurs adjacent to the conclusion of a page miss read cycle, ready circuit 18 asserts the ready signal at this time. However, CPU 10 will not sample the ready and terminate the memory access cycle until time t8, on the next rising edge of SCLK. The CAS pulse must remain asserted until the end of the memory cycle. Under these conditions, a state TC6 is inserted by the state machine to keep the CAS pulse asserted until time t8.
Now that the structure and operation of the present invention has been explained in general terms, a more detailed description of a specific embodiment of the invention may be undertaken. FIG. 5 shows an example of a specific DRAM controller state machine according to an embodiment of the present invention. State machine 12 may be implemented as a programmable logic array. The state machine of FIG. 5 is capable of implementing the options described in Table 1. Those options desired by the system designer are selected by writing specified values into the programmable registers associated with and coupled to the state machine. Transitions between states are logical functions of these parameter values and occur according to the equations given in Table 2. The state machine of FIG. 5 requires only 23 states to implement these options. Conventional state machines not incorporating the present invention require many more states to implement the same number of options.
FIGS. 6A and 6B show an example of a ready circuit 18 which may be used with the example state machine of FIG. 5 to synchronize the state machine with the system clock. In the portion of ready circuit 18 diagrammed in FIG. 6A, a flip flop 100 outputs a signal which indicates the presence or absence of a page hit, also known as a read hit cycle. From the state machine diagrammed in FIG. 5, states TRCR1 and TR1 do not occur in a page hit cycle and if asserted, indicate a cycle type other than a page hit. Thus these signals are input to a NAND gate 102 and then NORed with signal LDWR [latched write] to form the J input of flip flop 100. The K input of flip flop 100 is the NOR of the system clock and DRM ready signals. The Q output of flip flop 100 indicates a non-page hit read cycle, while the Q output indicates a page hit read cycle.
FIG. 6B contains three 4.times.1 multiplexers: 108, 110 and 112; and one 2.times.1 multiplexer 114. Multiplexer 108 has two select inputs RDXWS and RD1WS. These variables are two of the programmable options listed in Table 1 and indicate how many wait states are added to a page hit read cycle. Depending on the value of these variables, either state TRCH, TC3 or TC5 will be one of the two states adjacent to the final state in a page hit read cycle implemented by the state machine of FIG. 5. Thus when this particular state occurs, this signal is selected by the multiplexer to be propagated to the output and NANDed with the variable indicating a page hit read cycle.
Multiplexers 110 and 112 detect those states which occur prior to the conclusion of read cycles which are not page hit cycles. The select inputs of multiplexer 110 are the most and least significant bits of the CAS pulse width. The select inputs of multiplexer 112 are the most significant bit of the CAS pulse width variable and the variable CPWDBL. Variable CPWDBL is also listed in Table 1 and is a global variable that sets the CAS pulse width at seven CLCK2 cycles. CPWDBL can be asserted only when the most and least significant bit of CPW is a one.
Multiplexer 114 detects those two states which occur adjacent to the final state in a write cycle. The select input of multiplexer 114 is the programmable option variable DBLCAS. The variable DBLCAS indicates that the CAS pulse width has been doubled. See Table 1. The outputs of multiplexers 108-114 are processed by combinational logic as shown in FIG. 6B and input via NAND gate 120 to flip flop 128.
The operation of the present invention as embodied in FIGS. 5 and 6 is best illustrated with some specific examples. FIGS. 7-9 contain timing diagrams of read and write cycles and associated state transitions for various combinations of programmable options. For example, FIG. 8, line 197 diagrams a page hit write cycle while FIG. 9, line 199 diagrams a page miss write cycle. FIG. 7 reference number 200 diagrams the timing signals and state transitions produced for a rashi read cycle in which the system designer has specified the CAS pulse width to be three CLK2s. The variables CPWMSB and CPWLSB (called CPW1X and CPW0X in Table 1) are both zero. The variable RD1WS has therefore been written into the programmable register 16 as 0.
In example line 200, state machine 12 of FIG. 5 transitions through the states indicated in FIG. 5 according to the equations given in Table 2 and the value of the variables contained in the programmable register. The state transitions are: TR1, TR3, TC1, TC2, and TC3. This rashi cycle therefore ends with state TC3 and the two states immediately preceding this final state are TC2 and TC1.
In the circuit of FIG. 6B, the select of multiplexer 108 is set to zero, zero because RD1WS has been set to zero in programmable register 16. The circuit of FIG. 6A detects that states TPCR1 and TR1 are asserted which causes the Q output, signal RHIT, of flip flop 100 to be deasserted. Thus, the output of NAND gate 201, signal DRDY0, is asserted.
The CAS pulse width on line 200 of FIG. 7 is three CLK2 cycles in duration. The variable CPW is a two bit number and therefore the most significant bit of CPW in this instance is 0 and the least significant bit is 0. Thus, when state TC1 is active, this signal is propagated to the output of multiplexer 110 and input to OR gate 203. When RDYTCA is asserted, the output of gate 203 is asserted and NANDed with signal NRHIT which is asserted. Thus, the signal DRDY1 is deasserted whenever state TC1 is active.
Multiplexer 112 select inputs are set at 0,0. Therefore, when state TC2 is active, this signal is propagated to the output of multiplexer 112 and input to OR gate 203. In summary, when state TC2 is asserted, the output of OR gate 203 is asserted. This signal is input to NAND gate 205. Signal NRHIT is asserted since the current cycle is not a page hit cycle. The signal DRDY1 output from NAND gate 205 is therefore deasserted whenever state TC2 is active.
Multiplexer 114 does not propagate any signal to OR gate 207 since states TWC2A and TWC2B occur only in write cycles. Similarly, signal TWCH can only occur during a write cycle and the output of gate 207 is deasserted during the memory access cycle of this example. Signal NOPOST input to NAND gate 209 indicates the presence or absence of posted write cycles and is not asserted for this particular example. The output of gate 209 is therefore asserted during the cycle of this example.
During states TC1 and TC2 therefore, NAND gate 120 propagates a signal DRDYN to flip flop 128. On the rising edge of SCLK, the ready signal will be latched to the output of flip flop 128. From line 200 of FIG. 7, when signal DRDYN first becomes active during state TC1, the rising edge of SCLK is present. Therefore, the ready signal will be latched by flip flop 128. During the next state TC2, the rising edge of the SCLK is not present and the ready signal is already latched to the output of flip flop 128. Because of the construction of flip flop 128, the ready signal will be output for two cycles of CLK2 and will therefore be asserted during the final state of the cycle. Thus, when CPU 10 samples the ready signal on the final state of the cycle, the ready signal will be detected and the memory access cycle will end.
Note that the number of cycles in the present example is odd and that the state machine of the present invention began the cycle in the middle of the SCLK pulse. Furthermore, no extra states were added by the state machine of the present invention to synchronize the operations with the CPU. The state machine of the present invention can therefore operate independently of the system clock and there is no requirement to insert a specific number of states to keep phase with this clock. Rather, the state machine of the present invention synchronizes itself with the system clock at the conclusion of the current access cycle by asserting a ready signal which is present on the desired edge of SCLK when the access cycle concludes. The state machine thus does not need to insert unneeded states to ensure synchronization with the CPU and state machine design and debugging is reduced in complexity. In addition, any numbers of combinations of options may be specified by system designers without worrying about whether the particular combination will result in an unsynchronized state machine.
Preferred embodiments of the present invention have now been described. Variations and modifications will be readily apparent to those of ordinary skill in the art. For this reason, the invention should be construed in light of the claims.
Claims
What is claimed is:
1. In a microprocessor system including a microprocessor operating according to a first clock, and having a component controller operating according to a second clock having a frequency m times the frequency of the first clock, an apparatus for synchronizing said component controller to said first clock at the completion of a component access cycle comprising: means, coupled to a state machine of said component controller, and adapted to receive signals identifying an n-1 through n-m states of a component access cycle having n state transitions, for sampling for said n-1 through n-m states on a given edge of said first clock; and means, coupled to said means for sampling, for asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 through n-m states is detected.
2. The component controller of claim 1 wherein said component is a DRAM.
3. In a microprocessor system including a microprocessor operating according to a first clock, and having a component controller operating according to a second clock having twice the frequency of the first clock, an apparatus for synchronizing said component controller to said first clock at the completion of a component access cycle comprising: means, coupled to a state machine of said component controller and adapted to receive signals, for identifying an n-1 and n-2 states of a component access cycle having n state transitions, for sampling at said n-1 and n-2 states on a given edge of said first clock; and means, coupled to said means for sampling, for asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 and n-2 states is detected.
4. The component controller of claim 3 wherein said component is a DRAM.
5. In a microprocessor system operating according to a first clock, a controller device for controlling a system component comprising: a programmable register for storing a plurality of variables, wherein said variable describe a given set of timing options; a state machine that transitions through a series of states to output a plurality of timing signals to said system component, and coupled to said programmable register, to said system component and to a second clock having a frequency different from said first clock; and a ready circuit, coupled to said first clock, aid state machine and said programmable register, for sampling said series of states and for asserting a ready signal when a specified state is detected on a given edge of said first clock to synchronize said state machine with said first clock at the end of a component access cycle.
6. The component controller of claim 5 wherein said component is a DRAM.
7. In a microprocessor system including a microprocessor operating according to a first clock and a system component, a component controller comprising: means for storing a given set of component timing options; a state machine for transitioning through a series of states to output a plurality of timing signals to said system component and coupled to said means for storing and to a second clock having a frequency m times the frequency of the first clock; and an apparatus for synchronizing said component controller to said first clock at the completion of a component access cycle having: (i) means, coupled to a state machine of said component controller and adapted to receive signals, identifying an n-1 through n-m states of a component access cycle having n state transitions, for sampling at each of said n-1 through n-m states on a given edge of said first clock; and (iii) means, coupled to said means for sampling, for asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 through n-m states is detected.
8. The component controller of claim 7 wherein said component is a DRAM.
9. In a microprocessor system including a microprocessor operating according to a first clock, and having a component controller operating according to a second clock having a frequency m times the frequency of the first clock, a method for synchronizing said component controller to said first clock at the completion of a component access cycle comprising: identifying an n-1 through n-m states of a component access cycle having n state transitions; sampling for each of said n-1 through n-m states on a given edge of said first clock; and asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 through n-m states is detected.
10. In a microprocessor system including a microprocessor operating according to a first clock, and having a component controller operating according to a second clock having twice the frequency of the first clock, a method for synchronizing said component controller to said first clock at the completion of a component access cycle comprising: identifying an n-1 and n-2 states of a component access cycle having n state transitions; sampling for said n-1 and n-2 states on a given edge of said first clock; and asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 through n-2 state is detected.
11. In a microprocessor system including a microprocessor operating according to a first clock and a system component, a method for operating a component controller comprising the steps of: storing a given set of component timing options; transitioning through a series of states using a state machine to output a plurality of timing signals to said system component according to said given set of timing options; operating said state machine using a secondary clock having a frequency m times the frequency of the first clock; and synchronizing said component controller to said first clock at the completion of a component access cycle wherein said step of synchronizing includes the steps of: (i) identifying an n-1 through n-m states of a component access cycle having n state transitions; (ii) sampling for each of said n-1 through n-m states on a given edge of said first clock; and (iii) asserting a ready signal having a period of at least one first clock pulse to synchronize said component controller to said first clock, when one of said n-1 through n-2 states is detected.