Save a program into a Spartan 3AN
The Spartan 3AN has a on-chip flash memory to store your "program".
You need to ensure you program the flash not the SRAM via JTAG to ensure your program is non-volatile 

http://www.xilinx.com/support/documentation/user_guides/ug333.pdf


  Spartan-3AN FPGAs include abundant In-System Flash (ISF) memory. The
  ISF memory array appears to a Spartan-3AN FPGA application as
  SPI-based serial Flash memory. The ISF memory is primarily designed to
  automatically configure the FPGA when power is applied or whenever the
  PROG_B pin is pulsed Low. However, the ISF memory array is large
  enough to store…


Make sure the mode select pins are configured to make use of the internal FLASH 

http://www.xilinx.com/support/documentation/user_guides/ug332.pdf


  Mode Select Pins, M[2:0] The Spartan-3AN FPGA family is generally
  designed to be pin and function compatible with the Spartan-3A/3A DSP
  FPGA families. The Spartan-3AN FPGA family supports all the same
  configuration modes as the Spartan-3A/3A DSP FPGAs and adds the
  ability to configure from the internal In-System Flash memory. To
  configure from Internal Master SPI Flash mode, the FPGA mode select
  pins must be set to M[2:0] = &lt;0:1:1>. Furthermore, the VCCAUX supply
  must be 3.3V.


http://www.xilinx.com/support/documentation/data_sheets/ds557.pdf