Commit 0580effb authored by Matthieu Cattin's avatar Matthieu Cattin

hdl, doc, sim: Fix sdb bridge offset address, add config ok flag, update doc in progress.

parent b48832a9
......@@ -371,6 +371,121 @@
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3014"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5105-3"
id="linearGradient5157-2"
gradientUnits="userSpaceOnUse"
x1="195"
y1="352.36218"
x2="210"
y2="347.36218" />
<linearGradient
inkscape:collect="always"
id="linearGradient5105-3">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop5107-4" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop5109-3" />
</linearGradient>
<inkscape:perspective
id="perspective3060"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="TriangleOutS"
orient="auto"
refY="0"
refX="0"
id="TriangleOutS-3"
style="overflow:visible">
<path
id="path3356-9"
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
transform="scale(0.2,0.2)" />
</marker>
<inkscape:perspective
id="perspective3088"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="TriangleOutS"
orient="auto"
refY="0"
refX="0"
id="TriangleOutS-2"
style="overflow:visible">
<path
id="path3356-7"
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
transform="scale(0.2,0.2)" />
</marker>
<inkscape:perspective
id="perspective3131"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="TriangleOutS"
orient="auto"
refY="0"
refX="0"
id="TriangleOutS-0"
style="overflow:visible">
<path
id="path3356-8"
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
transform="scale(0.2,0.2)" />
</marker>
<inkscape:perspective
id="perspective3159"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3188"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="TriangleOutS"
orient="auto"
refY="0"
refX="0"
id="TriangleOutS-4"
style="overflow:visible">
<path
id="path3356-5"
d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
transform="scale(0.2,0.2)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
......@@ -379,16 +494,16 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="48.437241"
inkscape:cy="184.45691"
inkscape:zoom="1.979899"
inkscape:cx="323.17009"
inkscape:cy="101.46611"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1123"
inkscape:window-height="1173"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="true">
<inkscape:grid
......@@ -656,10 +771,6 @@
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#TriangleOutM)"
d="m 440,262.36218 -11,0"
id="path3202" />
<path
id="path5776"
d="m 175,152.36218 76,0"
style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)" />
<path
style="fill:#291b1b;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)"
d="m 496,142.36218 10.39398,0"
......@@ -782,13 +893,13 @@
<text
xml:space="preserve"
style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Verdana;-inkscape-font-specification:Verdana"
x="190"
y="147.36218"
x="187.97969"
y="161.14673"
id="text6598"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="190"
y="147.36218"
x="187.97969"
y="161.14673"
id="tspan6600">Data</tspan></text>
<text
xml:space="preserve"
......@@ -1090,5 +1201,52 @@
id="tspan20140"
x="184.6825"
y="86.008003">}</tspan></text>
<g
id="g5147-6"
transform="translate(26.79514,-180)">
<path
style="fill:url(#linearGradient5157-2);fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 195,312.36218 0,40"
id="path5149-1" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 210,317.36218 0,30"
id="path5151-9" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 195,352.36218 15,-5"
id="path5153-3" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 195,312.36218 15,5"
id="path5155-7" />
</g>
<path
id="path6588-5"
d="m 236.758,152.36218 15,0"
style="fill:none;stroke:#000000;stroke-width:2.92571998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)" />
<path
id="path5875-5"
d="m 175.18439,165.14418 42.30223,0"
style="fill:none;stroke:#000000;stroke-width:2.92571998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)" />
<text
xml:space="preserve"
style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Verdana;-inkscape-font-specification:Verdana"
x="200.9281"
y="119.51977"
id="text6598-2"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="200.9281"
y="119.51977"
id="tspan6600-6">Trigger</tspan><tspan
sodipodi:role="line"
x="200.9281"
y="129.51976"
id="tspan3176">time-tag</tspan></text>
<path
style="color:#000000;fill:none;stroke:#000000;stroke-width:2.92571998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-end:url(#TriangleOutS);visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 199.94643,132.41575 0,6.60715 17.41071,0"
id="path3178" />
</g>
</svg>
......@@ -180,7 +180,12 @@ SerDes PLL status
@code{SERDES_SYNCED}
@tab @code{X} @tab
SerDes synchronization status
@item @code{31...5}
@item @code{5}
@tab R/O @tab
@code{ACQ_CFG}
@tab @code{X} @tab
Acquisition configuration status
@item @code{31...6}
@tab R/O @tab
@code{RESERVED}
@tab @code{X} @tab
......@@ -188,9 +193,10 @@ Reserved
@end multitable
@multitable @columnfractions 0.15 0.85
@headitem Field @tab Description
@item @code{fsm} @tab States:@*0: illegal@*1: IDLE@*2: PRE_TRIG@*3: WAIT_TRIG@*4: POST_TRIG@*5: DECR_SHOT@*6: illegal@*7: illegal
@item @code{fsm} @tab States:@*0: illegal@*1: IDLE@*2: PRE_TRIG@*3: WAIT_TRIG@*4: POST_TRIG@*5: TRIG_TAG@*6: DECR_SHOT@*7: illegal
@item @code{serdes_pll} @tab Sampling clock recovery PLL.@*0: not locked@*1: locked
@item @code{serdes_synced} @tab 0: bitslip in progress@*1: serdes synchronized
@item @code{acq_cfg} @tab 0: Unauthorised acquisition configuration (will prevent acquisition to start)@*1: Valid acquisition configuration@*@bullet{} Shot number > 0@*@bullet{} Post-trigger sample > 0
@item @code{reserved} @tab Ignore on read, write with 0's
@end multitable
@regsection @code{trig_cfg} - Trigger configuration
......@@ -240,7 +246,7 @@ Threshold for internal trigger
@item @code{sw_trig_en} @tab 0: disable@*1: enable
@item @code{int_trig_sel} @tab 00: channel 1@*01: channel 2@*10: channel 3@*11: channel 4
@item @code{reserved} @tab Ignore on read, write with 0's
@item @code{int_trig_thres} @tab Treated as binary two's complement and compared to raw ADC data
@item @code{int_trig_thres} @tab Treated as binary two's complement and compared to raw ADC data.
@end multitable
@regsection @code{trig_dly} - Trigger delay
@multitable @columnfractions .10 .10 .15 .10 .55
......@@ -321,7 +327,7 @@ Pre-trigger samples
@end multitable
@multitable @columnfractions 0.15 0.85
@headitem Field @tab Description
@item @code{pre_samples} @tab Number of requested pre-trigger samples
@item @code{pre_samples} @tab Number of requested pre-trigger samples (>1).
@end multitable
@regsection @code{post_samples} - Post-trigger samples
@multitable @columnfractions .10 .10 .15 .10 .55
......@@ -334,7 +340,7 @@ Post-trigger samples
@end multitable
@multitable @columnfractions 0.15 0.85
@headitem Field @tab Description
@item @code{post_samples} @tab Number of requested post-trigger samples
@item @code{post_samples} @tab Number of requested post-trigger samples (>1).
@end multitable
@regsection @code{samples_cnt} - Samples counter
@multitable @columnfractions .10 .10 .15 .10 .55
......
......@@ -420,6 +420,10 @@ Those two counters are accessible in read/write mode via registers.
To time-tag the events, the ADC core sends pulses to the time-tagging core.
The following events are time-tagged; trigger, acquisition start, acquisition stop and acquisition end.
@quotation Note
The trigger time tag corresponds to the moment when the acquisition FSM leaves the @code{WAIT_TRIG} state.
@end quotation
@quotation Note
In this release, the meta-data register is NOT used, set to zero.
@end quotation
......@@ -876,7 +880,11 @@ The LED labeled @code{ACQ} is turned ON when the acquisition state machine is @b
The LED labeled @code{TRIG} flashes when a valid trigger is detected @b{and} the acquisition state machine is in the @code{WAIT_TRIG} state.
@quotation Note
In addition to the requested pre/post-trigger samples, an addition sample, corresponding to the trigger, will be recoded.
The number of pre-trigger sample can be zero, but there @b{must} be at least one post-trigger sample.
@end quotation
@quotation Note
In addition to the requested pre/post-trigger samples, an additional sample, corresponding to the trigger, will be recoded.
@end quotation
@c --------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
---------------------------------------------------------------------------------------
-- File : ../rtl/fmc_adc_100Ms_csr.vhd
-- Author : auto-generated by wbgen2 from fmc_adc_100Ms_csr.wb
-- Created : Wed Aug 7 17:44:15 2013
-- Created : Tue Dec 17 09:57:20 2013
-- Standard : VHDL'87
---------------------------------------------------------------------------------------
-- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE fmc_adc_100Ms_csr.wb
......@@ -51,8 +51,10 @@ entity fmc_adc_100Ms_csr is
fmc_adc_core_sta_serdes_pll_i : in std_logic;
-- Port for BIT field: 'SerDes synchronization status' in reg: 'Status register'
fmc_adc_core_sta_serdes_synced_i : in std_logic;
-- Port for BIT field: 'Acquisition configuration status' in reg: 'Status register'
fmc_adc_core_sta_acq_cfg_i : in std_logic;
-- Port for std_logic_vector field: 'Reserved' in reg: 'Status register'
fmc_adc_core_sta_reserved_i : in std_logic_vector(26 downto 0);
fmc_adc_core_sta_reserved_i : in std_logic_vector(25 downto 0);
-- Port for asynchronous (clock: fs_clk_i) BIT field: 'Hardware trigger selection' in reg: 'Trigger configuration'
fmc_adc_core_trig_cfg_hw_trig_sel_o : out std_logic;
-- Port for asynchronous (clock: fs_clk_i) BIT field: 'Hardware trigger polarity' in reg: 'Trigger configuration'
......@@ -429,7 +431,8 @@ begin
rddata_reg(2 downto 0) <= fmc_adc_core_sta_fsm_i;
rddata_reg(3) <= fmc_adc_core_sta_serdes_pll_i;
rddata_reg(4) <= fmc_adc_core_sta_serdes_synced_i;
rddata_reg(31 downto 5) <= fmc_adc_core_sta_reserved_i;
rddata_reg(5) <= fmc_adc_core_sta_acq_cfg_i;
rddata_reg(31 downto 6) <= fmc_adc_core_sta_reserved_i;
ack_sreg(0) <= '1';
ack_in_progress <= '1';
when "00010" =>
......@@ -745,6 +748,7 @@ begin
-- State machine status
-- SerDes PLL status
-- SerDes synchronization status
-- Acquisition configuration status
-- Reserved
-- Hardware trigger selection
-- synchronizer chain for field : Hardware trigger selection (type RW/RO, clk_sys_i <-> fs_clk_i)
......
......@@ -3,7 +3,7 @@
* File : fmc_adc_100Ms_csr.h
* Author : auto-generated by wbgen2 from fmc_adc_100Ms_csr.wb
* Created : Wed Aug 7 17:44:15 2013
* Created : Tue Dec 17 09:57:20 2013
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE fmc_adc_100Ms_csr.wb
......@@ -77,11 +77,14 @@
/* definitions for field: SerDes synchronization status in reg: Status register */
#define FMC_ADC_CORE_STA_SERDES_SYNCED WBGEN2_GEN_MASK(4, 1)
/* definitions for field: Acquisition configuration status in reg: Status register */
#define FMC_ADC_CORE_STA_ACQ_CFG WBGEN2_GEN_MASK(5, 1)
/* definitions for field: Reserved in reg: Status register */
#define FMC_ADC_CORE_STA_RESERVED_MASK WBGEN2_GEN_MASK(5, 27)
#define FMC_ADC_CORE_STA_RESERVED_SHIFT 5
#define FMC_ADC_CORE_STA_RESERVED_W(value) WBGEN2_GEN_WRITE(value, 5, 27)
#define FMC_ADC_CORE_STA_RESERVED_R(reg) WBGEN2_GEN_READ(reg, 5, 27)
#define FMC_ADC_CORE_STA_RESERVED_MASK WBGEN2_GEN_MASK(6, 26)
#define FMC_ADC_CORE_STA_RESERVED_SHIFT 6
#define FMC_ADC_CORE_STA_RESERVED_W(value) WBGEN2_GEN_WRITE(value, 6, 26)
#define FMC_ADC_CORE_STA_RESERVED_R(reg) WBGEN2_GEN_READ(reg, 6, 26)
/* definitions for register: Trigger configuration */
......
......@@ -809,7 +809,24 @@ fmc_adc_core_sta_serdes_synced_i
</td>
<td class="td_pblock_right">
fmc_adc_core_sta_reserved_i[26:0]
fmc_adc_core_sta_acq_cfg_i
</td>
<td class="td_arrow_right">
&larr;
</td>
</tr>
<tr>
<td class="td_arrow_left">
</td>
<td class="td_pblock_left">
</td>
<td class="td_sym_center">
</td>
<td class="td_pblock_right">
fmc_adc_core_sta_reserved_i[25:0]
</td>
<td class="td_arrow_right">
&lArr;
......@@ -2849,7 +2866,7 @@ STA
</tr>
<tr>
<td style="border: solid 1px black;" colspan=8 class="td_field">
RESERVED[26:19]
RESERVED[25:18]
</td>
<td >
......@@ -2903,7 +2920,7 @@ RESERVED[26:19]
</tr>
<tr>
<td style="border: solid 1px black;" colspan=8 class="td_field">
RESERVED[18:11]
RESERVED[17:10]
</td>
<td >
......@@ -2957,7 +2974,7 @@ RESERVED[18:11]
</tr>
<tr>
<td style="border: solid 1px black;" colspan=8 class="td_field">
RESERVED[10:3]
RESERVED[9:2]
</td>
<td >
......@@ -3010,8 +3027,11 @@ RESERVED[10:3]
</td>
</tr>
<tr>
<td style="border: solid 1px black;" colspan=3 class="td_field">
RESERVED[2:0]
<td style="border: solid 1px black;" colspan=2 class="td_field">
RESERVED[1:0]
</td>
<td style="border: solid 1px black;" colspan=1 class="td_field">
ACQ_CFG
</td>
<td style="border: solid 1px black;" colspan=1 class="td_field">
SERDES_SYNCED
......@@ -3030,9 +3050,6 @@ FSM[2:0]
</td>
<td >
</td>
<td >
</td>
</tr>
</table>
......@@ -3040,7 +3057,7 @@ FSM[2:0]
<li><b>
FSM
</b>[<i>read-only</i>]: State machine status
<br>States:<br>0: illegal<br>1: IDLE<br>2: PRE_TRIG<br>3: WAIT_TRIG<br>4: POST_TRIG<br>5: DECR_SHOT<br>6: illegal<br>7: illegal
<br>States:<br>0: illegal<br>1: IDLE<br>2: PRE_TRIG<br>3: WAIT_TRIG<br>4: POST_TRIG<br>5: TRIG_TAG<br>6: DECR_SHOT<br>7: illegal
<li><b>
SERDES_PLL
</b>[<i>read-only</i>]: SerDes PLL status
......@@ -3050,6 +3067,10 @@ SERDES_SYNCED
</b>[<i>read-only</i>]: SerDes synchronization status
<br>0: bitslip in progress<br>1: serdes synchronized
<li><b>
ACQ_CFG
</b>[<i>read-only</i>]: Acquisition configuration status
<br>0: Unauthorised acquisition configuration (will prevent acquisition to start)<br>1: Valid acquisition configuration<br>- Shot number > 0<br>- Post-trigger sample > 0
<li><b>
RESERVED
</b>[<i>read-only</i>]: Reserved
<br>Ignore on read, write with 0's
......@@ -3334,7 +3355,7 @@ RESERVED
<li><b>
INT_TRIG_THRES
</b>[<i>read/write</i>]: Threshold for internal trigger
<br>Treated as binary two's complement and compared to raw ADC data
<br>Treated as binary two's complement and compared to raw ADC data.
</ul>
<a name="TRIG_DLY"></a>
<h3><a name="sect_3_4">3.4. Trigger delay</a></h3>
......@@ -4888,7 +4909,7 @@ PRE_SAMPLES[7:0]
<li><b>
PRE_SAMPLES
</b>[<i>read/write</i>]: Pre-trigger samples
<br>Number of requested pre-trigger samples
<br>Number of requested pre-trigger samples (>1).
</ul>
<a name="POST_SAMPLES"></a>
<h3><a name="sect_3_10">3.10. Post-trigger samples</a></h3>
......@@ -5146,7 +5167,7 @@ POST_SAMPLES[7:0]
<li><b>
POST_SAMPLES
</b>[<i>read/write</i>]: Post-trigger samples
<br>Number of requested post-trigger samples
<br>Number of requested post-trigger samples (>1).
</ul>
<a name="SAMPLES_CNT"></a>
<h3><a name="sect_3_11">3.11. Samples counter</a></h3>
......
......@@ -86,7 +86,7 @@ peripheral {
field {
name = "State machine status";
description = "States:\n0: illegal\n1: IDLE\n2: PRE_TRIG\n3: WAIT_TRIG\n4: POST_TRIG\n5: DECR_SHOT\n6: illegal\n7: illegal";
description = "States:\n0: illegal\n1: IDLE\n2: PRE_TRIG\n3: WAIT_TRIG\n4: POST_TRIG\n5: TRIG_TAG\n6: DECR_SHOT\n7: illegal";
prefix = "fsm";
type = SLV;
size = 3;
......@@ -112,12 +112,21 @@ peripheral {
access_dev = WRITE_ONLY;
};
field {
name = "Acquisition configuration status";
description = "0: Unauthorised acquisition configuration (will prevent acquisition to start)\n1: Valid acquisition configuration\n- Shot number > 0\n- Post-trigger sample > 0";
prefix = "acq_cfg";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Reserved";
description = "Ignore on read, write with 0's";
prefix = "reserved";
type = SLV;
size = 27;
size = 26;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
......@@ -190,7 +199,7 @@ peripheral {
field {
name = "Threshold for internal trigger";
description = "Treated as binary two's complement and compared to raw ADC data";
description = "Treated as binary two's complement and compared to raw ADC data.";
prefix = "int_trig_thres";
type = SLV;
size = 16;
......@@ -288,7 +297,7 @@ peripheral {
field {
name = "Pre-trigger samples";
description = "Number of requested pre-trigger samples";
description = "Number of requested pre-trigger samples (>1).";
type = SLV;
size = 32;
access_bus = READ_WRITE;
......@@ -302,7 +311,7 @@ peripheral {
field {
name = "Post-trigger samples";
description = "Number of requested post-trigger samples";
description = "Number of requested post-trigger samples (>1).";
type = SLV;
size = 32;
access_bus = READ_WRITE;
......
......@@ -3,7 +3,7 @@
---------------------------------------------------------------------------------------
-- File : ../rtl/carrier_csr.vhd
-- Author : auto-generated by wbgen2 from carrier_csr.wb
-- Created : Thu Aug 8 14:54:22 2013
-- Created : Wed Dec 11 11:55:04 2013
-- Standard : VHDL'87
---------------------------------------------------------------------------------------
-- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE carrier_csr.wb
......
......@@ -347,8 +347,8 @@ architecture rtl of spec_top_fmc_adc_100Ms is
name => "WB-FMC-ADC.EIC ")));
-- f_xwb_bridge_manual_sdb(size, sdb_addr)
-- Note: sdb_addr is the sdb records address relative to the parent interconnect
constant c_fmc0_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00004000");
-- Note: sdb_addr is the sdb records address relative to the bridge base address
constant c_fmc0_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00000000");
-- sdb header address
constant c_SDB_ADDRESS : t_wishbone_address := x"00000000";
......
This diff is collapsed.
......@@ -7,14 +7,21 @@ files = ["testbench/gn412x_bfm.vhd",
"testbench/util.vhd",
"testbench/tb_spec.vhd",
"testbench/cmd_router1.vhd",
"../ip_cores/adc_sync_fifo.vhd",
"../ip_cores/multishot_dpram.vhd",
"../ip_cores/wb_ddr_fifo.vhd",
"../ip_cores/adc_serdes.vhd",
"../ip_cores/monostable/monostable_rtl.vhd",
"../ip_cores/ext_pulse_sync/ext_pulse_sync_rtl.vhd",
"../ip_cores/utils/utils_pkg.vhd"]
"../../ip_cores/adc_sync_fifo.vhd",
"../../ip_cores/multishot_dpram.vhd",
"../../ip_cores/wb_ddr_fifo.vhd",
"../../ip_cores/adc_serdes.vhd",
"../../ip_cores/monostable/monostable_rtl.vhd",
"../../ip_cores/ext_pulse_sync/ext_pulse_sync_rtl.vhd",
"../../ip_cores/utils/utils_pkg.vhd"]
modules = { "local" : ["../rtl",
"../../adc/rtl",
"../../ip_cores/timetag_core/rtl",
"testbench",
"sim_models/2048Mb_ddr3"]}
"sim_models/2048Mb_ddr3"],
"git" : ["git://ohwr.org/hdl-core-lib/general-cores.git::proposed_master",
"git://ohwr.org/hdl-core-lib/ddr3-sp6-core.git::spec_bank3_64b_32b",
"git://ohwr.org/hdl-core-lib/gn4124-core.git::master"]}
fetchto="../../ip_cores"
......@@ -209,86 +209,106 @@ wait %d2000
-- onewire config
wr FF00000000001A04 F 007C0270
wr FF00000000001104 F 007C0270
wait %d100
wr FF00000000001A00 F 0000000A
wr FF00000000001100 F 0000000A
wait %d100
-- irq mask
wr FF00000000001508 F 0000000F
-- fmc eic set irq enable mask
wr FF00000000002004 F 00000003
-- dma eic set irq enable mask
wr FF00000000001404 F 00000003
-- vic set irq enable mask
wr FF00000000001308 F 00000003
-- vic config
wr FF00000000001300 F 00001777
-- release fmc reset
wr FF0000000000120C F 00000003
-- Set time-tag core seconds
wr FF00000000002100 F 00001234
-- Set time-tag core coarse time
wr FF00000000002104 F 00000000
-- trigger config (sw trig enable)
wr FF00000000001908 F 00000008
wr FF00000000005308 F 00000008
-- trigger config (hw int trig enable)
--wr FF00000000001908 F 00000004
--wr FF00000000005308 F 00000004
-- trigger config (int trig)
--wr FF00000000001908 F 02600004
--wr FF00000000005308 F 02600004
-- decimation factor = 1
wr FF0000000000191C F 00000001
wr FF0000000000531C F 00000001
-- pre-trig samples
wr FF00000000001920 F 00000100
wr FF00000000005320 F 00000000
-- post-trig samples
wr FF00000000001924 F 00001000
wr FF00000000005324 F 00000001
-- number of shots
wr FF00000000001914 F 00000001
wr FF00000000005314 F 00000003
-- Channel 1 gain
wr FF00000000001934 F 00008000
wr FF00000000005334 F 00008000
-- Channel 1 offset
wr FF00000000001938 F 00000000
wr FF00000000005338 F 00000000
-- Channel 2 gain
wr FF00000000001944 F 00008000
wr FF00000000005344 F 00008000
-- Channel 2 offset
wr FF00000000001948 F 00000000
wr FF00000000005348 F 00000000
-- Channel 3 gain
wr FF00000000001954 F 00008000
wr FF00000000005354 F 00008000
-- Channel 3 offset
wr FF00000000001958 F 00000000
wr FF00000000005358 F 00000000
-- Channel 4 gain
wr FF00000000001964 F 00008000
wr FF00000000005364 F 00008000
-- Channel 4 offset
wr FF00000000001968 F 00000000
wr FF00000000005368 F 00000000
-- Enable test data and sampling clock
--wr FF00000000001900 F 00000024
--wr FF00000000005300 F 00000024
-- Enable sampling clock
wr FF00000000001900 F 00000004
wr FF00000000005300 F 00000004
wait %d2000
-- start acquisition
--wr FF00000000001900 F 00000025
wr FF00000000001900 F 00000005
--wr FF00000000005300 F 00000025
wr FF00000000005300 F 00000005
wait %d800
-- sw trigger
wr FF00000000001910 F FFFFFFFF
wr FF00000000005310 F FFFFFFFF
wait %d800
-- stop acquisition
wr FF00000000001900 F 00000006
--wr FF00000000005300 F 00000006
wait %d800
-- sw trigger
--wr FF00000000001910 F FFFFFFFF
wr FF00000000005310 F FFFFFFFF
wait %d800
-- sw trigger
--wr FF00000000001910 F FFFFFFFF
wr FF00000000005310 F FFFFFFFF
wait %d800
-- sw trigger
--wr FF00000000001910 F FFFFFFFF
--wr FF00000000005310 F FFFFFFFF
wait %d800
-- sw trigger
--wr FF00000000001910 F FFFFFFFF
--wr FF00000000005310 F FFFFFFFF
wait %d1000
......@@ -316,11 +336,11 @@ wait %d3000
---------------------------------------------
-- start acquisition
--wr FF00000000001900 F 00000001
--wr FF00000000005300 F 00000001
wait %d500
-- sw trigger
--wr FF00000000001910 F FFFFFFFF
--wr FF00000000005310 F FFFFFFFF
wait %d400
......
......@@ -7,8 +7,9 @@ log -r /*
##do wave_onewire.do
##do wave_adc_core.do
##do wave_gnum.do
do wave_end_acq_irq.do
##do wave_end_acq_irq.do
##do wave_ddr_wb.do
do wave_trig_tag.do
view wave
view transcript
......
......@@ -227,45 +227,45 @@ architecture TEST of TB_SPEC is
DDR3_RZQ : inout std_logic;
-- FMC slot
ext_trigger_p_i : in std_logic; -- External trigger
ext_trigger_n_i : in std_logic;
adc_dco_p_i : in std_logic; -- ADC data clock
adc_dco_n_i : in std_logic;
adc_fr_p_i : in std_logic; -- ADC frame start
adc_fr_n_i : in std_logic;
adc_outa_p_i : in std_logic_vector(3 downto 0); -- ADC serial data (odd bits)
adc_outa_n_i : in std_logic_vector(3 downto 0);
adc_outb_p_i : in std_logic_vector(3 downto 0); -- ADC serial data (even bits)
adc_outb_n_i : in std_logic_vector(3 downto 0);
spi_din_i : in std_logic; -- SPI data from FMC
spi_dout_o : out std_logic; -- SPI data to FMC
spi_sck_o : out std_logic; -- SPI clock
spi_cs_adc_n_o : out std_logic; -- SPI ADC chip select (active low)
spi_cs_dac1_n_o : out std_logic; -- SPI channel 1 offset DAC chip select (active low)
spi_cs_dac2_n_o : out std_logic; -- SPI channel 2 offset DAC chip select (active low)
spi_cs_dac3_n_o : out std_logic; -- SPI channel 3 offset DAC chip select (active low)
spi_cs_dac4_n_o : out std_logic; -- SPI channel 4 offset DAC chip select (active low)
gpio_dac_clr_n_o : out std_logic; -- offset DACs clear (active low)
gpio_led_acq_o : out std_logic; -- Mezzanine front panel power LED (PWR)
gpio_led_trig_o : out std_logic; -- Mezzanine front panel trigger LED (TRIG)
gpio_ssr_ch1_o : out std_logic_vector(6 downto 0); -- Channel 1 solid state relays control
gpio_ssr_ch2_o : out std_logic_vector(6 downto 0); -- Channel 2 solid state relays control
gpio_ssr_ch3_o : out std_logic_vector(6 downto 0); -- Channel 3 solid state relays control
gpio_ssr_ch4_o : out std_logic_vector(6 downto 0); -- Channel 4 solid state relays control
gpio_si570_oe_o : out std_logic; -- Si570 (programmable oscillator) output enable
si570_scl_b : inout std_logic; -- I2C bus clock (Si570)
si570_sda_b : inout std_logic; -- I2C bus data (Si570)
mezz_one_wire_b : inout std_logic; -- 1-wire interface (DS18B20 thermometer + unique ID)
prsnt_m2c_n_i : in std_logic; -- Mezzanine present (active low)
sys_scl_b : inout std_logic; -- Mezzanine system I2C clock (EEPROM)
sys_sda_b : inout std_logic -- Mezzanine system I2C data (EEPROM)
adc0_ext_trigger_p_i : in std_logic; -- External trigger
adc0_ext_trigger_n_i : in std_logic;
adc0_dco_p_i : in std_logic; -- ADC data clock
adc0_dco_n_i : in std_logic;
adc0_fr_p_i : in std_logic; -- ADC frame start
adc0_fr_n_i : in std_logic;
adc0_outa_p_i : in std_logic_vector(3 downto 0); -- ADC serial data (odd bits)
adc0_outa_n_i : in std_logic_vector(3 downto 0);
adc0_outb_p_i : in std_logic_vector(3 downto 0); -- ADC serial data (even bits)
adc0_outb_n_i : in std_logic_vector(3 downto 0);
adc0_spi_din_i : in std_logic; -- SPI data from FMC
adc0_spi_dout_o : out std_logic; -- SPI data to FMC
adc0_spi_sck_o : out std_logic; -- SPI clock
adc0_spi_cs_adc_n_o : out std_logic; -- SPI ADC chip select (active low)
adc0_spi_cs_dac1_n_o : out std_logic; -- SPI channel 1 offset DAC chip select (active low)
adc0_spi_cs_dac2_n_o : out std_logic; -- SPI channel 2 offset DAC chip select (active low)
adc0_spi_cs_dac3_n_o : out std_logic; -- SPI channel 3 offset DAC chip select (active low)
adc0_spi_cs_dac4_n_o : out std_logic; -- SPI channel 4 offset DAC chip select (active low)
adc0_gpio_dac_clr_n_o : out std_logic; -- offset DACs clear (active low)
adc0_gpio_led_acq_o : out std_logic; -- Mezzanine front panel power LED (PWR)
adc0_gpio_led_trig_o : out std_logic; -- Mezzanine front panel trigger LED (TRIG)
adc0_gpio_ssr_ch1_o : out std_logic_vector(6 downto 0); -- Channel 1 solid state relays control
adc0_gpio_ssr_ch2_o : out std_logic_vector(6 downto 0); -- Channel 2 solid state relays control
adc0_gpio_ssr_ch3_o : out std_logic_vector(6 downto 0); -- Channel 3 solid state relays control
adc0_gpio_ssr_ch4_o : out std_logic_vector(6 downto 0); -- Channel 4 solid state relays control
adc0_gpio_si570_oe_o : out std_logic; -- Si570 (programmable oscillator) output enable
adc0_si570_scl_b : inout std_logic; -- I2C bus clock (Si570)
adc0_si570_sda_b : inout std_logic; -- I2C bus data (Si570)
adc0_one_wire_b : inout std_logic; -- 1-wire interface (DS18B20 thermometer + unique ID)
fmc0_prsnt_m2c_n_i : in std_logic; -- Mezzanine present (active low)
fmc0_sys_scl_b : inout std_logic; -- Mezzanine system I2C clock (EEPROM)
fmc0_sys_sda_b : inout std_logic -- Mezzanine system I2C data (EEPROM)
);
end component spec_top_fmc_adc_100Ms;
......@@ -615,45 +615,45 @@ begin
gpio => GPIO(9 downto 8), -- General Purpose Input/Output
-- FMC slot
ext_trigger_p_i => ext_trigger_p_i,
ext_trigger_n_i => ext_trigger_n_i,
adc_dco_p_i => adc_dco_p_i,
adc_dco_n_i => adc_dco_n_i,
adc_fr_p_i => adc_fr_p_i,
adc_fr_n_i => adc_fr_n_i,
adc_outa_p_i => adc_outa_p_i,
adc_outa_n_i => adc_outa_n_i,
adc_outb_p_i => adc_outb_p_i,
adc_outb_n_i => adc_outb_n_i,
spi_din_i => spi_din_i,
spi_dout_o => spi_dout_o,
spi_sck_o => spi_sck_o,
spi_cs_adc_n_o => spi_cs_adc_n_o ,
spi_cs_dac1_n_o => spi_cs_dac1_n_o,
spi_cs_dac2_n_o => spi_cs_dac2_n_o,
spi_cs_dac3_n_o => spi_cs_dac3_n_o,
spi_cs_dac4_n_o => spi_cs_dac4_n_o,
gpio_dac_clr_n_o => gpio_dac_clr_n_o,
gpio_led_acq_o => gpio_led_acq_o,
gpio_led_trig_o => gpio_led_trig_o,
gpio_ssr_ch1_o => gpio_ssr_ch1_o,
gpio_ssr_ch2_o => gpio_ssr_ch2_o,
gpio_ssr_ch3_o => gpio_ssr_ch3_o,
gpio_ssr_ch4_o => gpio_ssr_ch4_o,
gpio_si570_oe_o => gpio_si570_oe_o,
si570_scl_b => si570_scl_b,
si570_sda_b => si570_sda_b,
mezz_one_wire_b => mezz_one_wire_b,
prsnt_m2c_n_i => prsnt_m2c_n_i,
sys_scl_b => sys_scl_b,
sys_sda_b => sys_sda_b,
adc0_ext_trigger_p_i => ext_trigger_p_i,
adc0_ext_trigger_n_i => ext_trigger_n_i,
adc0_dco_p_i => adc_dco_p_i,
adc0_dco_n_i => adc_dco_n_i,
adc0_fr_p_i => adc_fr_p_i,
adc0_fr_n_i => adc_fr_n_i,
adc0_outa_p_i => adc_outa_p_i,
adc0_outa_n_i => adc_outa_n_i,
adc0_outb_p_i => adc_outb_p_i,
adc0_outb_n_i => adc_outb_n_i,
adc0_spi_din_i => spi_din_i,
adc0_spi_dout_o => spi_dout_o,
adc0_spi_sck_o => spi_sck_o,
adc0_spi_cs_adc_n_o => spi_cs_adc_n_o ,
adc0_spi_cs_dac1_n_o => spi_cs_dac1_n_o,
adc0_spi_cs_dac2_n_o => spi_cs_dac2_n_o,
adc0_spi_cs_dac3_n_o => spi_cs_dac3_n_o,
adc0_spi_cs_dac4_n_o => spi_cs_dac4_n_o,
adc0_gpio_dac_clr_n_o => gpio_dac_clr_n_o,
adc0_gpio_led_acq_o => gpio_led_acq_o,
adc0_gpio_led_trig_o => gpio_led_trig_o,
adc0_gpio_ssr_ch1_o => gpio_ssr_ch1_o,
adc0_gpio_ssr_ch2_o => gpio_ssr_ch2_o,
adc0_gpio_ssr_ch3_o => gpio_ssr_ch3_o,
adc0_gpio_ssr_ch4_o => gpio_ssr_ch4_o,
adc0_gpio_si570_oe_o => gpio_si570_oe_o,
adc0_si570_scl_b => si570_scl_b,
adc0_si570_sda_b => si570_sda_b,
adc0_one_wire_b => mezz_one_wire_b,
fmc0_prsnt_m2c_n_i => prsnt_m2c_n_i,
fmc0_sys_scl_b => sys_scl_b,
fmc0_sys_sda_b => sys_sda_b,
-- DDR3 interface
ddr3_a => ddr3_a_o,
......
......@@ -3,7 +3,7 @@
* File : carrier_csr.h
* Author : auto-generated by wbgen2 from carrier_csr.wb
* Created : Thu Aug 8 14:54:22 2013
* Created : Wed Dec 11 11:55:04 2013
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE carrier_csr.wb
......
......@@ -321,13 +321,13 @@ architecture rtl of svec_top_fmc_adc_100Ms is
constant c_WB_SLAVE_VIC : integer := 3; -- Vectored interrupt controller
constant c_WB_SLAVE_FMC0_EIC : integer := 4; -- FMC slot 1 interrupt controller
constant c_WB_SLAVE_FMC0_TIMETAG : integer := 5; -- FMC slot 1 timetag core
constant c_WB_SLAVE_FMC0_DDR_DAT : integer := 6; -- FMC slot 1 DDR data
constant c_WB_SLAVE_FMC0_DDR_ADR : integer := 7; -- FMC slot 1 DDR address
constant c_WB_SLAVE_FMC0_DDR_ADR : integer := 6; -- FMC slot 1 DDR address
constant c_WB_SLAVE_FMC0_DDR_DAT : integer := 7; -- FMC slot 1 DDR data
constant c_WB_SLAVE_FMC0_ADC : integer := 8; -- FMC slot 1 ADC mezzanine
constant c_WB_SLAVE_FMC1_EIC : integer := 9; -- FMC slot 2 interrupt controller
constant c_WB_SLAVE_FMC1_TIMETAG : integer := 10; -- FMC slot 2 timetag core
constant c_WB_SLAVE_FMC1_DDR_DAT : integer := 11; -- FMC slot 2 DDR data
constant c_WB_SLAVE_FMC1_DDR_ADR : integer := 12; -- FMC slot 2 DDR address
constant c_WB_SLAVE_FMC1_DDR_ADR : integer := 11; -- FMC slot 2 DDR address
constant c_WB_SLAVE_FMC1_DDR_DAT : integer := 12; -- FMC slot 2 DDR data
constant c_WB_SLAVE_FMC1_ADC : integer := 13; -- FMC slot 2 ADC mezzanine
......@@ -413,9 +413,9 @@ architecture rtl of svec_top_fmc_adc_100Ms is
name => "WB-DDR-Addr-Access ")));
-- f_xwb_bridge_manual_sdb(size, sdb_addr)
-- Note: sdb_addr is the sdb records address relative to the parent interconnect
constant c_fmc0_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00004000");
constant c_fmc1_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00008000");
-- Note: sdb_addr is the sdb records address relative to the bridge base address
constant c_fmc0_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00000000");
constant c_fmc1_bridge_sdb : t_sdb_bridge := f_xwb_bridge_manual_sdb(x"00001fff", x"00000000");
-- sdb header address
constant c_SDB_ADDRESS : t_wishbone_address := x"00000000";
......@@ -552,18 +552,18 @@ architecture rtl of svec_top_fmc_adc_100Ms is
signal led_state_man : std_logic_vector(15 downto 0);
-- DDR0 (bank 4)
signal ddr0_status : std_logic_vector(31 downto 0);
signal ddr0_calib_done : std_logic;
signal ddr0_addr_cnt : unsigned(31 downto 0);
signal ddr0_wb_cyc_d : std_logic;
signal ddr0_wb_cyc_fe : std_logic;
signal ddr0_status : std_logic_vector(31 downto 0);
signal ddr0_calib_done : std_logic;
signal ddr0_addr_cnt : unsigned(31 downto 0);
signal ddr0_dat_cyc_d : std_logic;
signal ddr0_addr_cnt_en : std_logic;
-- DDR1 (bank 5)
signal ddr1_status : std_logic_vector(31 downto 0);
signal ddr1_calib_done : std_logic;
signal ddr1_addr_cnt : unsigned(31 downto 0);
signal ddr1_wb_cyc_d : std_logic;
signal ddr1_wb_cyc_fe : std_logic;
signal ddr1_dat_cyc_d : std_logic;
signal ddr1_addr_cnt_en : std_logic;
-- Carrier 1-wire
signal carrier_owr_en : std_logic_vector(0 downto 0);
......@@ -582,6 +582,8 @@ architecture rtl of svec_top_fmc_adc_100Ms is
signal acq_start_p : std_logic_vector(c_NB_FMC_SLOTS-1 downto 0);
signal acq_stop_p : std_logic_vector(c_NB_FMC_SLOTS-1 downto 0);
signal acq_end_p : std_logic_vector(c_NB_FMC_SLOTS-1 downto 0);
signal fmc0_trigger_tag : t_timetag;
signal fmc1_trigger_tag : t_timetag;
-- led pwm
signal led_pwm_update_cnt : unsigned(9 downto 0);
......@@ -936,7 +938,7 @@ begin
------------------------------------------------------------------------------
cmp_fmc0_eic : fmc_adc_eic
port map(
rst_n_i => sys_rst_n,
rst_n_i => fmc0_rst_n,
clk_sys_i => sys_clk_125,
wb_adr_i => cnx_master_out(c_WB_SLAVE_FMC0_EIC).adr(3 downto 2), -- cnx_master_out.adr is byte address
wb_dat_i => cnx_master_out(c_WB_SLAVE_FMC0_EIC).dat,
......@@ -962,7 +964,7 @@ begin
------------------------------------------------------------------------------
cmp_fmc1_eic : fmc_adc_eic
port map(
rst_n_i => sys_rst_n,
rst_n_i => fmc1_rst_n,
clk_sys_i => sys_clk_125,
wb_adr_i => cnx_master_out(c_WB_SLAVE_FMC1_EIC).adr(3 downto 2), -- cnx_master_out.adr is byte address
wb_dat_i => cnx_master_out(c_WB_SLAVE_FMC1_EIC).dat,
......@@ -992,7 +994,7 @@ begin
p_ddr_wr_fifo_empty : process (sys_clk_125)
begin
if rising_edge(sys_clk_125) then
if sys_rst_n = '0' then
if fmc0_rst_n = '0' or fmc1_rst_n = '0' then
ddr_wr_fifo_empty_d(I) <= '0';
ddr_wr_fifo_empty_d1(I) <= '0';
else
......@@ -1009,7 +1011,7 @@ begin
p_acq_end_extend : process (sys_clk_125)
begin
if rising_edge(sys_clk_125) then
if sys_rst_n = '0' then
if fmc0_rst_n = '0' or fmc1_rst_n = '0' then
acq_end_extend(I) <= '0';
elsif acq_end_p(I) = '1' then
acq_end_extend(I) <= '1';
......@@ -1063,6 +1065,8 @@ begin
acq_stop_p_o => acq_stop_p(0),
acq_end_p_o => acq_end_p(0),
trigger_tag_i => fmc0_trigger_tag,
ext_trigger_p_i => adc0_ext_trigger_p_i,
ext_trigger_n_i => adc0_ext_trigger_n_i,
......@@ -1149,6 +1153,8 @@ begin
acq_stop_p_o => acq_stop_p(1),
acq_end_p_o => acq_end_p(1),
trigger_tag_i => fmc1_trigger_tag,
ext_trigger_p_i => adc1_ext_trigger_p_i,
ext_trigger_n_i => adc1_ext_trigger_n_i,
......@@ -1292,19 +1298,18 @@ begin
-- The counter is incremented on the falling edge of cyc. This is because the ddr controller
-- samples the address on (cyc_re and stb)+1
-- cyc falling edge detection
p_ddr0_wb_cyc : process (sys_clk_125)
p_ddr0_dat_cyc: process (sys_clk_125)
begin
if rising_edge(sys_clk_125) then
if (fmc0_rst_n = '0') then
ddr0_wb_cyc_d <= '0';
if fmc0_rst_n = '0' then
ddr0_dat_cyc_d <= '0';
else
ddr0_wb_cyc_d <= cnx_master_out(c_WB_SLAVE_FMC0_DDR_DAT).cyc;
ddr0_dat_cyc_d <= cnx_master_out(c_WB_SLAVE_FMC0_DDR_DAT).cyc;
end if;
end if;
end process p_ddr0_wb_cyc;
end process p_ddr0_dat_cyc;
ddr0_wb_cyc_fe <= not(cnx_master_out(c_WB_SLAVE_FMC0_DDR_DAT).cyc) and ddr0_wb_cyc_d;
ddr0_addr_cnt_en <= not(cnx_master_out(c_WB_SLAVE_FMC0_DDR_DAT).cyc) and ddr0_dat_cyc_d;
-- address counter
p_ddr0_addr_cnt : process (sys_clk_125)
......@@ -1316,7 +1321,7 @@ begin
cnx_master_out(c_WB_SLAVE_FMC0_DDR_ADR).stb = '1' and
cnx_master_out(c_WB_SLAVE_FMC0_DDR_ADR).cyc = '1') then
ddr0_addr_cnt <= unsigned(cnx_master_out(c_WB_SLAVE_FMC0_DDR_ADR).dat);
elsif (ddr0_wb_cyc_fe = '1') then
elsif (ddr0_addr_cnt_en = '1') then
ddr0_addr_cnt <= ddr0_addr_cnt + 1;
end if;
end if;
......@@ -1445,19 +1450,18 @@ begin
-- The counter is incremented on the falling edge of cyc. This is because the ddr controller
-- samples the address on (cyc_re and stb)+1
-- cyc falling edge detection
p_ddr1_wb_cyc : process (sys_clk_125)
p_ddr1_dat_cyc: process (sys_clk_125)
begin
if rising_edge(sys_clk_125) then
if (fmc1_rst_n = '0') then
ddr1_wb_cyc_d <= '0';
if fmc1_rst_n = '0' then
ddr1_dat_cyc_d <= '0';
else
ddr1_wb_cyc_d <= cnx_master_out(c_WB_SLAVE_FMC1_DDR_DAT).cyc;
ddr1_dat_cyc_d <= cnx_master_out(c_WB_SLAVE_FMC1_DDR_DAT).cyc;
end if;
end if;
end process p_ddr1_wb_cyc;
end process p_ddr1_dat_cyc;
ddr1_wb_cyc_fe <= not(cnx_master_out(c_WB_SLAVE_FMC1_DDR_DAT).cyc) and ddr1_wb_cyc_d;
ddr1_addr_cnt_en <= not(cnx_master_out(c_WB_SLAVE_FMC1_DDR_DAT).cyc) and ddr1_dat_cyc_d;
-- address counter
p_ddr1_addr_cnt : process (sys_clk_125)
......@@ -1469,7 +1473,7 @@ begin
cnx_master_out(c_WB_SLAVE_FMC1_DDR_ADR).stb = '1' and
cnx_master_out(c_WB_SLAVE_FMC1_DDR_ADR).cyc = '1') then
ddr1_addr_cnt <= unsigned(cnx_master_out(c_WB_SLAVE_FMC1_DDR_ADR).dat);
elsif (ddr1_wb_cyc_fe = '1') then
elsif (ddr1_addr_cnt_en = '1') then
ddr1_addr_cnt <= ddr1_addr_cnt + 1;
end if;
end if;
......@@ -1512,6 +1516,8 @@ begin
acq_stop_p_i => acq_stop_p(0),
acq_end_p_i => acq_end_p(0),
trig_tag_o => fmc0_trigger_tag,
wb_adr_i => cnx_master_out(c_WB_SLAVE_FMC0_TIMETAG).adr(6 downto 2), -- cnx_master_out.adr is byte address
wb_dat_i => cnx_master_out(c_WB_SLAVE_FMC0_TIMETAG).dat,
wb_dat_o => cnx_master_in(c_WB_SLAVE_FMC0_TIMETAG).dat,
......@@ -1541,6 +1547,8 @@ begin
acq_stop_p_i => acq_stop_p(1),
acq_end_p_i => acq_end_p(1),
trig_tag_o => fmc1_trigger_tag,
wb_adr_i => cnx_master_out(c_WB_SLAVE_FMC1_TIMETAG).adr(6 downto 2), -- cnx_master_out.adr is byte address
wb_dat_i => cnx_master_out(c_WB_SLAVE_FMC1_TIMETAG).dat,
wb_dat_o => cnx_master_in(c_WB_SLAVE_FMC1_TIMETAG).dat,
......
This diff is collapsed.
......@@ -112,6 +112,8 @@ module main;
initial begin
uint64_t d;
uint32_t wr_data;
uint64_t blt_addr[];
uint64_t blt_data[];
int i, result;
......@@ -121,12 +123,20 @@ module main;
#20us;
init_vme64x_core(acc);
$display("Release FMC0/1 reset\n");
acc.write('h120C, 'h3, A32|SINGLE|D32);
// Enable all interrupts
$display("Enable all interrupts\n");
acc.write('h1304, 'hF, A32|SINGLE|D32);
acc.read('h1308, d, A32|SINGLE|D32);
$display("Interrupt mask = 0x%x\n",d);
$display("Enable FMC0 and FMC1 interrupt vectors\n");
acc.write('h1308, 'h3, A32|SINGLE|D32);
acc.read('h1310, d, A32|SINGLE|D32);
$display("VIC interrupt mask = 0x%x\n",d);
acc.write('h1300, 'h3, A32|SINGLE|D32);
$display("Enable TRIGGER and END_ACQ in FMC0/1 EIC\n");
acc.write('h2000, 'h3, A32|SINGLE|D32);
acc.write('h6000, 'h3, A32|SINGLE|D32);
// Trigger setup (sw trigger)
$display("Trigger setup\n");
......@@ -150,12 +160,35 @@ module main;
$display("Software trigger\n");
acc.write('h5310, 'hFF, A32|SINGLE|D32);
/*
// Data "FIFO" test
acc.write('h2200, 'h0, A32|SINGLE|D32);
acc.read('h2200, d, A32|SINGLE|D32);
$display("Read DDR_ADR: 0x%x\n", d);
$display("Write data to DDR in BLT\n");
blt_addr = {'h3000};
blt_data = {'h1, 'h2, 'h3, 'h4, 'h5, 'h6, 'h7, 'h8 ,'h9, 'hA};
acc.writem(blt_addr, blt_data, A32|BLT|D32, result);
acc.write('h2200, 'h0, A32|SINGLE|D32);
acc.read('h2200, d, A32|SINGLE|D32);
$display("Read DDR_ADR: 0x%x\n", d);
$display("Read data from DDR in BLT");
blt_data = {};
acc.readm(blt_addr, blt_data, A32|BLT|D32, result);
for(i=0; i<10; i++)
begin
$display("Data %d: 0x%x\n", i, blt_data[i]);
end
*/
acc.write('h2200, 'h0, A32|SINGLE|D32);
for(i=0; i<5; i++)
begin
acc.read('h2100, d, A32|SINGLE|D32);
acc.read('h3000, d, A32|SINGLE|D32);
$display("Read %d: 0x%x\n", i, d);
end
......@@ -163,17 +196,17 @@ module main;
for(i=0; i<2; i++)
begin
wr_data = i;
acc.write('h2100, wr_data, A32|SINGLE|D32);
acc.write('h3000, wr_data, A32|SINGLE|D32);
$display("Write %d: 0x%x\n", i, wr_data);
end
acc.write('h2200, 'h0, A32|SINGLE|D32);
for(i=0; i<5; i++)
begin
acc.read('h2100, d, A32|SINGLE|D32);
acc.read('h3000, d, A32|SINGLE|D32);
$display("Read %d: 0x%x\n", i, d);
end
*/
end
......
......@@ -5,7 +5,8 @@ set NumericStdNoWarnings 1
#view wave
#view transcript
do wave_interrupt.do
#do wave_interrupt.do
do wave_ddr.do
radix -hexadecimal
run 50 us
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment