ASIC/FPGA Design and Verification Out Source Services
The following will describe the operation, which is done by the SD master. This code tests an SD slave for the very basics functionality. It comes with a rich data base of tasks, which allow to simulate other SD scenarios.
Please note, that this
project
was recently updated. The new one uses a Smasung flash instead of xilinx ROM component.
- Insert Card : Check that SD card is inserted.
- Send Command `GO_IDLE_STATE with argument 0 (CMD0).
- Wait for card not busy loop:
- Send Command `APP_CMD with argument 0 (CMD55).
- Get Response of kind R1.
- Get Response of kind R3 and check result.Decode Card Status. Message will also be displayed in simulation log. The program will stop ($finish) if an error bit is set (31..15, 3).
- Send Command `SD_APP_OP_COND with argument 0 (CMD41) and check result.
- Check operation conditions register (OCR) busy bit (bit 31). If busy continue loop (go to 3).
- Write my OCR to the card, move to ready state
- Send Command `APP_CMD with argument 0 (CMD55) and check result.
- Get Response of kind R1.
- Decode Card Status (same as 6).
- Send Command `SD_APP_OP_COND with argument OCR=32'hff8000 (CMD41) and check result.
- Get Response of kind R3 and check result.
- Read card id register (CID), move to ident state (identification).
- Send Command `ALL_SEND_CID with argument 0 (CMD2).
- Get Response of kind R3 and check result.
- Decode CID simply prints the information to the simulation log file.
- Read relative address (RCA) from card, move to stby state
- Send Command `SEND_RELATIVE_ADDR with argument 0 (CMD3).
- Get Response of kind R6 and check result.
- Decode Card Status (same as 6).
- Read card id from RCA address, remain in stby state
- Send Command `SEND_CID with argument RCA (CMD10).
- Get Response of kind R2 and check result.
- Decode CID simply prints the information to the simulation log file.
- Read card specific data (CSD) from RCA address, remain in stby state
- Send Command `SEND_CID with argument RCA (CMD10).
- Get Response of kind R2 and check result.
- Decode CID simply prints the information to the simulation log file.
- Select the card and move to trans state
- Send Command `SELECT_CARD with argument RCA (CMD7).
- Get Response of kind R1 and check result.
- Decode Card Status (same as 6).
- Set the read block length
- Send Command `SET_BLOCKLEN with argument `BLOCK_LENGTH_BYTES (CMD16).
- Get Response of kind R1 and check result.
- Decode Card Status (same as 6).
- Set the data bus width
- Send Command `APP_CMD with argument RCA (CMD55).
- Get Response of kind R1 and check result.
- Decode Card Status (same as 6).
- Send Command `SET_BUS_WIDTH with argument 2*(`READ_DATA_WIDTH-1) (ACMD6).
- Get Response of kind R1 and check result.
- Decode Card Status (same as 6).
- Read a block of data from the card
- Read Block
- Decode Card Status (same as 6).
- Reset to idle state
- Send Command `GO_IDLE_STATE with argument 0 (CMD0).
Contact me now at: |