Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
RTSD
HDL
Commits
4010ce00
Commit
4010ce00
authored
4 years ago
by
Reinier van der Walle
Browse files
Options
Downloads
Patches
Plain Diff
Prcocessed review comments
parent
0520fa5a
No related branches found
No related tags found
2 merge requests
!100
Removed text for XSub that is now written in Confluence Subband correlator...
,
!64
Resolve L2SDP-189
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/ta2/designs/ta2_unb2b_mm_demo/ta2_unb2b_mm_demo.cl
+10
-8
10 additions, 8 deletions
...ations/ta2/designs/ta2_unb2b_mm_demo/ta2_unb2b_mm_demo.cl
with
10 additions
and
8 deletions
applications/ta2/designs/ta2_unb2b_mm_demo/ta2_unb2b_mm_demo.cl
+
10
−
8
View file @
4010ce00
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#
include
<ihc_apint.h>
#
include
<ihc_apint.h>
#
define
DIVIDE_AND_ROUND_UP
(
A,B
)
(((
A
)
+
(
B
)
-1
)
/
(
B
))
enum
mm_channel
{
enum
mm_channel
{
CH_PROCESS_A,
CH_PROCESS_A,
CH_PROCESS_B,
CH_PROCESS_B,
...
@@ -48,12 +50,12 @@ struct param_process_b_struct {
...
@@ -48,12 +50,12 @@ struct param_process_b_struct {
union
param_process_a
{
union
param_process_a
{
struct
param_process_a_struct
parameters
;
struct
param_process_a_struct
parameters
;
uint
arr[sizeof
(
struct
param_process_a_struct
)
/
sizeof
(
uint
)
]
;
uint
arr[
DIVIDE_AND_ROUND_UP
(
sizeof
(
struct
param_process_a_struct
)
,
sizeof
(
uint
)
)
]
;
}
;
}
;
union
param_process_b
{
union
param_process_b
{
struct
param_process_b_struct
parameters
;
struct
param_process_b_struct
parameters
;
uint
arr[sizeof
(
struct
param_process_b_struct
)
/
sizeof
(
uint
)
]
;
uint
arr[
DIVIDE_AND_ROUND_UP
(
sizeof
(
struct
param_process_b_struct
)
,
sizeof
(
uint
)
)
]
;
}
;
}
;
...
@@ -66,7 +68,7 @@ struct reg {
...
@@ -66,7 +68,7 @@ struct reg {
struct
mm_in
{
struct
mm_in
{
uint
wrdata
;
uint
wrdata
;
uint
address
;
uint
address
;
uchar
wr
;
bool
wr
;
}
__attribute__
((
packed
))
;
}
__attribute__
((
packed
))
;
struct
mm_out
{
struct
mm_out
{
...
@@ -88,8 +90,8 @@ __kernel void mm_in_controller()
...
@@ -88,8 +90,8 @@ __kernel void mm_in_controller()
{
{
//
Regmap
table
with
offset,
size
//
Regmap
table
with
offset,
size
const
struct
reg
regmap[LAST_MM_CHANNEL_ENTRY]
=
{
const
struct
reg
regmap[LAST_MM_CHANNEL_ENTRY]
=
{
{0x00,
sizeof
(
struct
param_process_a_struct
)
/
sizeof
(
uint
)
},
{0x00,
DIVIDE_AND_ROUND_UP
(
sizeof
(
struct
param_process_a_struct
)
,
sizeof
(
uint
)
)
},
{0x02,
sizeof
(
struct
param_process_b_struct
)
/
sizeof
(
uint
)
}
{0x02,
DIVIDE_AND_ROUND_UP
(
sizeof
(
struct
param_process_b_struct
)
,
sizeof
(
uint
)
)
}
}
;
}
;
while
(
1
)
while
(
1
)
{
{
...
@@ -159,7 +161,7 @@ __kernel void process_a()
...
@@ -159,7 +161,7 @@ __kernel void process_a()
//
handle
MM
read/write
requests
//
handle
MM
read/write
requests
struct
mm_in
mm_request
=
read_channel_intel
(
mm_channel_in[CH_PROCESS_A]
)
; //blocking read
struct
mm_in
mm_request
=
read_channel_intel
(
mm_channel_in[CH_PROCESS_A]
)
; //blocking read
struct
mm_out
mm_response
;
struct
mm_out
mm_response
;
if
(
mm_request.wr
>
0
)
//write
request
if
(
mm_request.wr
)
//write
request
{
{
reg.arr[mm_request.address]
=
mm_request.wrdata
;
reg.arr[mm_request.address]
=
mm_request.wrdata
;
}
else
{
//read
request
}
else
{
//read
request
...
@@ -187,7 +189,7 @@ __kernel void process_b()
...
@@ -187,7 +189,7 @@ __kernel void process_b()
//
handle
MM
read/write
requests
//
handle
MM
read/write
requests
struct
mm_in
mm_request
=
read_channel_intel
(
mm_channel_in[CH_PROCESS_B]
)
; //blocking read
struct
mm_in
mm_request
=
read_channel_intel
(
mm_channel_in[CH_PROCESS_B]
)
; //blocking read
struct
mm_out
mm_response
;
struct
mm_out
mm_response
;
if
(
mm_request.wr
>
0
)
//write
request
if
(
mm_request.wr
)
//write
request
{
{
reg.arr[mm_request.address]
=
mm_request.wrdata
;
reg.arr[mm_request.address]
=
mm_request.wrdata
;
}
else
{
//read
request
}
else
{
//read
request
...
@@ -196,7 +198,7 @@ __kernel void process_b()
...
@@ -196,7 +198,7 @@ __kernel void process_b()
}
}
//
Do
someting
with
parameters
//
Do
someting
with
parameters
if
(
mm_request.wr
>
0
&&
mm_request.address
==
1
)
if
(
mm_request.wr
&&
mm_request.address
==
1
)
reg.parameters.acc
+=
2
;
reg.parameters.acc
+=
2
;
}
}
...
...
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