Programmable device using fixed and configurable logic to implement floating-point rounding

A configurable specialized processing block includes a first floating-point arithmetic operator stage, a second floating-point arithmetic operator stage, and configurable interconnect within the configurable specialized processing block for routing signals into and out of each of the first and second floating-point arithmetic operator stages. In some embodiments, the configurable interconnect may be configurable to route a plurality of block inputs to inputs of the first floating-point arithmetic operator stage, at least one of the block inputs to an input of the second floating-point arithmetic operator stage, output of the first floating-point arithmetic operator stage to an input of the second floating-point arithmetic operator stage, at least one of the block inputs to a direct-connect output to another such block, output of the first floating-point arithmetic operator stage to the direct-connect output, and a direct-connect input from another such block to an input of the second floating-point arithmetic operator stage.

FIELD OF THE INVENTION

This invention relates to a programmable integrated circuit device, and particularly to a configurable specialized processing block in a programmable integrated circuit device.

BACKGROUND OF THE INVENTION

Considering a programmable logic device (PLD) as one example of an integrated circuit device, as applications for which PLDs are used increase in complexity, it has become more common to design PLDs to include configurable specialized processing blocks in addition to blocks of generic programmable logic resources. Such configurable specialized processing blocks may include a concentration of circuitry on a PLD that has been partly or fully hardwired to perform one or more specific tasks, such as a logical or a mathematical operation. A configurable specialized processing block may also contain one or more specialized structures, such as an array of configurable memory elements. Examples of structures that are commonly implemented in such configurable specialized processing blocks include: multipliers, arithmetic logic units (ALUs), barrel-shifters, various memory elements (such as FIFO/LIFO/SIPO/RAM/ROM/CAM blocks and register files), AND/NAND/OR/NOR arrays, etc., or combinations thereof.

These fixed-logic elements within the configurable specialized processing blocks are interconnected by a configurable interconnect structure within the configurable specialized processing block. They may also be able to accept parameters as well as data inputs. Thus, while the elements are fixed in the type of arithmetic or logical functions that they perform, their interconnection within the block is flexible under user control, and moreover, if an element accepts parameters, then the way in which it performs its fixed function may be subject to a degree of user control. In addition, it may be possible to route the outputs of some or all of the fixed-logic elements within a block either to another fixed-logic element within the block or directly out of the block.

One particularly useful type of configurable specialized processing block that has been provided on PLDs is a digital signal processing (DSP) block, which may be used to process, e.g., audio signals. Such blocks are frequently also referred to as multiply-accumulate (“MAC”) blocks, because they include structures to perform multiplication operations, and sums and/or accumulations of multiplication operations.

For example, PLDs sold by Altera Corporation, of San Jose, Calif., as part of the STRATIX® and ARRIA® families include DSP blocks, each of which includes a plurality of multipliers. Each of those DSP blocks also includes adders and registers, as well as programmable connectors (e.g., multiplexers) that allow the various components of the block to be configured in different ways.

Typically, the arithmetic operators (adders and multipliers) in such configurable specialized processing blocks have been fixed-point operators. If floating-point operators were needed, the user would construct them outside the configurable specialized processing block using general-purpose programmable logic of the device, or using a combination of the fixed-point operators inside the configurable specialized processing block with additional logic in the general-purpose programmable logic.

SUMMARY OF THE INVENTION

In accordance with embodiments of the present invention, configurable specialized processing blocks such as the DSP blocks described above may be enhanced by including floating-point addition among the functions available in the DSP block. This reduces the need to construct floating-point functions outside the configurable specialized processing block. The addition function may be a wholly or partially dedicated (i.e., “hard logic”) implementation of addition in accordance with the IEEE754-1985 standard, and can be used for addition operations, multiply-add (MADD) operations, or vector (dot product) operations, any of which can be either real or complex. The floating-point adder circuit may be incorporated into the DSP Block, and can be independently accessed, or used in combination with a multiplier in the DSP block, or even multipliers in adjacent DSP blocks.

While rounding operations for the floating-point arithmetic operations in the configurable specialized processing block may be performed completely outside the configurable specialized processing block in the general-purpose programmable logic of the programmable device, in accordance with other embodiments of the invention, rounding operations may be performed partly inside the configurable specialized processing block and partly outside the configurable specialized processing block. This allows at least the portions of the rounding operations that are inefficient when performed in the general-purpose programmable logic to be performed in fixed logic.

Therefore, in accordance with embodiments of the present invention there is provided a configurable specialized processing block on a programmable integrated circuit device. The specialized processing block includes a first floating-point arithmetic operator stage, a second floating-point arithmetic operator stage, configurable interconnect within the configurable specialized processing block for routing signals into and out of each of the first and second floating-point arithmetic operator stages, and fixed rounding circuitry for performing a partial rounding operation on output of the second floating-point arithmetic operator stage. There is also provided a programmable integrated circuit device including a plurality of such configurable specialized processing blocks, with additional circuitry configured as additional rounding circuitry, as well as a method of configuring such a device.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1shows a logical diagram of an exemplary DSP block100according to an embodiment of the invention. In this logical representation, implementational details, such as registers and some programmable routing features—such as multiplexers that may allow the output of a particular structure to be routed directly out of block100—are omitted to simplify discussion. In addition, some elements that are shown may, in an actual embodiment, be implemented more than once. For example, the multiplier101may actually represent two or more multipliers, as in the DSP blocks of the aforementioned STRATIX® and ARRIA® families of PLDs.

In the logical representation ofFIG. 1, the floating-point adder102follows a floating-point multiplier101. The floating-point multiplier may be constructed from a 27×27 fixed-point multiplier supported by the DSP block provided in STRATIX® V or ARRIA® V programmable devices from Altera Corporation, and some additional logic. The additional logic calculates exponents, as well as special and error conditions such as NAN (not-a-number), Zero and Infinity. Optionally, other logic may be provided to round the result of the multiplier to IEEE754 format. Such rounding can be implemented as part of the final carry-propagate adder within the multiplier structure (not shown), or in programmable logic outside the DSP block100when the output of the multiplier101is outputted directly from the DSP block100.

The floating point multiplier101can feed the floating point adder102directly in a multiplier-add (MADD) mode, as depicted inFIG. 1. Alternatively, as depicted inFIG. 1A, the multiplier101output can be routed around the adder102directly to the output of the DSP block, with a multiplexer103provided to select between the output of the multiplier101or the output of the adder102. Although the bypass104and multiplexer103are omitted from the other drawings to avoid cluttering those drawings, they should be considered to be present in all of the multiplier/adder DSP blocks shown, including that ofFIG. 1.

FIG. 2shows a more detailed diagram of an exemplary DSP block200according to an embodiment of this invention. Optionally bypassable pipelining (not shown) may be provided between the floating-point multiplier101and the floating-point adder102. Optionally bypassable pipelining (not shown) can also be provided within either or both of the floating-point multiplier101and the floating-point adder102. Inputs can be routed to the adder102from multiple sources, including an output of the multiplier101, one of the inputs201to the DSP block200, or a direct connection202from an adjacent similar DSP block200.

In addition, the output of multiplier101and/or one of the inputs201to the DSP block200, can also be routed via a direct connection212to the adder in an adjacent similar DSP block200(it being apparent that, except at the ends of a chain of blocks200, each direct connection202receives its input from a direct connection212, and that each direct connection212provides its output to a direct connection202). Specifically, multiplexer211may be provided to select either input201or direct connection202as one input to adder102. Similarly, multiplexer221may be provided to select either input201or the output of multiplier101as another input to adder102. A third multiplexer231may be provided to select either input201or the output of multiplier101as the output to direct connection212. Thus the inputs to adder102can be either input201and the output of multiplier101, or input201and direct connection202, and direct connection212can output either input201or the output of multiplier101.

In one embodiment, multiplexer221and multiplexer231, which have the same two inputs (input201and the output of multiplier101), share a control signal, but in the opposite sense as indicated at241, so that if one of the two multiplexers selects one of those two inputs, the other of the two multiplexers selects the other of those two inputs.

Multiple DSP blocks according to embodiments of the invention may be arranged in a row or column, so that information can be fed from one block to the next using the aforementioned direct connections202/212, to create more complex structures.FIG. 3shows a number of exemplary DSP blocks301according to an embodiment of the invention, arranged in a row300(without showing connections202/212).

FIG. 4shows a row400of five exemplary DSP blocks401-405according to an embodiment of the invention configured to perform a dot product operation. Alternatively, the DSP blocks401in that configuration could be arranged in a column (not shown) without changing the inputs and outputs. The drawing shows the interface signals. In each pair of blocks401/402and403/404, the multiplier101in each block, along with the adder102in the leftmost block401,403of the two blocks, implement a respective sum411,412of two multiplication operations. Those sums411,412are summed with the rightmost adder of the leftmost pair—i.e., adder102of DSP block402—using multiplexer211to select input202and using multiplexer221to select input201(to which the respective output411/412has been routed, e.g., using programmable interconnect resources of the PLD outside the blocks401-404)—to provide a sum of four multiplies. The rightmost adder of the rightmost pair—i.e., adder102of DSP block404is used to add this sum of four multiplies to the sum of four multiplies from another set of four DSP blocks beginning with DSP block405(remainder not shown). For N multipliers there will be N adders, which is sufficient to implement the adder tree of a dot product, which, for a pair of vectors of length N, is the sum of N multiplication operations.

The same DSP block features can be used to implement a complex dot product. Each second pair of DSP blocks would use a subtraction rather than an addition in the first level addition, which can be supported by the floating-point adder (e.g., by negating one of the inputs, in a straightforward manner). The rest of the adder tree is a straightforward sum construction, similar to that described in the preceding paragraph.

For the illustrated method of adder tree implementation, each DSP block output other than the output of the last block is fed back to the input of another DSP block. In some cases the output is fed back to an input of the same block, such as the EF+GH output412inFIG. 4. As seen inFIG. 2, an internal bus250may be provided to feed the output register of a block back to an input register, saving routing resources in the general-purpose programmable logic portion of the device.FIG. 5shows in phantom an exemplary selection of datapaths by multiplexers211,221,231for the dot product application example described earlier in connection withFIG. 4, showing how adder102of each block401-405adds a product of the multiplier101in that block and a product from an adjacent block.

Another embodiment of a dedicated floating-point processing block is a dedicated floating-point adder block. Such a block can be binary (2 input operands) or ternary (3 input operands).FIG. 6shows a logical block diagram of an exemplary ternary adder block600. As with the previously described DSP block, pipelining may or may not be used internally, and rounding may be supported either internally or externally in programmable logic. Also as with the DSP block, the adder blocks can be arranged in rows, as shown in the example inFIG. 7, or columns. Alternatively, adder blocks can be interleaved (not shown) with the multiplier-adder DSP blocks described above.

FIG. 8shows, using labels, exemplary connections used with blocks600arranged as inFIG. 7to make a ternary floating-point adder tree. The ternary adder tree has a depth of log3N, which is half that of a binary adder. In this example, N=9, and four blocks are arranged in two levels (depth=log3(9)=2).

As discussed above, IEEE754-compliant rounding can be provided inside embodiments of the DSP block, or can be implemented in the general-purpose programmable logic portion of the device.FIG. 9shows as an example the arrangement ofFIG. 4with rounding implemented at910outside the block—i.e., in the general-purpose programmable logic portion of the device. The rounding can be implemented with a single level of logic, which may be as simple as a carry-propagate adder, followed by a register. Assuming, as is frequently the case, that all of the outputs of the DSP blocks must be rounded, there would be no disturbance or rebalancing of the datapath required.

As further discussed above, rounding can be implemented partly inside the configurable specialized processing block and partly outside the configurable specialized processing block in the general-purpose programmable logic. Generally, portions of the rounding circuitry that are difficult or inefficient to implement in general-purpose programmable logic could be implemented in fixed logic in a configurable specialized processing block, while other portions of the rounding circuitry could be implemented in the general-purpose programmable logic. Three variants of such a scenario are illustrated inFIGS. 10-12.

In a first variant shown inFIG. 10, portion1001of rounding circuitry1000is located within configurable specialized processing block1010, while portion1002of rounding circuitry1000is located outside configurable specialized processing block1010, in the general-purpose programmable logic. Portion1001is focused on calculation of an overflow condition of the output value, while portion1002calculates the value of a final exponent, as well as special or error conditions based on the overflow condition or lack thereof.

Specifically, register1011contains the mantissa of the final value calculated in configurable specialized processing block1010—the final addition result—including normalized mantissa bits having a least-significant bit (LSB), as well as round (R), guard (G) and “sticky” (S) bits beyond the least significant bit, prior to rounding. Register1012contains the normalized exponent bits prior to rounding.

“Round” circuit1013determines, based on the least-significant, round, guard and sticky bits, whether or not rounding is needed. For example, one condition in which rounding is not needed is where LSB, R, G and S are all ‘0’. Output1014of circuit1013is routed to circuitry1002outside block1010, and also to overflow detection circuitry1015inside block1010. Overflow detection circuitry1015may be implemented, as shown, by AND-gate1016that ANDs all of the normalized mantissa bits down to the LSB. If all of those bits are ‘1’, there may be an overflow if there is rounding, so AND-gate1016outputs a ‘1’ and otherwise outputs a ‘0’. That output is ANDed at1017with the round output1014and if the result is a ‘1’, there is an overflow, so that ‘1’ is added at1018, outside block1010, to the previously calculated exponent to yield rounded exponent1019. AND-gates1016and1017can be replaced with a single larger AND-gate (not shown).

Round output1014also is added outside block1010in adder1020, to the normalized mantissa bits to yield rounded mantissa1021. Rounded mantissa1021and rounded exponent1019are input to exception handling circuitry1022which determines, e.g., whether the result has an absolute value greater than the largest representable number (2127in IEEE754 single-precision arithmetic), and therefore should be set to ±∞, or whether the result has an absolute value smaller than the smallest representable number (2−126in IEEE754 single-precision arithmetic), and therefore should be set to ‘0’. The result is the final output mantissa1023and final output exponent1024.

Other exception conditions may also be determined, such as NaN (not a number), but may require additional inputs. For example, an NaN condition is frequently the result of invalid inputs to the operators, so those inputs may also need to be provided directly (not shown) to exception handling circuitry1022in addition to being provided to the operators. Similarly, in the case of an NaN condition, the mantissa and exponent outputs1023,1024would be meaningless and a separate NaN output (not shown) from exception handling circuitry1022might be provided.

In a second variant shown inFIG. 11, portion1101of rounding circuitry1100is located within configurable specialized processing block1010, while portion1102of rounding circuitry1100is located outside configurable specialized processing block1010, in the general-purpose programmable logic. Portion1101is similar to portion1001inFIG. 10, except that exponent adder1018has been moved inside block1010as part of portion1101. This is possible because the number of bits in the exponent is much smaller than the number of bits in the mantissa, so that unlike adder1020, adder1018can be efficiently implemented inside block1010. To maintain timing, rounded exponent register1019also is moved into portion1101inside block1010.

In a third variant shown inFIG. 12, portion1201of rounding circuitry1200is located within configurable specialized processing block1010, while portion1202of rounding circuitry1200is located outside configurable specialized processing block1010, in the general-purpose programmable logic. In this variant, exception handling1022as well as final exponent register1024are moved into portion1201inside block1010, while only mantissa adder1020and final mantissa register1023remain in portion1202in the general-purpose programmable logic. Multiplexers1211and1221determine whether the rounded mantissa data or the exception values are output to adder1020.

By providing configurable specialized processing blocks, including dedicated but configurable floating point operators, the present invention allows the implementation of certain operations, such as the vector dot product described above, with less reliance on programmable logic outside the blocks.

Instructions for carrying out a method according to this invention for programming a programmable device may be encoded on a machine-readable medium, to be executed by a suitable computer or similar device to implement the method of the invention for programming or configuring PLDs or other programmable devices. For example, a personal computer may be equipped with an interface to which a PLD can be connected, and the personal computer can be used by a user to program the PLD using suitable software tools.

FIG. 13presents a cross section of a magnetic data storage medium1300which can be encoded with a machine executable program that can be carried out by systems such as the aforementioned personal computer, or other computer or similar device, or encoded with a library of virtual fabrics. Medium1300can be a floppy diskette or hard disk, or magnetic tape, having a suitable substrate1301, which may be conventional, and a suitable coating1302, which may be conventional, on one or both sides, containing magnetic domains (not visible) whose polarity or orientation can be altered magnetically. Except in the case where it is magnetic tape, medium1300may also have an opening (not shown) for receiving the spindle of a disk drive or other data storage device.

The magnetic domains of coating1302of medium1300are polarized or oriented so as to encode, in manner which may be conventional, a machine-executable program, for execution by a programming system such as a personal computer or other computer or similar system, having a socket or peripheral attachment into which the PLD to be programmed may be inserted, to configure appropriate portions of the PLD, including its configurable specialized processing blocks, if any, in accordance with the invention.

FIG. 14shows a cross section of an optically-readable data storage medium1310which also can be encoded with such a machine-executable program, which can be carried out by systems such as the aforementioned personal computer, or other computer or similar device, or encoded with a library of virtual fabrics. Medium1310can be a conventional compact disk read-only memory (CD-ROM) or digital video disk read-only memory (DVD-ROM) or a rewriteable medium such as a CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+RW, or DVD-RAM or a magneto-optical disk which is optically readable and magneto-optically rewriteable. Medium1310preferably has a suitable substrate1311, which may be conventional, and a suitable coating1312, which may be conventional, usually on one or both sides of substrate1311.

In the case of a CD-based or DVD-based medium, as is well known, coating1312is reflective and is impressed with a plurality of pits1313, arranged on one or more layers, to encode the machine-executable program. The arrangement of pits is read by reflecting laser light off the surface of coating1312. A protective coating1314, which preferably is substantially transparent, is provided on top of coating1312.

In the case of a magneto-optical disk, as is well known, coating1312has no pits1313, but has a plurality of magnetic domains whose polarity or orientation can be changed magnetically when heated above a certain temperature, as by a laser (not shown). The orientation of the domains can be read by measuring the polarization of laser light reflected from coating1312. The arrangement of the domains encodes the program as described above.

A PLD90incorporating configurable specialized processing blocks according to the present invention may be used in many kinds of electronic devices. One possible use is in an exemplary data processing system900shown inFIG. 15. Data processing system900may include one or more of the following components: a processor901; memory902; I/O circuitry903; and peripheral devices904. These components are coupled together by a system bus905and are populated on a circuit board906which is contained in an end-user system907.

System900can be used in a wide variety of applications, such as computer networking, data networking, instrumentation, video processing, digital signal processing, or any other application where the advantage of using programmable or reprogrammable logic is desirable. PLD90can be used to perform a variety of different logic functions. For example, PLD90can be configured as a processor or controller that works in cooperation with processor901. PLD90may also be used as an arbiter for arbitrating access to a shared resources in system900. In yet another example, PLD90can be configured as an interface between processor901and one of the other components in system900. It should be noted that system900is only exemplary, and that the true scope and spirit of the invention should be indicated by the following claims.

Various technologies can be used to implement PLDs90as described above and incorporating this invention.

It will be understood that the foregoing is only illustrative of the principles of the invention, and that various modifications can be made by those skilled in the art without departing from the scope and spirit of the invention. For example, the various elements of this invention can be provided on a PLD in any desired number and/or arrangement. One skilled in the art will appreciate that the present invention can be practiced by other than the described embodiments, which are presented for purposes of illustration and not of limitation, and the present invention is limited only by the claims that follow.