Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393_sata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393_sata
Commits
e06e9e1a
Commit
e06e9e1a
authored
Feb 17, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed more bugs in link layer
parent
fb82aa54
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
661 additions
and
194 deletions
+661
-194
.project
.project
+17
-17
ahci_fis_receive.v
ahci/ahci_fis_receive.v
+13
-0
ahci_sata_layers.v
ahci/ahci_sata_layers.v
+18
-3
ahci_top.v
ahci/ahci_top.v
+162
-20
action_decoder.v
generated/action_decoder.v
+1
-1
condition_mux.v
generated/condition_mux.v
+1
-1
ahci_fsm_sequence.py
helpers/ahci_fsm_sequence.py
+35
-31
link.v
host/link.v
+225
-82
ahxi_fsm_code.vh
includes/ahxi_fsm_code.vh
+14
-14
x393sata.py
py393sata/x393sata.py
+22
-5
tb_ahci_01.sav
tb_ahci_01.sav
+153
-20
No files found.
.project
View file @
e06e9e1a
...
...
@@ -52,87 +52,87 @@
<link>
<name>
vivado_logs/VivadoBitstream.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoBitstream-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoBitstream-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOpt.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOpt-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOpt-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOptPhys.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOptPhys-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOptPhys-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOptPower.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOptPower-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoOptPower-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoPlace.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoPlace-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoPlace-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoRoute.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoRoute-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoRoute-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoSynthesis.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoSynthesis-2016021
4170151284
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoSynthesis-2016021
6193813011
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportImplemented.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimimgSummaryReportImplemented-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimimgSummaryReportImplemented-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportSynthesis.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimimgSummaryReportSynthesis-2016021
4170151284
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimimgSummaryReportSynthesis-2016021
6193813011
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimingReportImplemented.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimingReportImplemented-2016021
4170313831
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimingReportImplemented-2016021
6194006906
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimingReportSynthesis.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimingReportSynthesis-2016021
4170151284
.log
</location>
<location>
/home/andrey/git/x393_sata/vivado_logs/VivadoTimingReportSynthesis-2016021
6193813011
.log
</location>
</link>
<link>
<name>
vivado_state/x393_sata-opt-phys.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-phys-2016021
4170313831
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-phys-2016021
6194006906
.dcp
</location>
</link>
<link>
<name>
vivado_state/x393_sata-opt-power.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-power-2016021
4170313831
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-power-2016021
6194006906
.dcp
</location>
</link>
<link>
<name>
vivado_state/x393_sata-opt.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-2016021
4170313831
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-opt-2016021
6194006906
.dcp
</location>
</link>
<link>
<name>
vivado_state/x393_sata-place.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-place-2016021
4170313831
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-place-2016021
6194006906
.dcp
</location>
</link>
<link>
<name>
vivado_state/x393_sata-route.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-route-2016021
4170313831
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-route-2016021
6194006906
.dcp
</location>
</link>
<link>
<name>
vivado_state/x393_sata-synth.dcp
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-synth-2016021
4170151284
.dcp
</location>
<location>
/home/andrey/git/x393_sata/vivado_state/x393_sata-synth-2016021
6193813011
.dcp
</location>
</link>
</linkedResources>
</projectDescription>
ahci/ahci_fis_receive.v
View file @
e06e9e1a
...
...
@@ -112,6 +112,11 @@ module ahci_fis_receive#(
input
dma_in_ready
,
// DMA engine ready to accept data
output
dma_in_valid
// Write data to DMA dev->memory channel
,
output
debug_data_in_ready
,
output
debug_fis_end_w
,
output
[
1
:
0
]
debug_fis_end_r
,
output
[
1
:
0
]
debug_get_fis_busy_r
)
;
//localparam FA_BITS = 6; // number of bits in received FIS address
//localparam CLB_OFFS32 = 'h200; // # In the second half of the register space (0x800..0xbff - 1KB)
...
...
@@ -241,6 +246,14 @@ localparam DATA_TYPE_ERR = 3;
assign
fis_first_invalid
=
fis_first_invalid_r
;
//debug:
assign
debug_data_in_ready
=
data_in_ready
;
assign
debug_fis_end_w
=
fis_end_w
;
assign
debug_fis_end_r
=
fis_end_r
;
assign
debug_get_fis_busy_r
=
get_fis_busy_r
;
always
@
(
posedge
mclk
)
begin
if
(
hba_rst
||
dma_in_stop
||
pcmd_st_cleared
)
dma_in
<=
0
;
else
if
(
dma_in_start
)
dma_in
<=
1
;
...
...
ahci/ahci_sata_layers.v
View file @
e06e9e1a
...
...
@@ -254,13 +254,25 @@ module ahci_sata_layers #(
assign
serr_EI
=
phy_ready
&&
(
0
)
;
// RWC: Recovered Data integrity Error
reg
[
1
:
0
]
debug_last_d2h_type_in
;
reg
[
1
:
0
]
debug_last_d2h_type
;
always
@
(
posedge
clk
)
begin
if
(
d2h_fifo_wr
)
debug_last_d2h_type_in
<=
d2h_type_in
;
if
(
d2h_fifo_rd
)
debug_last_d2h_type
<=
d2h_type
;
end
assign
debug_phy
=
{
h2d_type_out
[
1
:
0
]
,
h2d_type
[
1
:
0
]
,
ll_h2d_last
,
d2h_valid
,
d2h_type
[
1
:
0
]
,
debug_last_d2h_type_in
,
d2h_type_in
[
1
:
0
]
,
debug_phy0
[
19
:
0
]
};
debug_last_d2h_type
[
1
:
0
]
,
d2h_fill
[
1
:
0
]
,
1'b0
,
d2h_fifo_wr
,
d2h_fifo_re_regen
[
1
:
0
]
,
d2h_waddr
[
1
:
0
]
,
d2h_raddr
[
1
:
0
]
,
debug_phy0
[
7
:
0
]
};
// debug_phy0[15:0]};
// debug_phy0[19:0]};
/*
// Data/type FIFO, device -> host
...
...
@@ -341,7 +353,7 @@ module ahci_sata_layers #(
// FIS transmit H2D
// Start if all FIS is in FIFO (last word received) or at least that many is in FIFO
if
(
rst
||
ll_frame_req
)
h2d_pending
<=
0
;
if
(
rst
||
ll_frame_req
)
h2d_pending
<=
0
;
// ?
else
if
((
h2d_type
==
H2D_TYPE_FIS_HEAD
)
&&
h2d_fifo_wr
)
h2d_pending
<=
1
;
if
(
rst
)
ll_frame_req
<=
0
;
...
...
@@ -400,7 +412,10 @@ module ahci_sata_layers #(
.
datascope_waddr
(
datascope_waddr
)
,
// output[9:0]
.
datascope_we
(
datascope_we
)
,
// output
.
datascope_di
(
datascope_di
)
,
// output[31:0]
.
datascope_trig
(
ll_incom_invalidate
)
,
// ll_frame_ackn), // input datascope external trigger
// .datascope_trig (ll_incom_invalidate ), // ll_frame_ackn), // input datascope external trigger
// .datascope_trig (debug_link[4:0] == 'h0a), // state_send_eof // input datascope external trigger
.
datascope_trig
(
debug_link
[
4
:
0
]
==
'h02
)
,
// state_rcvr_goodcrc // input datascope external trigger
//debug_link
`endif
`ifdef
USE_DRP
...
...
ahci/ahci_top.v
View file @
e06e9e1a
This diff is collapsed.
Click to expand it.
generated/action_decoder.v
View file @
e06e9e1a
/*******************************************************************************
* Module: action_decoder
* Date:2016-02-1
3
* Date:2016-02-1
6
* Author: auto-generated file, see ahci_fsm_sequence.py
* Description: Decode sequencer code to 1-hot actions
*******************************************************************************/
...
...
generated/condition_mux.v
View file @
e06e9e1a
/*******************************************************************************
* Module: condition_mux
* Date:2016-02-1
3
* Date:2016-02-1
6
* Author: auto-generated file, see ahci_fsm_sequence.py
* Description: Select condition
*******************************************************************************/
...
...
helpers/ahci_fsm_sequence.py
View file @
e06e9e1a
This diff is collapsed.
Click to expand it.
host/link.v
View file @
e06e9e1a
This diff is collapsed.
Click to expand it.
includes/ahxi_fsm_code.vh
View file @
e06e9e1a
, .INIT_00 (256'h00100000000E0000000C00000033000000200000000A0000000A0000000A0000)
, .INIT_01 (256'h001944521C399446543044170000001900880019003002020204008400220006)
, .INIT_02 (256'h001900050019C82E000C04020110002924FB250
2
024000190003004204040000)
, .INIT_02 (256'h001900050019C82E000C04020110002924FB250
3
024000190003004204040000)
, .INIT_03 (256'h845284BE44374C682C4214190012003900880018000A02080022001901020090)
, .INIT_04 (256'h00190110003901100019144601020030020202040039B07D707A041000398C6B)
, .INIT_05 (256'h64540C2504580000004E24FB250
200C0004C24FB2502
00C0005C000000390000)
, .INIT_06 (256'hD10
2
50F8903900A00104006B0202005000E2A89368F018E918CB98A758D73882)
, .INIT_05 (256'h64540C2504580000004E24FB250
300C0004C24FB2503
00C0005C000000390000)
, .INIT_06 (256'hD10
5
50F8903900A00104006B0202005000E2A89368F018E918CB98A758D73882)
, .INIT_07 (256'h0060003900000039B07D00000050004400220039B07D707A307730F001080071)
, .INIT_08 (256'h00050091C88F002200240091288B28F
E000C0110008624FB25020240009CD0FB
)
, .INIT_09 (256'h48A528A128F
E00140039487F0CAD28FE0110009724FB2502
0140005004020091)
, .INIT_0A (256'h8839089C040800AD011000AB24FB250
2
00C000500081005048A5002200240039)
, .INIT_0B (256'h00C004080039889C040800090039889C50BA0024004800B5D0F
B
50F8012000B1)
, .INIT_0C (256'h011000CF24FB250
204200039889C50BA00240028011000C5C502
24FB24FB0220)
, .INIT_0D (256'h0050C8E028F
E000C011000DB24FB2502
0440003934D2000000D4001100D4C8D2)
, .INIT_0E (256'h00F60082011000ED24FB250
200C000390401011000E624FB2502
018000500101)
, .INIT_0F (256'h0
100020101000021021001000021004400F6000000F6011000F424FB2502
00C0)
, .INIT_10 (256'h00000000000000000000000000000000000000
00000000390041000001000000
)
, .INIT_08 (256'h00050091C88F002200240091288B28F
F000C0110008624FB25030240009CD0FD
)
, .INIT_09 (256'h48A528A128F
F00140039487F0CAD28FF0110009724FB2503
0140005004020091)
, .INIT_0A (256'h8839089C040800AD011000AB24FB250
3
00C000500081005048A5002200240039)
, .INIT_0B (256'h00C004080039889C040800090039889C50BA0024004800B5D0F
D
50F8012000B1)
, .INIT_0C (256'h011000CF24FB250
304200039889C50BA00240028011000C5C503
24FB24FB0220)
, .INIT_0D (256'h0050C8E028F
F000C011000DB24FB2503
0440003934D2000000D4001100D4C8D2)
, .INIT_0E (256'h00F60082011000ED24FB250
300C000390401011000E624FB2503
018000500101)
, .INIT_0F (256'h0
2010101002100FD021001010021004400F6000000F6011000F424FB2503
00C0)
, .INIT_10 (256'h00000000000000000000000000000000000000
39004101050210010100000101
)
, .INITP_00 (256'hC8220098170902401E272722222800309418810820809C802018880022222222)
, .INITP_01 (256'h
220
82227209C82720A09C22089C680272181A01CB889C8605A2A89C882068270)
, .INITP_02 (256'h0000000000000000000000000000000000000000000000000000000000000
082
)
, .INITP_01 (256'h
888
82227209C82720A09C22089C680272181A01CB889C8605A2A89C882068270)
, .INITP_02 (256'h0000000000000000000000000000000000000000000000000000000000000
888
)
py393sata/x393sata.py
View file @
e06e9e1a
...
...
@@ -628,6 +628,12 @@ class x393sata(object):
print
(
"Datascope (debug) data:"
)
print
(
"_=mem.mem_dump (0x
%
x, 0x20,4)"
%
(
DATASCOPE_ADDR
))
self
.
x393_mem
.
mem_dump
(
DATASCOPE_ADDR
,
0xa0
,
4
)
dd
=
0
for
a
in
range
(
0x80001000
,
0x80001014
,
4
):
dd
|=
self
.
x393_mem
.
read_mem
(
a
)
if
dd
==
0
:
print
(
"*** Probably got cache/write buffer problem, continuing ***"
)
break
raise
Exception
(
"Failed to get interrupt"
)
break
...
...
@@ -638,13 +644,13 @@ class x393sata(object):
print
(
"_=mem.mem_dump (0x
%
x, 0x4,4)"
%
(
MAXI1_ADDR
+
DBG_OFFS
))
self
.
x393_mem
.
mem_dump
(
MAXI1_ADDR
+
DBG_OFFS
,
0x4
,
4
)
print
(
"Datascope (debug) data:"
)
print
(
"_=mem.mem_dump (0x
%
x, 0x
2
0,4)"
%
(
DATASCOPE_ADDR
))
self
.
x393_mem
.
mem_dump
(
DATASCOPE_ADDR
,
0x
a
0
,
4
)
print
(
"_=mem.mem_dump (0x
%
x, 0x
10
0,4)"
%
(
DATASCOPE_ADDR
))
self
.
x393_mem
.
mem_dump
(
DATASCOPE_ADDR
,
0x
20
0
,
4
)
raise
Exception
(
"Failed to get interrupt"
)
print
(
"Datascope (debug) data:"
)
print
(
"_=mem.mem_dump (0x
%
x, 0x20,4)"
%
(
DATASCOPE_ADDR
))
self
.
x393_mem
.
mem_dump
(
DATASCOPE_ADDR
,
0x
a
0
,
4
)
print
(
"_=mem.mem_dump (0x
%
x, 0x20
0
,4)"
%
(
DATASCOPE_ADDR
))
self
.
x393_mem
.
mem_dump
(
DATASCOPE_ADDR
,
0x
20
0
,
4
)
print
(
"Memory read data:"
)
print
(
"_=mem.mem_dump (0x
%
x, 0x
%
x, 1)"
%
(
DATAIN_ADDRESS
,
count
*
0x200
))
self
.
x393_mem
.
mem_dump
(
DATAIN_ADDRESS
,
count
*
0x200
,
1
)
...
...
@@ -886,7 +892,7 @@ class x393sata(object):
(
" R_IPp "
,
0x5555b57c
),
(
" R_OKp "
,
0x3535b57c
),
(
" R_RDYp "
,
0x4a4a957c
),
(
" SOFp "
,
0x3
131
b57c
),
(
" SOFp "
,
0x3
737
b57c
),
(
" SYNCp "
,
0xb5b5957c
),
(
" WTRMp "
,
0x5858b57c
),
(
" X_RDYp "
,
0x5757b57c
))
...
...
@@ -1053,6 +1059,17 @@ sata.reg_status()
_=mem.mem_dump (0x80000ff0, 4,4)
sata.reg_status(),sata.reset_ie(),sata.err_count()
for block in range (1,1024):
print("
\n
======== Reading block
%
d ==============="
%
block)
sata.arm_logger()
sata.dd_read_dma(block, 1)
_=mem.mem_dump (0x80000ff0, 4,4)
sata.reg_status(),sata.reset_ie(),sata.err_count()
sata.arm_logger()
sata.setup_pio_read_identify_command()
...
...
tb_ahci_01.sav
View file @
e06e9e1a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment