From 5516a49696b21a13e1b606f38d99d9d7d97f1667 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 6 May 2015 03:51:02 +0200 Subject: [PATCH] litesata: add doc for frontend --- .../doc/source/docs/frontend/index.rst | 90 +++++++++++++++++- .../doc/source/docs/frontend/packets.dia | Bin 0 -> 3328 bytes .../doc/source/docs/frontend/packets.png | Bin 0 -> 3700 bytes 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 misoclib/mem/litesata/doc/source/docs/frontend/packets.dia create mode 100644 misoclib/mem/litesata/doc/source/docs/frontend/packets.png diff --git a/misoclib/mem/litesata/doc/source/docs/frontend/index.rst b/misoclib/mem/litesata/doc/source/docs/frontend/index.rst index d112402e..51f0c6da 100644 --- a/misoclib/mem/litesata/doc/source/docs/frontend/index.rst +++ b/misoclib/mem/litesata/doc/source/docs/frontend/index.rst @@ -3,5 +3,91 @@ ======================== Frontend ======================== -.. note:: - Please contribute to this document, or support us financially to write it. + +Crossbar and user ports +======================= + +LiteSATA provides a crossbar to let the user request the number of port he needs. +Ports are automatically arbitrated and dispatched to and from the core. In the +following example we create a core and get a port from the crossbar: + +.. code-block:: python + + self.submodules.sata_phy = LiteSATAPHY(platform.device, + platform.request("sata"), + "sata_gen2", + clk_freq) + self.submodules.sata = LiteSATA(self.sata_phy) + user_port = self.sata.crossbar.get_port() + +Our user_port has 2 endpoints: + + - A Sink used to send commands and write data. + - A Source used to receive commands acknowledges and receive read data. + +Packets description +=================== + +Sink and Source are packets with additional parameters. A packet has the following signals: + + - stb: Strobe signal indicates that command or data is valid. + - sop: Start Of Packet signal indicates that current command or data is the first of the packet. + - eop: End Of Packet signal indicates that current command or data is the last of the packet. + - ack: Response from the endpoint indicates that core is able to accept our command or data. + - data: Current data of the packet. + +.. figure:: packets.png + :scale: 30 % + :align: center + + An example of packet transaction between endpoints. + +.. tip:: + + - When a packet only has a command or data, sop and eop must be set to 1 on the same clock cycle. + - A data is accepted when stb=1 and ack=1. + +User Commands +============= + +All HDD transfers are initiated using the Sink endpoint which has the following signals: + + - write: 1 bit signal indicates if we want to write data to the HDD. + - read: 1 bit signal indicaties if we want to read data from the HDD. + - identify: 1 bit signal indicates if command is an identify device command (use to get HDD informations). + - sector: 48 bits signal, the sector number we are going to write or read. + - count: 16 bits signal, the number of sectors we are going to write or read. + - data: 32 bits signal, the write data. + +.. tip:: + + - write, read, identify, sector, count are parameters so remain constant for a packet duration. + - sector, count are ignored during an identify command. + - data is ignored during a read or identify command. + +User Responses +============== + +HDD responses are obtained from the Source endpoint which has the following signals: + + - write: 1 bit signal indicates if command was a write. + - read: 1 bit signal indicaties if command was a read. + - identify: 1 bit signal indicates if command was an identify device command. + - last: 1 bit signal indicates if this is the last packet of the response. (A Response can be return in several packets) + - failed: 1 bit signal identicates if an error was detected in the response (CRC, FIS...) + - data: 32 bits signal, the read data + +.. tip:: + + - write, read, identify, last are parameters so remain constant for a packet duration. + - data can be ignored in the case of a write or identify command. + - in case of a read command, read data packets are presented followed by an empty packet indicating the end of the transaction (last=1). + +Examples +======== + +A BIST_ (Data generator and checker) design is provided. It can be used to understand how to connect +your logic to the user_port provided by the crossbar. (See LiteSATABISTGenerator, LiteSATABISTChecker and LiteSATABISTIdentify) + +.. _BIST: https://github.com/m-labs/misoc/blob/master/misoclib/mem/litesata/frontend/bist.py + diff --git a/misoclib/mem/litesata/doc/source/docs/frontend/packets.dia b/misoclib/mem/litesata/doc/source/docs/frontend/packets.dia new file mode 100644 index 0000000000000000000000000000000000000000..d4804e2b1829fa1234922c28a0bd82c5b7f80850 GIT binary patch literal 3328 zcmV+b4gc~ViwFP!000023+-Laa^tuWzRy#rG}kqa|DV-*wl;@U4yno^yO+I8(H2L; ztSq@G+B3f7dGa24v2=r!Ez1P;LxO8MaMg@0y3G#_G(I%YK;x&Mzuzt=4_UFv*Q={3 zO~`bTt!~!ye6_fm{`Tu%FU<7kPal4o=jo5|Z&9ST6ZnhO20vX*zn10QkC&I8B5q$?gm0X_?})`e|C0MSgu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3A!`&6CAMVsHT1*64gLN<+aO5RAVG6 z+rw3qRPsT1iUX3_p(%_zo5)g;rH(hsNKzvtDM@;`%8yHG24N`)P->T^bi#!i6;H{? zQv>mo*DfPbjghEm4;SVMt~KtdBa{S9dJ4QG1Rlh|bo&5>H!BK`4}hoyvm?j{Hdm3T z1|ll2T}GlBBT=y)uBPKsNM{g?tFTuXa*2uQl*_n_nRmIc)h=|Y#;^%pN0u6frMyNN zNotHF)yD;JjLIRLDIg`ro?R))6Gq46NSR1c15uREBqK$Qk)lKow_I38lrsoUs1AD* zA2?Fgh6Dppc*})wc|Cxq6jM5$nTa%Y&@3ZQ{i!@veO{)IS@G#Z^#T4ZiuCr=hyMZ7 K?rPmMz5oFD)K{7S literal 0 HcmV?d00001 diff --git a/misoclib/mem/litesata/doc/source/docs/frontend/packets.png b/misoclib/mem/litesata/doc/source/docs/frontend/packets.png new file mode 100644 index 0000000000000000000000000000000000000000..adb18e8aca31c67011b21c21c76578e2d5f16744 GIT binary patch literal 3700 zcmc&%X;4#H8hrr~2@vc?KsK>eumJVAL!j3|-gAjoPk|3K(6Ocfnq!T98l+#^ZT~_zZkNI)xd-uJ2Pu)7-{mysaO?z7l zaj+a10040-OEX6R5YPnxklP*s{u}FuPNDoD7;a((+p}j6W!8=k0FYx=X2!6XqLmp+ z9$I^!(AnHm+uQx~k86UmT`7yJcD;lxg<=qCj>kS7tsB)m>-?@*iw#kG?~Ov+c{#eWSzeD}I zB?s}6^tT{eK(m6+Q!nZQBU=IY#>xc_J}mn;TnYnWsr|M_yJbpMDrMU|P`!O{jTH8z zJS_YplT(RTJ#hiIeENdW8jMKbNjqW!9toIwYz=Vss2poL8kLa}0Wc>j*j6?v(u zyY)udiOl&=9%VlY#H4mva8KRJ{a6m}2?Rntp{bbV(+;4su0))}W}=bplU2mV5a{_B zRhop_=YJXW+$q%|S@bYB$#cA3z^f3QUKwZ!8hJTu^a<(rIc~B?`G=IFuTd+ zAXba_ZS52t-L)t6ZO+1O_w1VO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