INITIALIZING A DESCRAMBLER
Embodiments herein describe techniques for synchronizing LFSRs located on two compute devices. To synchronize the LFSRs, a first one of the compute devices may transmit a first training block that includes a predefined bit sequence. The training block is scrambled by a transmitting (TX) LFSR on the first compute device and then transmitted to the second compute device. The second compute device performs an XOR operation to recover the outputs of the TX LFSR that were used to scramble the data. The second compute device can use the outputs of the TX LFSR to determine future outputs of the TX LFSR. These future outputs are then used to initialize a receiving (RX) LFSR on the second compute device. Now, when subsequent training blocks are received, the second compute device can use the initialized RX LFSR to descramble the scrambled training blocks.
The present invention relates to initializing a linear feedback shift register (LFSR) in a descrambler, and more specifically, to identifying a future state of the LFSR by comparing received scrambled data to expected data.
High speed serial (HSS) links are used for communications in various known computer chips and computer systems. A given computer chip may include multiple instances of a specific HSS link using the same interface protocol. Many HSS interfaces utilize LFSRs to scramble the data that is transmitted. This scrambling provides many advantages such as clock retention and improving DC balance; however, synchronization is required to accurately descramble the received data bit stream.
SUMMARYOne embodiment of the present invention is a method that includes receiving on a first compute device training data scrambled using a transmitting LFSR on a second compute device and determining past output values used by the transmitting LFSR to scramble the training data by comparing the scrambled training data with expected data stored on the first compute device. The method includes determining future output values of the transmitting LFSR based on the past output values and identifying a plurality of registers values defining a future state of the transmitting LFSR based on the future output values. The method also includes initializing a receiving LFSR on the first compute device using the plurality of register values to synchronize the receiving LFSR with the transmitting LFSR.
Another embodiment of the present invention is a compute device that includes a receiving LFSR, a receiver interface configured to receive training data scrambled using a transmitting LFSR on a separate compute device, and a LFSR state calculator. The calculator is configured to determine past output values used by the transmitting LFSR to scramble the training data by comparing the scrambled training data with expected data stored on the compute device and determine future output values of the transmitting LFSR based on the past output values. The calculator is also configured to identify a plurality of registers values defining a future state of the transmitting LFSR based on the future output values and initialize the receiving LFSR using the plurality of register values to synchronize the receiving LFSR with the transmitting LFSR.
Another embodiment of the present invention is a computer program product for initializing a receiving LFSR which includes computer-readable program code executable to receive on a first compute device training data scrambled using the transmitting LFSR on a second compute device and determine past output values used by the transmitting LFSR to scramble the training data by comparing the scrambled training data with expected data stored on the first compute device. The computer program product also includes program code executable to determine future output values of the transmitting LFSR based on the past output values, identify a plurality of registers values defining a future state of the transmitting LFSR based on the future output values, and initialize the receiving LFSR on the first compute device using the plurality of register values to synchronize the receiving LFSR with the transmitting LFSR.
To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements disclosed in one embodiment may be beneficially utilized on other embodiments without specific recitation.
DETAILED DESCRIPTIONEmbodiments herein describe techniques for synchronizing LFSRs located on two compute devices that communicate by transmitting scrambled data on serial links (e.g., HSS links). Before transmitting data to a receiving compute device, a transmitting compute device may use a LFSR to scramble the data. Doing so may prevent the compute device from transmitting a long string of logical ones or zeros which may reduce the DC balance on the link or make clock retention more difficult. The receiving compute device descrambles the data using a LFSR that is synchronized with the LFSR that scrambled the data to recover the original data.
To synchronize the LFSRs, a first one of the compute devices may transmit a first training block (e.g., training data) that includes a predefined bit sequence. The training block is scrambled by a transmitting (TX) LFSR on the first compute device and then transmitted to the second compute device. Instead of attempting to descramble the data, the second compute device performs an XOR operation to recover the outputs of the TX LFSR on the first compute device that were used to scramble the data. In one embodiment, the second compute device XORs the scrambled data with the expected training data. If the scrambled data was sent correctly across the serial link (i.e., there were no communication errors) than the result of this XOR operation is the output of TX LFSR on the first compute device. Because the operation performed by the LSFR is predictable, the second compute device can use the outputs of the TX LFSR to determine future outputs of the TX LFSR (e.g., the outputs of the TX LFSR that will be used to scramble the next training block). These future outputs are then used to initialize a receiving (RX) LFSR on the second compute device. Once initialized, when the second training block is received, the second compute device can use the RX LFSR to descramble the scrambled training block. If the descrambled data matches the expected data, then the TX LFSR on the first compute device is synchronized with the RX LFSR on the second compute device.
To initialize the LFSR 100, a seed may be loaded into registers 105 which sets the initial state of the LFSR 100. Because the LFSR 100 includes ten registers 105, the seed is a 10-bit value (which includes at least one non-zero bit) where each bit is loaded into a respective one of the registers 105 using initialization inputs 125A-125J. Each clock cycle, the values are shifted in a clockwise manner—e.g., the value in register 105A is shifted into registers 105B—except for the new value in the first register 105A which is set according to the output of the XOR logic 115 in the feedback loop 120. The stream of values produced at the output 120 of the XOR logic 115 is determined by the previous state of the LFSR. For example, if the seed is (0000001000), then the LFSR output 120 is 1 (i.e., 1 XOR 0=1). The state of LFSR 100 the next clock cycle is (1000000100) and the LFSR output 120 is 0 (i.e., 0 XOR 0=0).
Because the registers have a finite number of possible states (2̂N−1 where N is the number of registers), the LFSR output 120 is a repeating cycle whose length depends on the number of registers 105. Even though the output 120 is predictable, LFSR 100 can nonetheless be used to produce a sequence of bits which appears random. As such, LFSRs may be used as a pseudo-random number generator, a pseudo-noise sequence generator, fast digital counters, scramblers, and whitening sequences. Moreover, although shown as including hardware elements in
Compute device 205 includes TX LFSR 210 whose output is fed into XOR logic in order to scramble data out 215 which represents any data that compute device 205 desires to transmit to compute device 250. For example, before normal data communication begins, the compute device 205 transmits training blocks which include training data used by compute device 250 to synchronize RX LFSR 265 to TX LFSR 210. For example, the training data may be a predefined bit-sequence (e.g., a 64 bit sequence) that is used for initializing the serial communication link 230. In
The scrambled data 220 is provided to a driver circuit 225 which then buffers and outputs the scrambled data 220 on serial link 230. That is, the scrambled data 220 is sent sequentially across the link 230 rather than in parallel. The serial link 230 may be a trace on a printed circuit board, part of a cable that includes multiple serial links, or part of a bus.
Compute device 250 includes a receiver 260, RX LFSR 265, XOR logic, and LFSR synchronizer 275. The receiver 260 receives the scrambled data 220 via the link 230 and may buffer the data. The receiver 260 may forward the scrambled data 220 either as it arrives or in data chunks. As an example of the latter, the receiver 260 may receive a 64 bit training block which is buffered and then forwarded in small data chunks (e.g., 10 bit chunks). The output the receiver 260, RX LFSR 265, and XOR logic may be considered as an additive descrambler that recovers the original data (i.e., data out 215) from the scrambled data 220.
In one embodiment, RX LFSR 265 may be functionally (and structurally) equivalent to TX LFSR 210. Stated differently, if the same seed value is used to initialize both LFSR 210 and LFSR 265, then the outputs of these LFSRs are identical. For example, TX LFSR 210 and RX LFSR may have the same circuit structure as LFSR 100 in
However, before RX LFSR 265 can be used to descramble the scrambled data 220, the LFSR synchronizer 275 synchronizes RX LFSR 265 with TX LFSR 205. To do so, the synchronizer 275 uses the scrambled data and expected data 270 to generate register initialization values that are then used to initialize the registers of RX LFSR 265 in the same state as the registers of TX LFSR 210. For example, when synchronizing, compute device 205 outputs training data as data out 215 which is then scrambled and sent to compute device 250. In one embodiment, the training data is the same as the expected data 270 which is already stored in memory (not shown) on compute device 250. As will be discussed below, the LFSR synchronizer 275 compares the scrambled data to the expected (training) data 270 to determine an initialization state for RX LFSR 265 which matches the state of TX LFSR 210. After initializing RX LFSR 265, when compute device 205 transmits another (scrambled) training block, the scrambled data can be descrambled using the output of RX LFSR 265. If the descrambled data 280 matches the expected data 270 (i.e., the training data), the compute device 250 determines that RX LFSR 265 is in synch with TX LFSR 210.
At block 310, the receiving compute device determines the TX LFSR outputs used to generate the scrambled data by comparing the scrambled data to expected data. To do so, the LFSR synchronizer 275 in
Returning to
Once the future TX LFSR outputs (e.g., b64-b73) are known, the LFSR calculator 415 uses state logic 610 to derive the future state of the TX LSFR at Time 64, thereby determining what the state of the RX LSFR should be initialized to. That is, the output of logic 610 provides bits bS0-bS9 which when stored in the registers of the RX LSFR, put this LSFR in the same state as the state of the TX LSFR at Time 64. Thus, so long as the RX LSFR is initialized before Time 64 is reached, then the TX and RX LFSRs are in synch when the second (scrambled) training block is received.
Returning to
At block 330, the receiving compute device determines if the RX and TX LFSRs are synchronized. As will be discussed below, the transmitting compute device may transmit multiple training blocks to the receiving compute device. If the initialized RX LFSR successfully descrambles these training blocks—i.e., the descrambled data matches the pre-defined bit-sequence of the training data—then the LFSRs are synchronized. If synched, at block 335, the transmitting compute device begins transmitting data blocks to the receiving compute device. Unlike the training data in the training blocks, this data may not be predefined—i.e., the data blocks contain strings of logical ones and zeros that are unknown to the receiving compute device. Because the RX and TX LFSRs are synchronized, the receiving compute device can accurately descramble the data blocks and process the data. However, if the receiving compute device determines the TX and RX LFSRs are not synched, the flow chart 300 returns to block 305 where new initialization data for the RX LFSR is calculated using different TX LFSR outputs.
In another embodiment, the LFSR state calculator 415 may use the TX LFSR outputs 410 to calculate future TX LFSR outputs and determine if these outputs match received TX LFSR outputs. That is, instead of descrambling the second training block using the initialized RX LFSR to determine if the RX and TX LFSRs are synchronized, the LFSR state calculator 415 may use the bit advancer 605 to identify future TX LFSR outputs and determine if these outputs match the TX LFSR outputs identified using the XOR operation shown in
In this example, the LFSR state calculator 415 uses the earlier bits in the TX LFSR output 410 (e.g., b0-b9) to predict the future TX LFSR outputs and determine if these future outputs match the TX LFSR outputs 410 derived from the scrambled data 220 which was actually received (e.g., b54-63). Although this example discusses using bit sequences in the same training block, the same technique may be used across multiple training blocks. For example, the bit advancer 605 can use b0-b9 (or even more bits) from the first training block to calculate b64-b73 from the second training block. Once the second training block is received and XORed with the training data 405, the receiving computing device can compare b64-b73 from this operation to the values calculated by the bit advancer 605 to determine if they match. In this embodiment, the second computing device does not need to initialize the RX LFSR output before determining whether the LFSRs are in synch. Stated differently, the receiving computing device may first determine using the bit advancer 605 whether predicted TX LFSR outputs match the actual TX LFSR outputs 410 over one or more training blocks before determining a future state of the TX LFSR and initializing the RX LFSR 265 to match that state as shown in
Furthermore, the receiving compute device may perform both checks. That is, the receiving compute device may determine using the bit advancer 605 whether predicted TX LFSR outputs match the actual TX LFSR outputs 410 before determining a future state of the TX LFSR as well as initialing the RX LFSR 265 and ensuring its output (i.e., descrambled data) matches the pre-defined bit-sequence of the training data.
The structures and functions of the LFSR synchronizer 275 and LFSR state calculator 415 shown in
Regardless of which technique is used, if there is not a match, the flow chart 700 proceeds to block 710 where the receiving compute device determines if a predetermined number of mismatches occurred. For example, the compute device may receive multiple training blocks and determine if the received data matches expected data. In one embodiment, the predetermined number of mismatches may be two. Thus, if the receiving compute device detects only one mismatch, then the flow chart 700 returns to block 705 where a subsequent training block is received and evaluated. However, if two mismatches have been detected on two different training blocks, at block 715 the flow chart 700 returns to block 305 of
However, if at block 705 the receiving compute device determines that the received data matches the expected data, the flow chart 705 proceeds to block 720 to determine if a predetermined number of matches has occurred. For example, the receiving compute device may require five matches in a row before determining that the RX and TX LFSRs are synchronized. By requiring multiple matches, the receiving compute device may catch transmission errors that arise intermittently or occur only after several transmissions of training blocks.
If the requisite number of matches has not been detected, the flow chart 700 returns to block 705 to determine if data from a subsequent training block matches the expected data. However, if the condition at block 720 is satisfied, at block 730 the receiving compute device informs the transmitting compute device that the RX LFSR is in synch with the TX LFSR. To do so, the receiving compute device may transmit a different predefined data block (e.g., a second training data) to the transmitting compute device. Put differently, the receiving compute device indicates to the transmitting compute device that its LFSR is now synched by transmitted the second, different training data to the transmitting compute device. By determining the descrambled data includes the predefined bit sequence of the second training block, the transmitting compute device knows the RX LFSR on the receiving computing device is now synched with its LFSR.
At block 735, the flow chart 700 proceeds to block 335 of
In one embodiment, flow chart 700 may repeat using different training blocks that contain a different predefined bit sequence. That is, once the receiving compute device informs the transmitting compute device that the TX and RX LFSRs are in synch at block 730, in response, the transmitting compute device begins transmitting the different training blocks to the receiving compute device. These training blocks may have a bit sequence designed to catch different errors in the communication link between the devices than the bit sequence in the training data described above. However, if at block 720 the requisite number of matches is successfully detected using the new training data, the receiving compute device may transmit back to the transmitting compute device the new training data thereby indicating the TX and RX LFSRs are still in synch and normal operation can begin.
The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
In the preceding, reference is made to embodiments presented in this disclosure. However, the scope of the present disclosure is not limited to specific described embodiments. Instead, any combination of the following features and elements, whether related to different embodiments or not, is contemplated to implement and practice contemplated embodiments. Furthermore, although embodiments disclosed herein may achieve advantages over other possible solutions or over the prior art, whether or not a particular advantage is achieved by a given embodiment is not limiting of the scope of the present disclosure. Thus, the aspects, features, embodiments and advantages provided above are merely illustrative and are not considered elements or limitations of the appended claims except where explicitly recited in a claim(s). Likewise, reference to “the invention” shall not be construed as a generalization of any inventive subject matter disclosed herein and shall not be considered to be an element or limitation of the appended claims except where explicitly recited in a claim(s).
Aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.”
The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.
Claims
1.-7. (canceled)
8. A compute device, comprising:
- a receiving linear feedback shift register (LFSR);
- a receiver interface configured to receive training data scrambled using a transmitting LFSR on a separate compute device;
- a LFSR state calculator configured to: determine past output values used by the transmitting LFSR to scramble the training data by comparing the scrambled training data with expected data stored on the compute device, determine future output values of the transmitting LFSR based on the past output values, identify a plurality of registers values defining a future state of the transmitting LFSR based on the future output values, and initialize the receiving LFSR using the plurality of register values to synchronize the receiving LFSR with the transmitting LFSR.
9. The compute device of claim 8, further comprising:
- a serial link coupled to the receiver interface, the serial link is configured to transmit serial data between the compute device and the separate compute device.
10. The compute device of claim 8, wherein, when comparing the scrambled training data with the expected data to determine the past output values, the LFSR state calculator is configured to:
- perform an xor operation on the scrambled training data and the expected data to output the past output values, wherein the expected data comprises a predefined bit sequence that matches the training data before being scrambled using the transmitting LFSR.
11. The compute device of claim 8, wherein, when determining the future output values, the LFSR state calculator is configured to:
- perform a plurality of xor operations using the past output values to generate the future output values, wherein the future output values are generated before the transmitting LFSR is in the future state
12. The compute device of claim 8, wherein, when initializing the receiving LFSR, the LFSR state calculator is configured to:
- load each of a plurality of registers in the receiving LFSR with a respective one of the plurality of register values
13. The compute device of claim 12, wherein the training data is contained in a first training block, wherein the receiver interface is configured to receive a second training block containing the training data from the separate compute device, and wherein the receiving LFSR is configured to:
- after being initializing to the future state of the transmitting LFSR, descramble the second training block, wherein the transmitting LFSR was in the future state when scrambling the second training block.
14. The compute device of claim 13, further comprising:
- logic configured to compare the descrambled second training block to the expected data to determine whether the receiving and transmitting LFSRs are accurately synchronized.
15. A computer program product for initializing a receiving linear feedback shift register (LFSR), the computer program product comprising:
- a computer-readable storage medium having computer-readable program code embodied therewith, the computer-readable program code executable by one or more computer processors to: receive on a first compute device training data scrambled using the transmitting LFSR on a second compute device; determine past output values used by the transmitting LFSR to scramble the training data by comparing the scrambled training data with expected data stored on the first compute device; determine future output values of the transmitting LFSR based on the past output values; identify a plurality of registers values defining a future state of the transmitting LFSR based on the future output values; and initialize the receiving LFSR on the first compute device using the plurality of register values to synchronize the receiving LFSR with the transmitting LFSR.
16. The computer program product of claim 15, wherein comparing the scrambled training data with the expected data to determine the past output values comprises computer-readable program code further executable to:
- perform an xor operation on the scrambled training data and the expected data to output the past output values, wherein the expected data comprises a predefined bit sequence that matches the training data before being scrambled using the transmitting LFSR.
17. The computer program product of claim 15, wherein determining the future output values comprises computer-readable program code further executable to:
- perform a plurality of xor operations using the past output values to generate the future output values, wherein the future output values are generated before the transmitting LFSR is in the future state.
18. The computer program product of claim 15, wherein initializing the receiving LFSR comprises computer-readable program code further executable to:
- loading each of a plurality of registers in the receiving LFSR with a respective one of the plurality of register values.
19. The computer program product of claim 18, wherein the training data is contained in a first training block, the computer program product further comprising computer-readable program code further executable to:
- receive on the first compute device a second training block containing the training data;
- after initializing the receiving LFSR to the future state of the transmitting LFSR, descramble the second training block using the receiving LFSR, wherein the transmitting LFSR was in the future state when scrambling the second training block.
20. The computer program product of claim 19, further comprising computer-readable program code further executable to:
- compare the descrambled second training block to the expected data to determine whether the receiving and transmitting LFSRs are accurately synchronized.
Type: Application
Filed: May 26, 2015
Publication Date: Dec 1, 2016
Inventor: Paul A. GANFIELD (Rochester, MN)
Application Number: 14/721,738