for 6.111 Introduction to Digital Systems
Flash ROM Testby Nathan Ickes
This test verifies that the labkit's flash ROM chip is working properly. As part of the test, the entire ROM is erased, so any data previously stored in it will be lost. At the end of the test, the ROM is erased again, so that it is left in a blank state.
No setup is necessary for this test, other than configuring the FPGA with the test program. Precompiled bitstreams can be downloaded below
The test begins running as soon as the FPGA is configured. First, the flash ROM's manufacturer and size identification codes are read. The expected manufacturer code is 0x0089 (Intel), and the expected size code is 0x0018 (128Mbit). If an incorrect code is read from the flash, the alphanumeric display will read "
After the identification codes are successfully read, the block write protection bits are cleared. Once the "clear lock bits" command has been issued to the ROM, the test program waits for the operation to finish, and then reads the ROM's status register. If any error flags are set, the test is stopped and the alphanumeric display will read "
Next, the entire ROM is erased. It takes approximately one second to erase each of the 128 blocks in device. During this process, the alphanumeric display indicates the address of the current block being erased. (The address of the last block is 0x7F0000.) The ROM's status register is checked after the erasure of every block. If an error flag becomes set, the test stops and the alphanumeric display will read "
Once the ROM is erased, the test program proceeds to write to every location in the ROM. The value written to a given location is computed from the location's address by the following Verilog expression:
data <= address[15:0] ^ address[22:16];The test program writes one word at a time: the write acceleration buffer is not used. The process of writing to the entire ROM therefore takes a long time: approximately 15 minutes. As in the other phases of the test, the ROM's status register is checked after every write, and any error codes cause the test process to stop. The display will read "
Next, the entire contents of the ROM are read back and compared with the expected values. If any location fails to verify, the test is stopped, and the display will read "
Finally, the entire ROM is erased again. If the erase completes without errors, the test is finished, and the display will read "
A few additional notes: the flash ROM is tested in 16-bit mode, so address line 0 is not used. The status signal (
Signals Available for ProbingThe following signals can be probed through either the logic analyzer connectors, or the user I/O banks. Note that these signals are only copies of the actual signals present at the flash device, buffered by the FPGA.
MIT 6.111 Introduction to Digital Systems, Updated April 05, 2005