you may look at existing solution, many boards have it works, say
http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,836&Prod=ATLYS,
or
http://danstrother.com/2011/01/16/spartan-6-bga-test-board/
I think there are test routines there, refer to xilinx link inside
above links