Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
f25e567f
Commit
f25e567f
authored
9 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Adapt rhythm API to use up to 16 data streams
parent
4e42b243
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.cpp
+57
-21
57 additions, 21 deletions
...ce/Processors/DataThreads/rhythm-api/rhd2000evalboard.cpp
Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.h
+7
-3
7 additions, 3 deletions
Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.h
with
64 additions
and
24 deletions
Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.cpp
+
57
−
21
View file @
f25e567f
...
...
@@ -170,7 +170,7 @@ bool Rhd2000EvalBoard::uploadFpgaBitfile(string filename)
boardId
=
dev
->
GetWireOutValue
(
WireOutBoardId
);
boardVersion
=
dev
->
GetWireOutValue
(
WireOutBoardVersion
);
if
(
boardId
!=
RHYTHM_BOARD_ID
)
{
if
(
boardId
!=
(
usb3
?
RHYTHM_BOARD_ID
_USB3
:
RHYTHM_BOARD_ID_USB2
)
)
{
cerr
<<
"FPGA configuration does not support Rhythm. Incorrect board ID: "
<<
boardId
<<
endl
;
return
(
false
);
}
else
{
...
...
@@ -234,7 +234,7 @@ void Rhd2000EvalBoard::initialize()
setDataSource
(
7
,
PortD2
);
enableDataStream
(
0
,
true
);
// start with only one data stream enabled
for
(
i
=
1
;
i
<
MAX_NUM_DATA_STREAMS
;
i
++
)
{
for
(
i
=
1
;
i
<
MAX_NUM_DATA_STREAMS
(
usb3
)
;
i
++
)
{
enableDataStream
(
i
,
false
);
}
...
...
@@ -846,7 +846,7 @@ void Rhd2000EvalBoard::setDataSource(int stream, BoardDataSource dataSource)
int
bitShift
;
OkEndPoint
endPoint
;
if
(
stream
<
0
||
stream
>
7
)
{
if
(
stream
<
0
||
stream
>
(
MAX_NUM_DATA_STREAMS
(
usb3
)
-
1
)
)
{
cerr
<<
"Error in Rhd2000EvalBoard::setDataSource: stream out of range."
<<
endl
;
return
;
}
...
...
@@ -884,6 +884,38 @@ void Rhd2000EvalBoard::setDataSource(int stream, BoardDataSource dataSource)
endPoint
=
WireInDataStreamSel5678
;
bitShift
=
12
;
break
;
case
8
:
endPoint
=
WireInDataStreamSel1234
;
bitShift
=
16
;
break
;
case
9
:
endPoint
=
WireInDataStreamSel1234
;
bitShift
=
20
;
break
;
case
10
:
endPoint
=
WireInDataStreamSel1234
;
bitShift
=
24
;
break
;
case
11
:
endPoint
=
WireInDataStreamSel1234
;
bitShift
=
28
;
break
;
case
12
:
endPoint
=
WireInDataStreamSel5678
;
bitShift
=
16
;
break
;
case
13
:
endPoint
=
WireInDataStreamSel5678
;
bitShift
=
20
;
break
;
case
14
:
endPoint
=
WireInDataStreamSel5678
;
bitShift
=
24
;
break
;
case
15
:
endPoint
=
WireInDataStreamSel5678
;
bitShift
=
28
;
break
;
}
dev
->
SetWireInValue
(
endPoint
,
dataSource
<<
bitShift
,
0x000f
<<
bitShift
);
...
...
@@ -893,7 +925,7 @@ void Rhd2000EvalBoard::setDataSource(int stream, BoardDataSource dataSource)
// Enable or disable one of the eight available USB data streams (0-7).
void
Rhd2000EvalBoard
::
enableDataStream
(
int
stream
,
bool
enabled
)
{
if
(
stream
<
0
||
stream
>
(
MAX_NUM_DATA_STREAMS
-
1
))
{
if
(
stream
<
0
||
stream
>
(
MAX_NUM_DATA_STREAMS
(
usb3
)
-
1
))
{
cerr
<<
"Error in Rhd2000EvalBoard::setDataSource: stream out of range."
<<
endl
;
return
;
}
...
...
@@ -991,30 +1023,32 @@ void Rhd2000EvalBoard::enableDac(int dacChannel, bool enabled)
return
;
}
UINT32
dacEnMask
=
usb3
?
0x0400
:
0x0200
;
switch
(
dacChannel
)
{
case
0
:
dev
->
SetWireInValue
(
WireInDacSource1
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource1
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
1
:
dev
->
SetWireInValue
(
WireInDacSource2
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource2
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
2
:
dev
->
SetWireInValue
(
WireInDacSource3
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource3
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
3
:
dev
->
SetWireInValue
(
WireInDacSource4
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource4
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
4
:
dev
->
SetWireInValue
(
WireInDacSource5
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource5
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
5
:
dev
->
SetWireInValue
(
WireInDacSource6
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource6
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
6
:
dev
->
SetWireInValue
(
WireInDacSource7
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource7
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
case
7
:
dev
->
SetWireInValue
(
WireInDacSource8
,
(
enabled
?
0x0200
:
0x0000
),
0x0200
);
dev
->
SetWireInValue
(
WireInDacSource8
,
(
enabled
?
dacEnMask
:
0x0000
),
dacEnMask
);
break
;
}
dev
->
UpdateWireIns
();
...
...
@@ -1054,35 +1088,37 @@ void Rhd2000EvalBoard::selectDacDataStream(int dacChannel, int stream)
return
;
}
if
(
stream
<
0
||
stream
>
9
)
{
if
(
stream
<
0
||
stream
>
MAX_NUM_DATA_STREAMS
(
usb3
)
)
{
cerr
<<
"Error in Rhd2000EvalBoard::selectDacDataStream: stream out of range."
<<
endl
;
return
;
}
UINT32
dacStreamMask
=
(
usb3
?
0x03e0
:
0x01e0
);
switch
(
dacChannel
)
{
case
0
:
dev
->
SetWireInValue
(
WireInDacSource1
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource1
,
stream
<<
5
,
dacStreamMask
);
break
;
case
1
:
dev
->
SetWireInValue
(
WireInDacSource2
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource2
,
stream
<<
5
,
dacStreamMask
);
break
;
case
2
:
dev
->
SetWireInValue
(
WireInDacSource3
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource3
,
stream
<<
5
,
dacStreamMask
);
break
;
case
3
:
dev
->
SetWireInValue
(
WireInDacSource4
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource4
,
stream
<<
5
,
dacStreamMask
);
break
;
case
4
:
dev
->
SetWireInValue
(
WireInDacSource5
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource5
,
stream
<<
5
,
dacStreamMask
);
break
;
case
5
:
dev
->
SetWireInValue
(
WireInDacSource6
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource6
,
stream
<<
5
,
dacStreamMask
);
break
;
case
6
:
dev
->
SetWireInValue
(
WireInDacSource7
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource7
,
stream
<<
5
,
dacStreamMask
);
break
;
case
7
:
dev
->
SetWireInValue
(
WireInDacSource8
,
stream
<<
5
,
0x01e0
);
dev
->
SetWireInValue
(
WireInDacSource8
,
stream
<<
5
,
dacStreamMask
);
break
;
}
dev
->
UpdateWireIns
();
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.h
+
7
−
3
View file @
f25e567f
...
...
@@ -22,10 +22,14 @@
#define RHD2000EVALBOARD_H
#define USB_BUFFER_SIZE 2560000
#define RHYTHM_BOARD_ID 500
#define MAX_NUM_DATA_STREAMS 8
#define RHYTHM_BOARD_ID_USB2 500
#define RHYTHM_BOARD_ID_USB3 600
#define MAX_NUM_DATA_STREAMS_USB2 8
#define MAX_NUM_DATA_STREAMS_USB3 16
#define FIFO_CAPACITY_WORDS 67108864
#define MAX_NUM_DATA_STREAMS(u3) ( u3 ? MAX_NUM_DATA_STREAMS_USB3 : MAX_NUM_DATA_STREAMS_USB2 )
#define USB3_BLOCK_SIZE 512
#include
<queue>
...
...
@@ -167,7 +171,7 @@ private:
okCFrontPanel
*
dev
;
AmplifierSampleRate
sampleRate
;
int
numDataStreams
;
// total number of data streams currently enabled
int
dataStreamEnabled
[
MAX_NUM_DATA_STREAMS
];
// 0 (disabled) or 1 (enabled)
int
dataStreamEnabled
[
MAX_NUM_DATA_STREAMS
_USB3
];
// 0 (disabled) or 1 (enabled)
, set for maximum stream number
vector
<
int
>
cableDelay
;
// Buffer for reading bytes from USB interface
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment