Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
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
Commits
780f7359
Commit
780f7359
authored
Jun 11, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging hardware
parent
5450474d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
26 deletions
+73
-26
ddrc_test01_testbench.sav
ddrc_test01_testbench.sav
+26
-12
ddrc_test01_testbench.tf
ddrc_test01_testbench.tf
+14
-2
ddrtests.py
python/ddrtests.py
+33
-12
No files found.
ddrc_test01_testbench.sav
View file @
780f7359
[*]
[*]
[*] GTKWave Analyzer v3.3.49 (w)1999-2013 BSI
[*] GTKWave Analyzer v3.3.49 (w)1999-2013 BSI
[*]
Tue Jun 10 23:54:44
2014
[*]
Wed Jun 11 02:38:51
2014
[*]
[*]
[dumpfile] "/data/vdt/vdt-projects/eddr3/simulation/ddrc_test01_testbench-2014061017
0704485
.lxt"
[dumpfile] "/data/vdt/vdt-projects/eddr3/simulation/ddrc_test01_testbench-2014061017
5433027
.lxt"
[dumpfile_mtime] "Tue Jun 10 23:
11:05
2014"
[dumpfile_mtime] "Tue Jun 10 23:
58:40
2014"
[dumpfile_size] 75451369
[dumpfile_size] 75451369
[savefile] "/data/vdt/vdt-projects/eddr3/ddrc_test01_testbench.sav"
[savefile] "/data/vdt/vdt-projects/eddr3/ddrc_test01_testbench.sav"
[timestart] 13
715730
0
[timestart] 13
862811
0
[size] 1920 1180
[size] 1920 1180
[pos] -1 -1
[pos] -1 -1
*-1
5.445735 13735937
5 134765625 134912600 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
*-1
2.445735 13864604
5 134765625 134912600 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] ddrc_test01_testbench.
[treeopen] ddrc_test01_testbench.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.axibram_read_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.axibram_read_i.
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].dq_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].dq_i.
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[1].
[treeopen] ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[1].
...
@@ -35,10 +36,10 @@
...
@@ -35,10 +36,10 @@
[treeopen] ddrc_test01_testbench.simul_axi_master_rdaddr_i.
[treeopen] ddrc_test01_testbench.simul_axi_master_rdaddr_i.
[treeopen] ddrc_test01_testbench.simul_axi_master_wdata_i.
[treeopen] ddrc_test01_testbench.simul_axi_master_wdata_i.
[treeopen] ddrc_test01_testbench.simul_axi_master_wraddr_i.
[treeopen] ddrc_test01_testbench.simul_axi_master_wraddr_i.
[sst_width]
219
[sst_width]
302
[signals_width] 367
[signals_width] 367
[sst_expanded] 1
[sst_expanded] 1
[sst_vpaned_height]
820
[sst_vpaned_height]
694
@c00200
@c00200
-PS7_AXI
-PS7_AXI
@22
@22
...
@@ -1529,6 +1530,24 @@ ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.set[0]
...
@@ -1529,6 +1530,24 @@ ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.set[0]
-ddrc_sequencer
-ddrc_sequencer
@800200
@800200
-ddr_sequencer_i_selected
-ddr_sequencer_i_selected
@800201
-ddr_read_data
@29
ddrc_test01_testbench.DQSL[0]
@23
ddrc_test01_testbench.SDD[15:0]
@29
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].dq_i.dq_di[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.dq_block[0].dq_i.dq_dly[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane0_i.iclk[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.clk_div[0]
@23
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.byte_lane1_i.dout[31:0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.phy_cmd_i.phy_top_i.dout[63:0]
@1000201
-ddr_read_data
@200
-
@c00200
@c00200
-tristate_control
-tristate_control
@28
@28
...
@@ -1631,7 +1650,6 @@ ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wdata_negedge[63:0]
...
@@ -1631,7 +1650,6 @@ ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wdata_negedge[63:0]
@28
@28
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wr[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wr[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wr_negedge[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.buf_wr_negedge[0]
@29
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.mclk[0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.mclk[0]
@22
@22
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.cmd0_addr[9:0]
ddrc_test01_testbench.ddrc_test01_i.ddrc_sequencer_i.cmd0_addr[9:0]
...
@@ -2360,10 +2378,6 @@ ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.in_address[31:0
...
@@ -2360,10 +2378,6 @@ ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.in_address[31:0
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.in_count[31:0]
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.in_count[31:0]
@28
@28
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.input_ready[0]
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.input_ready[0]
@22
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.latency_delay[5:0]
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.latency_delay_r[4:0]
@28
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.load[0]
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.load[0]
@22
@22
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.out_address[31:0]
ddrc_test01_testbench.simul_axi_master_wraddr_i.simul_axi_fifo_i.out_address[31:0]
...
...
ddrc_test01_testbench.tf
View file @
780f7359
...
@@ -432,7 +432,8 @@ always #(CLKIN_PERIOD/2) CLK <= ~CLK;
...
@@ -432,7 +432,8 @@ always #(CLKIN_PERIOD/2) CLK <= ~CLK;
// Set special values for DQS idelay for write leveling
// Set special values for DQS idelay for write leveling
axi_set_dqs_idelay_wlv;
axi_set_dqs_idelay_wlv;
// Set write buffer (from DDR3) WE signal delay for write leveling mode
// Set write buffer (from DDR3) WE signal delay for write leveling mode
axi_write_single(BASEADDR_WBUF_DELAY, {28'h0, WBUF_DLY_WLV});
// axi_write_single(BASEADDR_WBUF_DELAY, {28'h0, WBUF_DLY_WLV});
axi_set_wbuf_delay(WBUF_DLY_WLV);
//axi_set_dqs_idelay_nominal;
//axi_set_dqs_idelay_nominal;
run_write_lev;
run_write_lev;
...
@@ -475,7 +476,8 @@ always #(CLKIN_PERIOD/2) CLK <= ~CLK;
...
@@ -475,7 +476,8 @@ always #(CLKIN_PERIOD/2) CLK <= ~CLK;
// restore normal dqs idelay (after write leveling)
// restore normal dqs idelay (after write leveling)
axi_set_dqs_idelay_nominal;
axi_set_dqs_idelay_nominal;
// restore normal write buffer (from DDR3) WE signal delay
// restore normal write buffer (from DDR3) WE signal delay
axi_write_single(BASEADDR_WBUF_DELAY, {28'h0, WBUF_DLY_DFLT});
// axi_write_single(BASEADDR_WBUF_DELAY, {28'h0, WBUF_DLY_DFLT});
axi_set_wbuf_delay(WBUF_DLY_DFLT);
// test reading pattern
// test reading pattern
// set_read_pattern(8); // 8x2*64 bits, 32x32 bits to read
// set_read_pattern(8); // 8x2*64 bits, 32x32 bits to read
...
@@ -2580,7 +2582,17 @@ simul_axi_read simul_axi_read_i(
...
@@ -2580,7 +2582,17 @@ simul_axi_read simul_axi_read_i(
target_phase <= phase;
target_phase <= phase;
end
end
endtask
endtask
task axi_set_wbuf_delay;
input [3:0] delay;
begin
$display("SET WBUF DELAY to 0x%x @ %t",delay,$time);
axi_write_single(BASEADDR_WBUF_DELAY, {28'h0, delay});
end
endtask
/*
/*
assign rdata={21'b0,run_busy,locked,ps_rdy,ps_out[7:0]};
assign rdata={21'b0,run_busy,locked,ps_rdy,ps_out[7:0]};
*/
*/
task wait_phase_shifter_ready;
task wait_phase_shifter_ready;
...
...
python/ddrtests.py
View file @
780f7359
...
@@ -402,7 +402,8 @@ def encode_seq_skip(
...
@@ -402,7 +402,8 @@ def encode_seq_skip(
# Set MR3, read nrep*8 words, save to buffer (port0). No ACTIVATE/PRECHARGE are needed/allowed
# Set MR3, read nrep*8 words, save to buffer (port0). No ACTIVATE/PRECHARGE are needed/allowed
def
set_read_pattern
(
# task set_read_pattern;
def
set_read_pattern
(
# task set_read_pattern;
nrep
):
# input integer nrep;
nrep
,
# input integer nrep;
npat
):
#trying pattern type (only 0 defined)
# reg [31:0] cmd_addr;
# reg [31:0] cmd_addr;
# reg [31:0] data;
# reg [31:0] data;
# reg [17:0] mr3_norm;
# reg [17:0] mr3_norm;
...
@@ -415,7 +416,7 @@ def set_read_pattern( # task set_read_pattern;
...
@@ -415,7 +416,7 @@ def set_read_pattern( # task set_read_pattern;
0
)
# 2'h0) # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
0
)
# 2'h0) # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
mr3_pattern
=
ddr3_mr3
(
mr3_pattern
=
ddr3_mr3
(
1
,
# 1'h1, # mpr; # MPR mode: 0 - normal, 1 - dataflow from MPR
1
,
# 1'h1, # mpr; # MPR mode: 0 - normal, 1 - dataflow from MPR
0
)
# 2'h0) # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
npat
&
3
)
# 2'h0) # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
# Set pattern mode
# Set pattern mode
data
=
encode_seq_word
(
data
=
encode_seq_word
(
...
@@ -537,7 +538,8 @@ def set_read_pattern( # task set_read_pattern;
...
@@ -537,7 +538,8 @@ def set_read_pattern( # task set_read_pattern;
((
0
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
0
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
1
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
# (( 1 & 0x1) << 3) | # phy_buf_wr # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
axi_write_single
(
cmd_addr
,
data
)
axi_write_single
(
cmd_addr
,
data
)
...
@@ -783,7 +785,8 @@ def set_write_block(
...
@@ -783,7 +785,8 @@ def set_write_block(
axi_write_single
(
cmd_addr
,
data
)
axi_write_single
(
cmd_addr
,
data
)
cmd_addr
=
cmd_addr
+
4
cmd_addr
=
cmd_addr
+
4
# see if pause is needed . See when buffer read should be started - maybe before WR command
# see if pause is needed . See when buffer read should be started - maybe before WR command
data
=
encode_seq_skip
(
1
,
0
,
0
,
0
)
# tRCD
# data = encode_seq_skip(1,0,0,0) # tRCD
data
=
encode_seq_skip
(
2
,
0
,
0
,
0
)
# tRCD
axi_write_single
(
cmd_addr
,
data
)
axi_write_single
(
cmd_addr
,
data
)
cmd_addr
=
cmd_addr
+
4
cmd_addr
=
cmd_addr
+
4
# first write
# first write
...
@@ -794,13 +797,15 @@ def set_write_block(
...
@@ -794,13 +797,15 @@ def set_write_block(
((
0x3
&
0x7
)
<<
11
)
|
# 3'b011, # phy_rcw_in[2:0], # {ras,cas,we}
((
0x3
&
0x7
)
<<
11
)
|
# 3'b011, # phy_rcw_in[2:0], # {ras,cas,we}
((
1
&
0x1
)
<<
10
)
|
# phy_odt_in
((
1
&
0x1
)
<<
10
)
|
# phy_odt_in
((
0
&
0x1
)
<<
9
)
|
# phy_cke_inv # invert CKE
((
0
&
0x1
)
<<
9
)
|
# phy_cke_inv # invert CKE
((
1
&
0x1
)
<<
8
)
|
# phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
# (( 1 & 0x1) << 8) | # phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
((
0
&
0x1
)
<<
8
)
|
# phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
((
0
&
0x1
)
<<
7
)
|
# phy_dq_en_in #phy_dq_tri_in, # tristate DQ lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
7
)
|
# phy_dq_en_in #phy_dq_tri_in, # tristate DQ lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
0
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
0
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
# ((0 & 0x1) << 2) | # phy_buf_rd # connect to external buffer (but only if not paused)
((
1
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
axi_write_single
(
cmd_addr
,
data
)
axi_write_single
(
cmd_addr
,
data
)
cmd_addr
=
cmd_addr
+
4
cmd_addr
=
cmd_addr
+
4
...
@@ -831,7 +836,8 @@ def set_write_block(
...
@@ -831,7 +836,8 @@ def set_write_block(
((
0x3
&
0x7
)
<<
11
)
|
# 3'b011, # phy_rcw_in[2:0], # {ras,cas,we}
((
0x3
&
0x7
)
<<
11
)
|
# 3'b011, # phy_rcw_in[2:0], # {ras,cas,we}
((
1
&
0x1
)
<<
10
)
|
# phy_odt_in
((
1
&
0x1
)
<<
10
)
|
# phy_odt_in
((
0
&
0x1
)
<<
9
)
|
# phy_cke_inv # invert CKE
((
0
&
0x1
)
<<
9
)
|
# phy_cke_inv # invert CKE
((
1
&
0x1
)
<<
8
)
|
# phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
# (( 1 & 0x1) << 8) | # phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
((
0
&
0x1
)
<<
8
)
|
# phy_sel_in # first/second half-cycle, other will be nop (cke+odt applicable to both)
((
1
&
0x1
)
<<
7
)
|
# phy_dq_en_in #phy_dq_tri_in, # tristate DQ lines (internal timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
7
)
|
# phy_dq_en_in #phy_dq_tri_in, # tristate DQ lines (internal timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
6
)
|
# phy_dqs_en_in #phy_dqs_tri_in, # tristate DQS lines (internal timing sequencer for 0->1 and 1->0)
((
1
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
1
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
...
@@ -871,7 +877,8 @@ def set_write_block(
...
@@ -871,7 +877,8 @@ def set_write_block(
((
1
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
1
&
0x1
)
<<
5
)
|
# phy_dqs_toggle_en #enable toggle DQS according to the pattern
((
0
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
4
)
|
# phy_dci_en_in #phy_dci_in, # DCI disable, both DQ and DQS lines (internal logic and timing sequencer for 0->1 and 1->0)
((
0
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
3
)
|
# phy_buf_wr # connect to external buffer (but only if not paused)
((
1
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
# (( 1 & 0x1) << 2) | # phy_buf_rd # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
2
)
|
# phy_buf_rd # connect to external buffer (but only if not paused)
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
((
0
&
0x1
)
<<
1
))
# add_nop # add NOP after the current command, keep other data
axi_write_single
(
cmd_addr
,
data
)
axi_write_single
(
cmd_addr
,
data
)
cmd_addr
=
cmd_addr
+
4
cmd_addr
=
cmd_addr
+
4
...
@@ -1521,6 +1528,13 @@ def axi_set_phase( # task axi_set_phase;
...
@@ -1521,6 +1528,13 @@ def axi_set_phase( # task axi_set_phase;
# target_phase <= phase;
# target_phase <= phase;
def
axi_set_wbuf_delay
(
# task axi_set_wbuf_delay;
delay
):
#input [3:0] delay;
global
BASEADDR_WBUF_DELAY
print
(
"SET WBUF DELAY to 0x
%
x"
%
delay
);
axi_write_single
(
BASEADDR_WBUF_DELAY
,
delay
);
def
set_all_sequences
():
# task set_all_sequences;
def
set_all_sequences
():
# task set_all_sequences;
print
(
"SET MRS"
)
print
(
"SET MRS"
)
set_mrs
(
1
)
set_mrs
(
1
)
...
@@ -1531,7 +1545,7 @@ def set_all_sequences(): # task set_all_sequences;
...
@@ -1531,7 +1545,7 @@ def set_all_sequences(): # task set_all_sequences;
print
(
"SET WRITE LEVELING"
)
print
(
"SET WRITE LEVELING"
)
set_write_lev
(
16
)
# write leveling, 16 times (full buffer - 128)
set_write_lev
(
16
)
# write leveling, 16 times (full buffer - 128)
print
(
"SET READ PATTERN"
)
print
(
"SET READ PATTERN"
)
set_read_pattern
(
8
)
# 8x2*64 bits, 32x32 bits to read
set_read_pattern
(
8
,
0
)
# 8x2*64 bits, 32x32 bits to read (second 0 - pattern type, only 0 defined)
print
(
"SET WRITE BLOCK"
)
print
(
"SET WRITE BLOCK"
)
set_write_block
(
set_write_block
(
5
,
# 3'h5, # bank
5
,
# 3'h5, # bank
...
@@ -1546,7 +1560,7 @@ def set_all_sequences(): # task set_all_sequences;
...
@@ -1546,7 +1560,7 @@ def set_all_sequences(): # task set_all_sequences;
)
)
def
set_up
():
# task set_up;
def
set_up
():
# task set_up;
global
DLY_DQ_IDELAY
,
DLY_DQ_ODELAY
,
DLY_DQS_IDELAY
,
DLY_DQS_ODELAY
,
DLY_DM_ODELAY
,
DLY_CMDA_ODELAY
global
DLY_DQ_IDELAY
,
DLY_DQ_ODELAY
,
DLY_DQS_IDELAY
,
DLY_DQS_ODELAY
,
DLY_DM_ODELAY
,
DLY_CMDA_ODELAY
,
WBUF_DLY_DFLT
,
DLY_PHASE
# set dq /dqs tristate on/off patterns
# set dq /dqs tristate on/off patterns
axi_set_tristate_patterns
()
axi_set_tristate_patterns
()
# set patterns for DM (always 0) and DQS - always the same (may try different for write lev.)
# set patterns for DM (always 0) and DQS - always the same (may try different for write lev.)
...
@@ -1560,6 +1574,8 @@ def set_up(): # task set_up;
...
@@ -1560,6 +1574,8 @@ def set_up(): # task set_up;
#axi_set_delays;
#axi_set_delays;
# set clock phase relative to DDR clk
# set clock phase relative to DDR clk
axi_set_phase
(
DLY_PHASE
)
axi_set_phase
(
DLY_PHASE
)
axi_set_wbuf_delay
(
WBUF_DLY_DFLT
)
# main
# main
if
len
(
sys
.
argv
)
<
2
:
if
len
(
sys
.
argv
)
<
2
:
print
(
"Usage:
%
s command [hex_parameter, ...]"
%
sys
.
argv
[
0
])
print
(
"Usage:
%
s command [hex_parameter, ...]"
%
sys
.
argv
[
0
])
...
@@ -1641,8 +1657,8 @@ elif command=="read_buf":
...
@@ -1641,8 +1657,8 @@ elif command=="read_buf":
read_buf
(
args
[
0
])
read_buf
(
args
[
0
])
print
(
"read_buf() OK"
)
print
(
"read_buf() OK"
)
elif
command
==
"set_read_pattern"
:
elif
command
==
"set_read_pattern"
:
check_args
(
1
,
command
,
args
)
check_args
(
2
,
command
,
args
)
set_read_pattern
(
args
[
0
])
set_read_pattern
(
args
[
0
]
,
args
[
1
]
)
print
(
"set_read_pattern(0x
%
x) OK"
%
(
args
[
0
]))
print
(
"set_read_pattern(0x
%
x) OK"
%
(
args
[
0
]))
elif
command
==
"set_read_block"
:
elif
command
==
"set_read_block"
:
check_args
(
3
,
command
,
args
)
check_args
(
3
,
command
,
args
)
...
@@ -1725,6 +1741,11 @@ elif command=="axi_set_phase":
...
@@ -1725,6 +1741,11 @@ elif command=="axi_set_phase":
check_args
(
1
,
command
,
args
)
check_args
(
1
,
command
,
args
)
axi_set_phase
(
args
[
0
])
axi_set_phase
(
args
[
0
])
print
(
"axi_set_phase(0x
%
x) OK"
%
(
args
[
0
]))
print
(
"axi_set_phase(0x
%
x) OK"
%
(
args
[
0
]))
elif
command
==
"axi_set_wbuf_delay"
:
check_args
(
1
,
command
,
args
)
axi_set_wbuf_delay
(
args
[
0
])
print
(
"axi_set_wbuf_delay(0x
%
x) OK"
%
(
args
[
0
]))
elif
command
==
"set_write_lev"
:
elif
command
==
"set_write_lev"
:
check_args
(
1
,
command
,
args
)
check_args
(
1
,
command
,
args
)
...
...
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