Methods of programming an integrated circuit (IC) such as a programmable
logic device to avoid localized defects present in the IC, and ICs
capable of performing these methods. As part of an automated programming
process, programmable resources utilized by a user design are tested, and
the implemented user design is modified to avoid any defective
programmable resources that are detected. The modifications can include,
for example, rerouting one or more internal signals and/or substituting a
fully functional programmable resource for a defective programmable
resource. These methods are carried out by testing and implementation
logic included in the IC. Design information such as a software device
model, test program, test data, place and route program, and/or resource
swapping program can be optionally included in the configuration logic or
supplied in an expanded bitstream applied to the inventive IC. In some
embodiments, the modified bitstream is written to an external memory
device.