Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Trigger Distribution
Commits
8b15a770
Commit
8b15a770
authored
Sep 04, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hdl] update FMC-ADC
parent
08418922
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
24 deletions
+19
-24
fmc-adc-100m14b4cha-gw
dependencies/fmc-adc-100m14b4cha-gw
+1
-1
main.sv
hdl/testbench/wrtd_ref_spec150t_adc/main.sv
+0
-5
wrtd-adcin.c
software/firmware/adc/wrtd-adcin.c
+9
-9
wrtd-adcout.c
software/firmware/adc/wrtd-adcout.c
+8
-8
wrtd-rt-adc.c
software/firmware/adc/wrtd-rt-adc.c
+1
-1
No files found.
fmc-adc-100m14b4cha-gw
@
ce4ef303
Subproject commit
449a1292780c78986df8eb81ccc5c86f54e9bc52
Subproject commit
ce4ef303e38b0119c5c62a5634f8426ddc69b068
hdl/testbench/wrtd_ref_spec150t_adc/main.sv
View file @
8b15a770
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
`include
"wrtd_driver.svh"
`include
"wrtd_driver.svh"
`include
"fmc_adc_100Ms_csr.v"
`include
"fmc_adc_100Ms_csr.v"
`include
"fmc_adc_alt_trigout.v"
`define
DMA_BASE
'
h00c0
`define
DMA_BASE
'
h00c0
`define
VIC_BASE
'
h0100
`define
VIC_BASE
'
h0100
...
@@ -97,7 +96,6 @@ module main;
...
@@ -97,7 +96,6 @@ module main;
accA
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH4_SAT
,
'h7fff
)
;
accA
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH4_SAT
,
'h7fff
)
;
val
=
(
1'b1
<<
`FMC_ADC_100MS_CSR_TRIG_EN_EXT_OFFSET
)
;
val
=
(
1'b1
<<
`FMC_ADC_100MS_CSR_TRIG_EN_EXT_OFFSET
)
;
val
|=
(
1'b1
<<
`FMC_ADC_100MS_CSR_TRIG_EN_FWD_EXT_OFFSET
)
;
accA
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_TRIG_EN
,
val
)
;
accA
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_TRIG_EN
,
val
)
;
expected
=
'h39
;
expected
=
'h39
;
...
@@ -137,9 +135,6 @@ module main;
...
@@ -137,9 +135,6 @@ module main;
accB
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH3_SAT
,
'h7fff
)
;
accB
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH3_SAT
,
'h7fff
)
;
accB
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH4_SAT
,
'h7fff
)
;
accB
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_CH4_SAT
,
'h7fff
)
;
val
=
(
1'b1
<<
`FMC_ADC_100MS_CSR_TRIG_EN_ALT_TIME_OFFSET
)
;
accB
.
write
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_TRIG_EN
,
val
)
;
expected
=
'h39
;
expected
=
'h39
;
accB
.
read
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_STA
,
val
)
;
accB
.
read
(
`ADC_CSR_BASE
+
`ADDR_FMC_ADC_100MS_CSR_STA
,
val
)
;
if
(
val
!=
expected
)
if
(
val
!=
expected
)
...
...
software/firmware/adc/wrtd-adcin.c
View file @
8b15a770
...
@@ -30,7 +30,7 @@ static inline uint32_t adcin_readl(const struct wrtd_adcin_dev *dev, uint32_t re
...
@@ -30,7 +30,7 @@ static inline uint32_t adcin_readl(const struct wrtd_adcin_dev *dev, uint32_t re
static
inline
int
adcin_wr_link_up
(
struct
wrtd_adcin_dev
*
adcin
)
static
inline
int
adcin_wr_link_up
(
struct
wrtd_adcin_dev
*
adcin
)
{
{
return
adcin_readl
(
adcin
,
A
LT_TRIGOUT_STATUS
)
&
ALT
_TRIGOUT_WR_LINK
;
return
adcin_readl
(
adcin
,
A
UX_TRIGOUT_STATUS
)
&
AUX
_TRIGOUT_WR_LINK
;
}
}
static
inline
int
adcin_wr_time_locked
(
struct
wrtd_adcin_dev
*
adcin
)
static
inline
int
adcin_wr_time_locked
(
struct
wrtd_adcin_dev
*
adcin
)
...
@@ -45,7 +45,7 @@ static void adcin_wr_enable_lock(struct wrtd_adcin_dev *dev, int enable)
...
@@ -45,7 +45,7 @@ static void adcin_wr_enable_lock(struct wrtd_adcin_dev *dev, int enable)
static
inline
int
adcin_wr_time_ready
(
struct
wrtd_adcin_dev
*
adcin
)
static
inline
int
adcin_wr_time_ready
(
struct
wrtd_adcin_dev
*
adcin
)
{
{
return
adcin_readl
(
adcin
,
A
LT_TRIGOUT_STATUS
)
&
ALT
_TRIGOUT_WR_VALID
;
return
adcin_readl
(
adcin
,
A
UX_TRIGOUT_STATUS
)
&
AUX
_TRIGOUT_WR_VALID
;
}
}
static
inline
int
adcin_wr_sync_timeout
(
void
)
static
inline
int
adcin_wr_sync_timeout
(
void
)
...
@@ -62,28 +62,28 @@ static inline int adcin_wr_sync_timeout(void)
...
@@ -62,28 +62,28 @@ static inline int adcin_wr_sync_timeout(void)
*/
*/
static
void
adcin_input
(
struct
wrtd_adcin_dev
*
adcin
)
static
void
adcin_input
(
struct
wrtd_adcin_dev
*
adcin
)
{
{
uint32_t
status
=
adcin_readl
(
adcin
,
A
LT
_TRIGOUT_STATUS
);
uint32_t
status
=
adcin_readl
(
adcin
,
A
UX
_TRIGOUT_STATUS
);
uint32_t
mask
;
uint32_t
mask
;
struct
wrtd_event
ev
;
struct
wrtd_event
ev
;
int
i
;
int
i
;
/* Poll the FIFO and read the timestamp */
/* Poll the FIFO and read the timestamp */
if
(
!
(
status
&
A
LT
_TRIGOUT_TS_PRESENT
))
if
(
!
(
status
&
A
UX
_TRIGOUT_TS_PRESENT
))
return
;
return
;
mask
=
adcin_readl
(
adcin
,
A
LT
_TRIGOUT_TS_MASK_SEC
+
0
);
mask
=
adcin_readl
(
adcin
,
A
UX
_TRIGOUT_TS_MASK_SEC
+
0
);
ev
.
ts
.
seconds
=
adcin_readl
(
adcin
,
A
LT
_TRIGOUT_TS_MASK_SEC
+
4
);
ev
.
ts
.
seconds
=
adcin_readl
(
adcin
,
A
UX
_TRIGOUT_TS_MASK_SEC
+
4
);
ev
.
ts
.
ns
=
adcin_readl
(
adcin
,
A
LT
_TRIGOUT_TS_CYCLES
)
*
8
;
ev
.
ts
.
ns
=
adcin_readl
(
adcin
,
A
UX
_TRIGOUT_TS_CYCLES
)
*
8
;
ev
.
ts
.
frac
=
0
;
ev
.
ts
.
frac
=
0
;
for
(
i
=
0
;
i
<
ADCIN_NUM_CHANNELS
;
i
++
)
{
for
(
i
=
0
;
i
<
ADCIN_NUM_CHANNELS
;
i
++
)
{
/* The last channel is the ext trigger with a different mask */
/* The last channel is the ext trigger with a different mask */
if
(
i
==
ADCIN_NUM_CHANNELS
-
1
)
{
if
(
i
==
ADCIN_NUM_CHANNELS
-
1
)
{
if
(
!
(
mask
&
(
A
LT
_TRIGOUT_EXT_MASK
>>
32
)))
if
(
!
(
mask
&
(
A
UX
_TRIGOUT_EXT_MASK
>>
32
)))
continue
;
continue
;
}
}
else
if
(
!
(
mask
&
((
A
LT
_TRIGOUT_CH1_MASK
>>
32
)
<<
i
)))
else
if
(
!
(
mask
&
((
A
UX
_TRIGOUT_CH1_MASK
>>
32
)
<<
i
)))
continue
;
continue
;
memset
(
ev
.
id
,
0
,
WRTD_ID_LEN
);
memset
(
ev
.
id
,
0
,
WRTD_ID_LEN
);
...
...
software/firmware/adc/wrtd-adcout.c
View file @
8b15a770
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include "mockturtle-rt.h"
#include "mockturtle-rt.h"
#include <mockturtle-framework.h>
#include <mockturtle-framework.h>
#include "wrtd-common.h"
#include "wrtd-common.h"
#include "fmc_adc_a
lt
_trigin.h"
#include "fmc_adc_a
ux
_trigin.h"
#define OUT_QUEUE_MAXTIME 10
#define OUT_QUEUE_MAXTIME 10
#define OUT_QUEUE_PREFIX adcout_
#define OUT_QUEUE_PREFIX adcout_
...
@@ -91,7 +91,7 @@ static void adcout_drop_trigger(struct wrtd_adcout_dev *dev,
...
@@ -91,7 +91,7 @@ static void adcout_drop_trigger(struct wrtd_adcout_dev *dev,
adcout_out_queue_pop
(
q
);
adcout_out_queue_pop
(
q
);
/* Disarm the ADC output */
/* Disarm the ADC output */
adcout_writel
(
dev
,
0
,
A
LT
_TRIGIN_CTRL
);
adcout_writel
(
dev
,
0
,
A
UX
_TRIGIN_CTRL
);
wrtd_log
(
WRTD_LOG_MSG_EV_DISCARDED
,
reason
,
NULL
,
ev
,
now
);
wrtd_log
(
WRTD_LOG_MSG_EV_DISCARDED
,
reason
,
NULL
,
ev
,
now
);
}
}
...
@@ -105,7 +105,7 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
...
@@ -105,7 +105,7 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
{
{
struct
adcout_out_queue
*
q
=
&
dev
->
queue
;
struct
adcout_out_queue
*
q
=
&
dev
->
queue
;
struct
wrtd_event
*
ev
=
adcout_out_queue_front
(
q
);
struct
wrtd_event
*
ev
=
adcout_out_queue_front
(
q
);
uint32_t
ctrl
=
adcout_readl
(
dev
,
A
LT
_TRIGIN_CTRL
);
uint32_t
ctrl
=
adcout_readl
(
dev
,
A
UX
_TRIGIN_CTRL
);
struct
wrtd_tstamp
ts
;
struct
wrtd_tstamp
ts
;
/* Check if the output has triggered */
/* Check if the output has triggered */
...
@@ -117,7 +117,7 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
...
@@ -117,7 +117,7 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
return;
return;
}
}
#endif
#endif
if
(
ctrl
&
A
LT
_TRIGIN_CTRL_ENABLE
)
{
if
(
ctrl
&
A
UX
_TRIGIN_CTRL_ENABLE
)
{
/* Armed but still waiting for trigger */
/* Armed but still waiting for trigger */
struct
wrtd_tstamp
now
;
struct
wrtd_tstamp
now
;
ts_now
(
&
now
);
ts_now
(
&
now
);
...
@@ -147,10 +147,10 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
...
@@ -147,10 +147,10 @@ static void adcout_output (struct wrtd_adcout_dev *dev)
}
}
/* Program the output start time */
/* Program the output start time */
adcout_writel
(
dev
,
0
,
A
LT
_TRIGIN_SECONDS
+
0
);
adcout_writel
(
dev
,
0
,
A
UX
_TRIGIN_SECONDS
+
0
);
adcout_writel
(
dev
,
ev
->
ts
.
seconds
,
A
LT
_TRIGIN_SECONDS
+
4
);
adcout_writel
(
dev
,
ev
->
ts
.
seconds
,
A
UX
_TRIGIN_SECONDS
+
4
);
adcout_writel
(
dev
,
ev
->
ts
.
ns
/
8
,
A
LT
_TRIGIN_CYCLES
);
adcout_writel
(
dev
,
ev
->
ts
.
ns
/
8
,
A
UX
_TRIGIN_CYCLES
);
adcout_writel
(
dev
,
A
LT_TRIGIN_CTRL_ENABLE
,
ALT
_TRIGIN_CTRL
);
adcout_writel
(
dev
,
A
UX_TRIGIN_CTRL_ENABLE
,
AUX
_TRIGIN_CTRL
);
wrtd_log
(
WRTD_LOG_MSG_EV_CONSUMED
,
WRTD_LOG_CONSUMED_START
,
wrtd_log
(
WRTD_LOG_MSG_EV_CONSUMED
,
WRTD_LOG_CONSUMED_START
,
NULL
,
ev
,
NULL
);
NULL
,
ev
,
NULL
);
...
...
software/firmware/adc/wrtd-rt-adc.c
View file @
8b15a770
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include "mockturtle-rt.h"
#include "mockturtle-rt.h"
#include <mockturtle-framework.h>
#include <mockturtle-framework.h>
#include "wrtd-common.h"
#include "wrtd-common.h"
#include "fmc_adc_a
lt
_trigout.h"
#include "fmc_adc_a
ux
_trigout.h"
#define NBR_CPUS 1
#define NBR_CPUS 1
#define CPU_IDX 0
#define CPU_IDX 0
...
...
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