1 |
2 |
cospan |
nysa-sata-stack
|
2 |
|
|
===============
|
3 |
|
|
|
4 |
|
|
Sata stack written in Verilog
|
5 |
|
|
|
6 |
|
|
Staus: TLDR Version: Simulations are working
|
7 |
|
|
|
8 |
|
|
This code was written a long time ago and I've learned much more about verilog and project organization
|
9 |
|
|
since then. It has been proven in a Virtex 6 FPGA reading and writing to/from four Sata 2 hard drives at
|
10 |
|
|
the same time. There were some issues found when the internal buffers inside the hard drives began to
|
11 |
|
|
fill up requiring a lot of starting and stopping of this stack. It lead to some dropped data. There was
|
12 |
|
|
a horrible fix for it in the sata_link_write.v involving a small buffer. This made if very difficult to
|
13 |
|
|
debug because the stack wouldn't allow me to read the non-scrambled data within the logic analyzer.
|
14 |
|
|
There should be a more elegant solution to it.
|
15 |
|
|
|
16 |
|
|
Most of the license is MIT but some of the licenses are GPL
|
17 |
|
|
|
18 |
|
|
TODO: Fix Link layer... there is a small FIFO in there that is used to handle all starting and stopping
|
19 |
|
|
of the read, it's a work around and needs to be fixed
|
20 |
|
|
|
21 |
|
|
TODO: Fix Link layer so that it only instantiates one instance of the scrambler, not two
|
22 |
|
|
|
23 |
|
|
Code Organization:
|
24 |
|
|
|
25 |
|
|
rtl/
|
26 |
|
|
sata_stack.v (Top File that applications interface with)
|
27 |
|
|
sata_defines.v (Set defines for the stack in here)
|
28 |
|
|
|
29 |
|
|
generic/ (small modules used throughout the design)
|
30 |
|
|
blk_mem.v (wraps around an infered block memory generator)
|
31 |
|
|
cross_clock_enable.v (simple module that allows users to
|
32 |
|
|
send enables across a clock domain)
|
33 |
|
|
debounce.v (debounce)
|
34 |
|
|
ppfifo.v (ping pong FIFO, similar to a ping pong buffer
|
35 |
|
|
except the user doesn't need to track the
|
36 |
|
|
addresses)
|
37 |
|
|
|
38 |
|
|
command/
|
39 |
|
|
sata_command_layer.v (Sata Command Layer)
|
40 |
|
|
|
41 |
|
|
transport/
|
42 |
|
|
sata_transport_layer.v (Sata Transport Layer)
|
43 |
|
|
|
44 |
|
|
link/
|
45 |
|
|
sata_link_layer.v (Sata Link Layer)
|
46 |
|
|
sata_link_layer_read.v (Sata link layer read side)
|
47 |
|
|
sata_link_layer_write.v (Sata link layer write side)
|
48 |
|
|
scrambler.v (scrambles/descrambles primitives)
|
49 |
|
|
crc.v (Cyclical Redundancy Check/ creator)
|
50 |
|
|
cont_controller.v (controls the scrambling of primitives)
|
51 |
|
|
|
52 |
|
|
phy/
|
53 |
|
|
sata_phy_layer.v (Sata phy layer)
|
54 |
|
|
oob_controller.v (out of band controller)
|
55 |
|
|
|
56 |
|
|
platform/
|
57 |
|
|
sata_platform.v (This is a template file you can use to interface with the gigabit transceivers)
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
Soapbox:
|
61 |
|
|
|
62 |
|
|
Although I believe this code should be distributed for free and people should redistribute their software
|
63 |
|
|
I leave the ethics up to the user and have licensesed most of the code as MIT but I did use some GPL cores
|
64 |
|
|
and if the user desires to use this in their closed source project be warned about the GPL'ed modules in
|
65 |
|
|
this stack.
|