FAT32 IP Core for SATA Data Sheet
DG SATA HCTL-IP and DG SATA-IP
Core Facts |
|
Provided with Core |
|
Documentation |
Reference Design Manual Demo Instruction Manual |
Design File Formats |
Encrypted Netlist |
Instantiation Templates |
VHDL |
Reference Designs & Application Notes |
Vivado Project, See Reference Design Manual |
Additional Items |
Demo on AC701, KC705, ZC706, VC707, KCU105 |
Support |
|
Support Provided by Design Gateway Co., Ltd. |
54 BB Building 14th Fl., Room No.1402 Sukhumvit 21 Rd. (Asoke), Klongtoey-Nua, Wattana, Bangkok 10110
Phone: 66(0)2-261-2277
Fax: 66(0)2-261-2290
E-mail: ip-sales@design-gateway.com
URL: www.design-gateway.com
· Simple user interface
· Operating with DG SATA HCTL IP Core
· Implement FAT32 file system management without CPU usage
· Maximum write speed up to 520 MB/s and read speed up to 560 MB/s
· Support disk capacity: 64 MB 2 TB disk
· Support three commands, i.e. Format, Write file, and Read file
· Support seven file sizes, i.e. 32MB, 64MB, 128MB, 256MB, 512MB, 1024MB, 2048MB
· Reference design available on KC705/VC707/VC709/ZC706/KCU105 board with AB09-FMCRAID adapter board
Table 1: Example Implementation Statistics for Ultrascale device
Family |
Example Device |
Fmax (MHz) |
CLB Regs |
CLB LUTs |
CLB |
IOB |
BRAMTile1 |
PLL |
GTX |
Design Tools |
Kintex-Ultrascale |
XCKU040FFVA1156-2E |
416 |
1046 |
1272 |
238 |
- |
1.5 |
- |
- |
Vivado2015.4 |
Table 2: Example Implementation Statistics for 7-Series device
Family |
Example Device |
Fmax (MHz) |
Slice Regs |
Slice LUTs |
Slices |
IOB |
BRAMTile1 |
PLL |
GTX |
Design Tools |
Artix-7 |
XC7A200TFBG676-2 |
263 |
1056 |
1178 |
417 |
- |
1.5 |
- |
- |
Vivado2015.4 |
Kintex-7 |
XC7K325TFFG900-2 |
344 |
1056 |
1222 |
426 |
- |
1.5 |
- |
- |
Vivado2015.4 |
Zynq-7000 |
XC7Z045FFG900-2 |
344 |
1056 |
1223 |
439 |
- |
1.5 |
- |
- |
Vivado2015.4 |
Virtex-7 |
XC7VX690TFFG1761-2 |
333 |
1056 |
1222 |
435 |
- |
1.5 |
- |
- |
Vivado2015.4 |
Figure 1: FAT32 IP for SATA Block Diagram
FAT32 IP Core for SATA operating with SATA HCTL IP core suite (DG SATA HCTL-IP and DG SATA-IP) and SATA PHY. The IP core is an ideal to access SATA device at high speed with supporting FAT32 file system; not raw data. This solution fits the application which needs to record data to SATA device by using FPGA, but the data is read by other system such as PC through file system format.
User interface of FAT32 IP Core for SATA has two groups, i.e. control and data. Control interface is almost similar to dgIF typeS, but physical address and length are replaced by file number and numbers of file. Data interface of FAT32 IP Core is dgIF typeS interface. Clock domain for FAT32 IP Core for SATA is same as SATA HCTL-IPs user clock.
When SATA device which is recorded by raw data format needs to connect to other SATA hosts, special software must be designed to dump data from from SATA device. Comparing to FAT32 file system, FAT32 is well known and generally use in many systems. So, SATA device could be read by standard tools which is available on SATA host.
FAT32 IP Core for SATA supports three commands, i.e. Format, Write file, and Read file. FAT32 IP Core supports varieties of SATA device capacity, i.e. 64 MB 2 TB. After running Format command, SATA device has one partition to store the file. Though file size is adjustable by user between 32MB - 2GB, all files in one SATA device must be fixed. Format command is required to delete data in SATA device before changing file size.
Figure 2: FAT32 IP for SATA Operation
The sequence of FAT32 IP Core for SATA operation is as follows:
1) FAT32 IP waits SATA HCTL-IP to complete SATA device initialization.
2) FAT32 IP sends Identify device command to SATA HCTL-IP to get disk capacity. File size (input from user) and disk capacity are used by FAT32 IP to calculate system parameters and latch to internal registers. After that, FAT32 IP is ready to receive new command from user. Three commands are supported, i.e. Format, Write file, and Read file.
3) a. For the new disk, Format command must be run firstly to set up file system and clean up the disk. Also, when file size from user is changed, Format command is required to recalculate new system parameters such as the maximum files in the disk. Format command is applied to create FAT32 file structure such as Master boot record and root directory in SATA device.
b. When user selects Write file command, the 1st file name and numbers of file (inputs from user) are applied to calculate the start physical address and total length for SATA HCTL-IP. After that, data from user are forwarded to SATA device through FAT32 IP and SATA HCTL-IP. Finally, the FAT32 IP writes file header to SATA device.
Note:
1. File header is filled to the disk in the final step. If system is powered down before file header is completed, the file without the header will be lost.
2. There is no protection in the logic when some user inputs are out-of-range.
c. Similar to Write file command, the 1st process of Read file command is to calculate start physical address and total length for SATA HCTL-IP. After that, data from SATA device is returned to user until complete.
As shown in Figure 1, there are three submodules inside the IP, i.e. Command processor, Data Controller, and FAT32 RAM. Command processor receives command interface from user logic, converts the inputs to internal parameter, and sends the command to DG SATA HCTL-IP. Data controller transfers data between FIFOs in user logic and DG SATA HCTL-IP. Data sending to DG SATA HCTL-IP has two types, i.e. user data and file system data. Most of File system data are stored in FAT32 RAM. More details of each submodule are described as follows.
This module includes state machine to control the sequence of the logic for each user command, following in Figure 2. There are many calculation units in this block to calculate FAT32 parameters and the physical address which are depending on user command, user inputs, and disk capacity. This block is connected to command interface of user logic and DG SATA HCTL-IP. So, most control signals are designed in this module.
This RAM is BlockRAM to store FAT32 file system data. RAM size is 1024x32-bit.
This module is desigend to control data flow between user logic and DG SATA HCTL-IP. To create file in the disk, there are three data types from different source, i.e. data from user logic, FAT32 file system data from FAT32 RAM, and FAT32 parameters from internal registers.
FAT32 IP for SATA must be integrated with DG SATA HCTL-IP and DG SATA-IP. The details of DG SATA HCTL-IP and DG SATA-IP are described in the datasheet and downloaded from our website.
https://dgway.com/products/IP/SATA-IP/dg_sata_hctl_ip_data_sheet_en.pdf
https://dgway.com/products/IP/SATA-IP/dg_sata_ip_data_sheet_7series_en.pdf
This module could be designed by using simple logic by using small state machine and two FIFOs.Small state machine is designed to generate input parameters such as command, file number, and file size. Two FIFOs stores write data and read data transferring with FAT32 IP for SATA.
Descriptions of all signal I/O are provided in Table 3.
Table 3: Core I/O Signals
Signal |
Dir |
Description |
System signal |
||
RstB |
In |
Synchronous reset signal. Active low. Deassert to 1 when Clk signal is stable. |
Clk |
In |
User clock. Must use the same clock as Clk input of SATA HCTL-IP. (At least 150 MHz for SATA3 or at least 75 MHz for SATA2) |
FSize[2:0] |
In |
File size: 000 : 32MB, 001 : 64MB, 010 : 128MB, 011 : 256MB, 100 : 512MB, 101 : 1024MB, 110 : 2048MB, 111: Reserved Note: 1) 1 MB is 1024x1024 byte 2) FSize must not be changed when disk has the file. Format command is required before changing FSize value. |
FDateY[6:0] |
In |
Year in created date, count from 1980 (For example, FDateY=37 is year 2017). This input is used in write file command. The value must not be changed during running write file command. |
FDateM[3:0] |
In |
Month in created date. Valid from 1-12 (1=Jan, 2= Feb, ). This input is used in write file command. The value must not be changed during running write file command. |
FDateD[4:0] |
In |
Day in created date. Valid from 1-31. This input is used in write file command. The value must not be changed during running write file command. |
FTimeH[4:0] |
In |
Hour in created time. Valid from 0-23. This input is used in write file command. The value must not be changed during running write file command. |
FTimeM[5:0] |
In |
Minute in created time. Valid from 0-59. This input is used in write file command. The value must not be changed during running write file command. |
FTImeS[4:0] |
In |
x2 sec in created time. Valid from 0-29 (1=2, 2=4, ). This input is used in write file command. The value must not be changed during running write file command. |
User Interface (Command) |
||
UserCmd[1:0] |
In |
User Command. 00: Format command, 01 Reserved, 10: Write file, 11: Read file. |
UserFName[15:0] |
In |
The 1st file name to write/read file (0= FILE0000.BIN, 1=FILE0001.BIN, ). Valid form 0 to TotalFCap - 1. This input is not used in Format command. |
UserFLen[15:0] |
In |
Total files transfer in the request. Valid from 1 to (TotalFCap UserFName). This input is not used in Format command. |
UserReq |
In |
Request the new command. Can be asserted to 1 only when the IP is Idle (UserBusy=0). Asserted with valid value on UserCmd, UserFName, and UserFLen signals. |
UserBusy |
Out |
IP Busy status. New request will not be allowed if this signal is asserted to 1. |
TotalFCap[15:0] |
Out |
Maximum file to store in SATA device. This value is updated after FAT32-IP completes initialization process. |
UserError |
Out |
Direct mapped to SATAError siganl. Please see more details in SATA HCTL-IP datasheet. |
UserErrorType[31:0] |
Out |
Direct mapped to SATAErrorType siganl. Please see more details in SATA HCTL-IP datasheet. |
TesPin[63:0] |
Out |
Reserved to be IP test point. |
Signal |
Dir |
Description |
User Interface (Data) |
||
UserFifoWrCnt[15:0] |
In |
Write data counter of received FIFO. Used to check full status. If total FIFO size is less than 16-bit, please fill 1 to upper bit. UserFifoWrEn is asserted to 1 when UserFifoWrCnt[15:3] is not equal to all 1. |
UserFifoWrEn |
Out |
Write data valid of received FIFO. Asserted to 1 when read file command is operated |
UserFifoWrData[31:0] |
Out |
Write data bus of received FIFO. Synchronous to UserFifoWrEn. |
UserFifoRdCnt[15:0] |
In |
Read data counter of transmit FIFO. Used to check data available size in FIFO. If total FIFO size is less than 16-bit, please fill 0 to upper bit. This signal is unused for this IP. |
UserFifoEmpty |
In |
FIFO empty flag of transmit FIFO to check data available status during running write file command. |
UserFifoRdEn |
Out |
Read valid of transmit FIFO. Asserted to 1 when write file command is operated. |
UserFifoRdData[31:0] |
In |
Read data returned from Transmit FIFO. Valid in the next clock after UserFifoRdEn is assertedto 1. |
SATA HCTL-IP User Interface (Connect to dgIF typeS of SATA HCTL-IP) (Please see more details from SATA HCTL-IP datasheet) |
||
SATACmd[1:0] |
Out |
Connect to UserCmd of SATA HCTL-IP |
SATAAddr[47:0] |
Out |
Connect to UserAddr of SATA HCTL-IP |
SATALen[47:0] |
Out |
Connect to UserLen of SATA HCTL-IP |
SATAReq |
Out |
Connect to UserReq of SATA HCTL-IP |
SATABusy |
In |
Connect to UserBusy of SATA HCTL-IP |
SATALBASize[47:0] |
In |
Connect to LBASize of SATA HCTL-IP |
SATAError |
In |
Connect to UserError of SATA HCTL-IP |
SATAErrorType[31:0] |
In |
Connect to UserErrorType of SATA HCTL-IP |
SATAFifoWrCnt[15:0] |
Out |
Connect to UserFifoWrCnt of SATA HCTL-IP |
SATAFifoWrEn |
In |
Connect to UserFifoWrEn of SATA HCTL-IP |
SATAFifoWrData[31:0] |
In |
Connect to UserFifoWrData of SATA HCTL-IP |
SATAFifoRdCnt[15:0] |
Out |
Connect to UserFifoRdCnt of SATA HCTL-IP |
SATAFifoEmpty |
Out |
Connect to UserFifoEmpty of SATA HCTL-IP |
SATAFifoRdEn |
In |
Connect to UserFifoRdEn of SATA HCTL-IP |
SATAFifoRdData[31:0] |
Out |
Connect to UserFifoRdData of SATA HCTL-IP |
After IP is reset (RstB=0), UserBusy is asserted to 1. Next, IP starts initialization process. UserBusy is de-asserted to 0 when IP completes initialization process. After that, User can send new command to IP and TotalFCap is valid to read, as shown in Figure 3.
Figure 3: FAT32-IP for SATA Intialization
User interface can be split into two groups, i.e. command interface and data interface. Timing diagram of both groups are compatible to dgIF typeS interface. The input parameters in command interface of FAT32-IP for SATA are file name and numbers of file, as shown in Figure 4.
Before sending new command to the IP, UserBusy must be monitored that IP is Idle. UserCmd, UserFName, and UserFLen must be latched during asserting UserReq=1. UserBusy changes status from 0 to 1 after IP starts the operation. After that, UserReq is de-asserted to 0 and then new parameters could be prepared f for the next command.
Note: UserFName and UserFLen input are ignored in Format command.
For data interface, Transmit FIFO (TXFIFO) is read in Write file command and Received FIFO (RXFIFO) is written in Read file command. Timing diagram of data interface is same as SATA HCTL-IP timing diagram, as shown in Figure 5 and Figure 6.
Figure 4: User Interface (Command) Timing diagram
For Write file command, UserFifoEmpty is monitored to check data available status of Transmit FIFO. When data is ready (UserFifoEmpty=0), UserFifoRdEn is asserted to 1 to forward data from Transmit FIFO to SATA HCTL-IP. After total data are transferred to SATA HCTL-IP, UserFifoRdEn is de-asserted to 0. Similar to general FIFO timing diagram, UserFifoRdData is valid in the next clock after UserFifoRdEn is asserted to 1.
Figure 5: TX FIFO Interface for Write file command
For Read file command, UserFifoWrEn is asserted to 1 with the valid value of UserFifoWrData to send data to Received FIFO. UserFifoWrCnt is monitored to check that free space of Received FIFO. Data is transferred when free space in Received FIFO is more than 7. If UserFfWrCnt is more than or equal to 65528 (free space of Received FIFO is less than 7 words), UserFifoWrEn will be deasserted to 0 to pause data transferring, as shown in Figure 6.
Figure 6: RX FIFO Interface for Read file command
The example sequence to use FAT32-IP for SATA to write and read file with SATA device is shown as follows.
1) Deassert RstB=1 to start system initialization. Wait until UserBusy=0.
2) Skip to next step when the disk does not need to format. To send Format command, assert UserReq to 1 and set UserCmd=00. UserReq is de-asserted to 0 after FAT32 IP starts Format operation (UserBusy=1). Finally, user waits until FAT32 IP operation is completed (UserBusy=0)
Note: Format command is required by one of following conditions.
a) The disk is the new disk which has never formatted by FAT32 IP for SATA.
b) User needs to delete file in the disk.
c) User needs to change a file size parameter.
3) Send Write file command (UserCmd=10) or Read file command (UserCmd=11) to the disk. FSize must not be changed after Format command.
In case of Write file command,
a) Set FDateY, FDateM, FDateD, FTimeH, FTimeM, and FTimeS to set up Created date and Created time of the file. All values must not be changed during write file operation.
b) Send Write file command with a valid UserFName and UserFLen. UserFName must be the next value from the latest file. For example, if the latest file in the disk is FILE0019.BIN, UserFName will be set to 0x001A to create FILE001A.BIN as the 1st file in this command. UserFLen value must not be more than (TotalFCap UserFName).
c) Send total data to TXFIFO. Total data size is equal to UserFLen x FSize. The IP reads the data from TXFIFO when UserFifoEmpty=0.
d) Wait until IP operation complete (UserBusy=0).
In case of Read file command,
a) Send Read file command with valid UserFName and UserFLen. (UserFName + UserFLen) must not be more than total file in SATA device.
b) Read total data from RXFIFO. Total data size is equal to UserFLen x FSize. The IP monitors UserFifoWrCnt[15:3] /= all 1 before sending received data from SATA HCTL-IP to RXFIFO.
c) Wait until IP operation complete (UserBusy=0).
1) FAT32 IP for SATA calculates FAT32 parameters from user inputs and SATA device capacity. So, FAT32 parameters generated by FAT32 IP for SATA are specific value which may be different from other hosts. So, user must not format or write file to SATA device by using other hosts. Other hosts are allowed to read file from SATA device only.
2) FSize input from user must not change after Format command. The same value must be used to write and read file. User needs to send Format command when FSize input is changed. Also, TotalFCap signal is updated following FSize value.
3) For Write file command, UserFName input must be the next value from the latest file name, as shown in Figure 7.
Figure 7: Write file command in normal condition
If UserFName is not equal to the next value, the new file will be created with unusual status. The example of the unusual status is as follows.
a) When UserFName is more than the next value of the latest file, the dummy file which cannot be accessed is created between the latest file and the 1st new file, as shown in Figure 8.
Figure 8: Write file command but UserFName is more than normal value
b) When UesrFName is less than the next value of the latest file, the file after the 1st new file is corrupt, as shown in Figure 9.
Figure 9: Write file command but UserFName is less than normal value
The FAT32 IP Core for SATA functionality was verified by simulation and also proved on real board design by using AC701/KC705/ZC706/VC707/KCU105 board.
Experience design engineers with a knowledge of Vivado Tools should easily integrate this IP into their design.
This product is available directly from Design Gateway Co., Ltd. Please contact Design Gatway Co., Ltd. for pricing and additional information about this product using the contact information on the front page of this datasheet.
Revision |
Date |
Description |
1.0 |
Sep-22-2017 |
Initial Release |
1.1 |
Oct-5-2018 |
Correct information |