A field programmable gate array (FPGA) is provided that can selectively accept or reject selected software (macros). Specifically, configuration data for the FPGA is passed through a configuration port to a decoder. The decoder processes the configuration data to detect locked macros. If a locked macro is detected, the decoder attempts to unlock the locked macro using one or more keys stored in a key table of the FGPA. If an appropriate key is in the key table, the decoder unlocks the locked macro to configure the FPGA. The keys can be pre-programmed into the FGPA by the macro vendor. If configuration data containing a locked macro is used with an FPGA without the appropriate key, configuration of the FPGA fails.
1. A method for configuring a field programmable gate array (FPGA), the method comprising: pre-programming a first key into a key table of said FPGA; processing configuration data in said FPGA to detect a first locked macro; and unlocking said first locked macro using said first key pre-programmed into said key table. 2. The method of claim 1, further comprising: pre-programming a second key into a key table of said FPGA; processing configuration data in said FPGA to detect a second locked macro; and unlocking said second locked macro using said second key pre-programmed into said key table. 3. The method of claim 1, wherein the step of unlocking said first locked macro comprises the step of decrypting said first locked macro using said first key. 4. The method of claim 1, wherein said first key comprises a header section and a key section. 5. The method of claim 4, wherein the step of pre-programming a first key comprises: storing said header section of said first key in a visible header section of said key table; and storing said key section of said first key in an invisible key section of said key table.
This application relates to concurrently filed, co-pending U.S. patent application Ser. No. 09/232,022, “FPGA CUSTOMIZABLE TO ACCEPT SELECTED MACROS”, by Burnham et al., owned by the assignee of this application and incorporated herein by reference. This application relates to concurrently filed, co-pending U.S. patent application Ser. No. 09/231,528, “METHOD TO SECURELY CONFIGURE AN FPGA USING ENCRYPTED MACRO”, by Burnham, owned by the assignee of this application and incorporated herein by reference. This application relates to concurrently filed, co-pending U.S. patent application Ser. No. 09/231,912, “METHODS TO SECURELY CONFIGURE AN FPGA USING MACRO MARKERS”, by Burnham et. al., owned by the assignee of this application and incorporated herein by reference. This application relates to U.S. patent application Ser. No. 09/000,519, entitled “DECODER STRUCTURE AND METHOD FOR FPGA CONFIGURATION” by Gary R. Lawman, which is also incorporated herein by reference. The present invention relates to programmable devices such as field programmable gate arrays (FPGAs). More specifically, the present invention relates to methods for programming and enabling licensed macros in an FPGA. Due to advancing semiconductor processing technology, integrated circuits have greatly increased in functionality and complexity. For example, programmable devices such as field programmable gate arrays (FPGAs) and programmable logic devices (PLDS), can incorporate ever-increasing numbers of functional blocks and more flexible interconnect structures to provide greater functionality and flexibility. FPGA 110 also includes dedicated internal logic. Dedicated internal logic performs specific functions and can only be minimally configured by a user. For example, configuration port 120 is one example of dedicated internal logic. Other examples may include dedicated clock nets (not shown), power distribution grids (not shown), and boundary scan logic (i.e. IEEE Boundary Scan Standard 1149.1, not shown). FPGA 110 is illustrated with 16 CLBs, 16 IOBs, and 9 PSMs for clarity only. Actual FPGAs may contain thousands of CLBs, thousands of IOBs, and thousands of PSMs. The ratio of the number of CLBs, IOBS, and PSMs can also vary. FPGA 110 also includes dedicated configuration logic circuits to program the user logic circuits. Specifically, each CLB, IOB, PSM, and PIP contains a configuration memory (not shown) which must be configured before each CLB, IOB, PSM, or PIP can perform a specified function. Some FPGAs may also include pre-configured logic circuits that are configured by the manufacturer to perform specific functions. For example, some FPGAs are pre-configured to include a PCI bus interface. Typically the configuration memories within an FPGA use static random access memory (SRAM) cells. The configuration memories of FPGA 110 are connected by a configuration structure (not shown) to configuration port 120 through a configuration access port (CAP) 125. A configuration port (a set of pins used during the configuration process) provides an interface for external configuration devices to program the FPGA. The configuration memories are typically arranged in rows and columns. The columns are loaded from a frame register which is in turn sequentially loaded from one or more sequential bitstreams. (The frame register is part of the configuration structure referenced above.) In FPGA 110, configuration access port 125 is essentially a bus that couples configuration port 120 to the configuration structure of FPGA 110. As explained above, actual FPGAs can have thousands of CLBs, IOBs, PSMs, and PIPs; therefore, the design and development of FPGA software is very time-consuming and expensive. Consequently, many vendors provide macros for various functions that can be incorporated by an end user of the FPGA into the user's own design file. For example, Xilinx, Inc. provides a PCI interface macro, which can be incorporated by an end user into the user's design file. The user benefits from the macro because the user does not need to spend the time or resources to develop the macro. Further, since the vendor profits from selling the same macro to many users, the vendor can spend the time and resources to design optimized macros. For example, the vendor strives to provide macros having high performance, flexibility, and low gate count. However, the macro vendors are reluctant to give out copies of the design macros without a way of insuring that the design macros are used only by licensed users. Hence, there is a need for a method or structure to insure third party macros are used only by licensed end users. The present invention uses on-chip keys, i.e., keys programmed into the chip, to unlock locked macros before the macros will function. Thus, macro vendors can freely distribute locked macros as long as the key to the macro is secure. A macro vendor locks a macro using a lock to create a locked macro. A corresponding key is placed within the FPGA in a write-only memory or a write and read once memory. (A read-once memory is a memory that can be read back only once, e.g., for manufacturing test purposes.) During configuration of the FPGA, a decoder detects the locked macro and uses the key to unlock the locked macro. An FPGA in accordance with one embodiment of the present invention comprises a configuration port, a decoder coupled to the configuration port, a key table coupled to the decoder and the configuration port, and a configuration access port coupled to the decoder. In one embodiment the key table is a memory that is write-only from outside the FPGA. However, in another embodiment, the key table has visible header sections and invisible key sections. The visible header sections can be written to and read from outside the FPGA via the configuration port. The invisible key sections are write-only from outside the FPGA. When an end user wishes to incorporate a locked macro from a macro vendor, the macro vendor pre-programs a key into the key table of the FPGA. The end user creates a design file incorporating the locked macro. The design file is then converted into configuration data for the FPGA. The configuration data is sent into the configuration port of the FPGA. The on-chip decoder processes the configuration data and detects the locked macro. When the locked macro is detected, the decoder uses the key in the key table to unlock the locked macro. If the key table does not contain a key able to unlock the locked macro, configuration of the FPGA fails. If additional locked macros are desired, the macro vendor can pre-program additional keys into the FPGA. Thus, a macro vendor can freely distribute the locked macros without concern of unlicensed use as long as the keys to the locked macro are secure. In accordance with another embodiment of the present invention, multiple macro vendors can safely distribute locked macros. For example, if an end user desires a first locked macro from a first macro vendor and a second locked macro from a second macro vendor, a key manager can prepare the FPGA by pre-programming both a first key, which is configured to unlock the first locked macro, and a second key, which is configured to unlock the second locked macro, into the key table of an FPGA. The key manager obtains the first key from the first macro vendor and the second key from the second macro vendor. The key manager must keep the keys confidential and secured away from the end user. The locked macros can be freely distributed to the end user, since the end user must purchase the keyed FGPA, i.e., an FPGA having the appropriate keys, from the key manager. The key manager can distribute appropriate licensing fees to the macro vendors. In accordance with another embodiment of the present invention, an end user is provided with a key programming tool. The key programming tool is used to pre-program keys into an FPGA. In one embodiment, encrypted keys are distributed to the end user. The end user uses the key programming tool, which is configured to obtain authorization from a macro vendor to use the key. The end user is never given access to the decrypted key. The key programming tool may also be configured to notify the macro vendor that a key is being pre-programmed, so that the macro vendor can collect the appropriate licensing fee. In another embodiment, the key programming tool obtains the keys directly from the macro vendor over a secure medium, such as a telephone line or an encrypted channel of a public network such as the internet. Thus, the present invention advantageously enables macro vendors to freely distribute locked macros without losing licensing fees. Because the licensing fees are secured, macro vendors are motivated to rapidly introduce new and improved macros for end users. The present invention will be more fully understood in view of the following description and drawings. Decoder 330 processes the configuration data to locate locked macros. Locked macros are macros that are coded so that an FPGA can be programmed with the macro only if the FPGA was pre-programmed with the corresponding key. Alternatively, some locked macros can be loaded into an FPGA, but will only function if the FPGA contains the corresponding key. If decoder 330 detects a locked macro, decoder 330 attempts to use the pre-programmed keys from key table 340 to unlock the locked macro. If key table 340 contains an appropriate key, the locked macro is configured into FPGA 300 through configuration access port 325. In some embodiments, if no valid key is found in key table 340, decoder 330 causes a configuration error and halts the configuration of FPGA 300. In some embodiments the configuration of FPGA 300 proceeds to completion, but the locked macro does not function. Configuration data that is not part of a locked macro is stored in the appropriate configuration memories through configuration access port 325. A detailed example of configuring locked macros in FPGA 300 is explained below with respect to FIG. 5. In some embodiments, public/private key encryption is used to lock the macros. As is well known in the art, in public/private key encryption a message is encrypted using a public key to form an encrypted message. The message can only be decrypted by a private key that corresponds to the public key. Thus, the public key can be freely distributed, while the private key must be kept secret. For the present invention, a macro can be encrypted using a public key. The macro is then combined with the public key or a header indicating which public key was used for encryption to form a locked macro. A specific private key, which corresponds to the public key, is required to decrypt the locked macro. Thus, decoder 330 requires that the specific private key is accessible in key table 340 to unlock the locked macro. The public/private key system is not an integral part of the present invention. For example, some embodiments of the present invention use asymmetric (public key) cryptosystems such as the RSA (Rivest, Shamir, Adleman) algorithm (which are implemented in PGP) or DSA (Digital Signature Algorithm), where the key used for encryption (public) is different from the key used for decryption (private). Other embodiments use symmetric (conventional, “secret key”) cryptosystems such as DES (Data Encryption Standard) or BLOWFISH, where the same key is used for both encryption and decryption. To avoid confusion, the terms public key and private key are not used further herein. Instead, the encrypting key is referred to as the lock, while the decrypting key is referred to simply as the key. The lock and the key (i.e., the encrypting and decrypting keys) may be the same or they may be different. In one embodiment, key table 340 is a memory that is write only from outside FPGA 300. Decoder 330 can read key table 340. However decoder 330 does not disclose the contents of key table 340 through configuration port 320. Thus, once a key is placed in key table 340 of FPGA 300, the key cannot be retrieved from FPGA 300. In one embodiment, key table 340 comprises FLASH RAM cells. In one embodiment, for large key tables, the visible header section is used as a content addressable memory to rapidly determine whether the key to a specific locked macro is stored in key table 340. Specifically, each locked macro contains information regarding the header of the appropriate key; for example, the numeric representation of the macro vendor and the numeric representation for the specific macro from the macro vendor. Decoder 330 ( Configuration data 540 is fed into FPGA 300 through configuration port 320. Decoder 330 processes configuration data 540 to determine if configuration data 540 contains any locked macros. When decoder 330 detects locked macro 510_c, decoder 330 accesses key table 340 to determine if key table 340 contains a key to unlock locked macro 510_c. In the example depicted in In many situations, an end user may wish to incorporate locked macros from multiple macro vendors into a single design file. End user 630 obtains locked macro 725 from macro vendor 720 and locked macro 625 from macro vendor 620. Thus, end user 630 has the desired locked macros for his design file and a properly keyed FPGA (i.e., keyed FPGA 745) to receive the design file. Thus, end user 630 can create a programmed FPGA 735, which implements locked macro 725 from macro vendor 720 and locked macro 625 from macro vendor 620. In one embodiment, key programming tool contacts the appropriate macro vendor to obtain the desired key over a secure medium. For example, in In another embodiment, encrypted versions of keys 624 and 724 are distributed directly to end user 630. However, only key programming tool 830 can decrypt and pre-program FPGA 615 with keys 624 and 724. Key programming tool 830 is configured to contact macro vendor 620 to obtain approval from macro vendor 620 before pre-programming key 624 into FPGA 615. Alternatively, key programming tool 830 can be configured to notify macro vendor 620 each time an FPGA is pre-programmed with key 624. Similarly, key programming tool 830 is configured to contact macro vendor 720 before pre-programming FPGA 615 with key 724. After pre-programming FPGA 615 with keys 724 and 624, end user 630 can create programmed FPGA 735 using (for example) the method illustrated in FIG. 5. In the various embodiments of this invention, methods and structures have been described to securely distribute and use third party macros. By locking a macro so that a key is required in the FPGA to use the macro, macro vendors prevent unlicensed use of macros. Furthermore, by using a key manager or a key programming tool, an end user can easily incorporate macros from different macro vendors in a single FPGA design file. By providing a secure method to distribute macros, macro vendors are motivated to expend the time and effort to create large libraries of optimized macros to sell to end users. Thus, the cost and time for creating design files for FPGAs by an end user can be reduced through the use of macros from macro vendors. The various embodiments of the structures and methods of this invention that are described above are illustrative only of the principles of this invention and are not intended to limit the scope of the invention to the particular embodiments described. For example, in view of this disclosure, those skilled in the art can define other decoders, locked macros, keys, key tables, key programming tools, configuration devices, FPGAs, CLBs, IOBs, PSMs, configuration access ports, configuration ports, and so forth, and use these alternative features to create a method, circuit, or system according to the principles of this invention. Thus, the invention is limited only by the following claims.CROSS-REFERENCE TO RELATED APPLICATIONS
FIELD OF THE INVENTION
BACKGROUND OF THE INVENTION
SUMMARY OF THE INVENTION
BRIEF DESCRIPTION OF THE DRAWINGS
DETAILED DESCRIPTION OF THE DRAWINGS