Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fpga-network-stack
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
paulrr2
fpga-network-stack
Commits
0df3eb3a
Commit
0df3eb3a
authored
5 years ago
by
David Sidler
Browse files
Options
Downloads
Patches
Plain Diff
introducing response buffer to support up to 1024 connections
parent
0c774c1a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hls/iperf_client/iperf_client.cpp
+44
-24
44 additions, 24 deletions
hls/iperf_client/iperf_client.cpp
hls/iperf_client/iperf_client.hpp
+10
-1
10 additions, 1 deletion
hls/iperf_client/iperf_client.hpp
with
54 additions
and
25 deletions
hls/iperf_client/iperf_client.cpp
+
44
−
24
View file @
0df3eb3a
/************************************************
/************************************************
Copyright (c) 201
8
, Systems Group, ETH Zurich.
Copyright (c) 201
9
, Systems Group, ETH Zurich.
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
...
@@ -30,15 +30,29 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -30,15 +30,29 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
"iperf_client.hpp"
#include
"iperf_client.hpp"
#include
<iostream>
#include
<iostream>
//Buffers responses coming from the TCP stack
void
status_handler
(
hls
::
stream
<
appTxRsp
>&
txStatus
,
hls
::
stream
<
internalAppTxRsp
>&
txStatusBuffer
)
{
#pragma HLS PIPELINE II=1
#pragma HLS INLINE off
if
(
!
txStatus
.
empty
())
{
appTxRsp
resp
=
txStatus
.
read
();
txStatusBuffer
.
write
(
internalAppTxRsp
(
resp
.
sessionID
,
resp
.
error
));
}
}
template
<
int
WIDTH
>
template
<
int
WIDTH
>
void
client
(
stream
<
ipTuple
>&
openConnection
,
void
client
(
hls
::
stream
<
ipTuple
>&
openConnection
,
stream
<
openStatus
>&
openConStatus
,
hls
::
stream
<
openStatus
>&
openConStatus
,
stream
<
ap_uint
<
16
>
>&
closeConnection
,
hls
::
stream
<
ap_uint
<
16
>
>&
closeConnection
,
stream
<
appTxMeta
>&
txMetaData
,
hls
::
stream
<
appTxMeta
>&
txMetaData
,
stream
<
net_axis
<
WIDTH
>
>&
txData
,
hls
::
stream
<
net_axis
<
WIDTH
>
>&
txData
,
stream
<
a
ppTxRsp
>&
txStatus
,
hls
::
stream
<
internalA
ppTxRsp
>&
txStatus
,
stream
<
bool
>&
startSignal
,
hls
::
stream
<
bool
>&
startSignal
,
stream
<
bool
>&
stopSignal
,
hls
::
stream
<
bool
>&
stopSignal
,
ap_uint
<
1
>
runExperiment
,
ap_uint
<
1
>
runExperiment
,
ap_uint
<
1
>
dualModeEn
,
ap_uint
<
1
>
dualModeEn
,
ap_uint
<
14
>
useConn
,
ap_uint
<
14
>
useConn
,
...
@@ -178,7 +192,7 @@ void client( stream<ipTuple>& openConnection,
...
@@ -178,7 +192,7 @@ void client( stream<ipTuple>& openConnection,
}
}
else
if
(
!
txStatus
.
empty
())
else
if
(
!
txStatus
.
empty
())
{
{
a
ppTxRsp
resp
=
txStatus
.
read
();
internalA
ppTxRsp
resp
=
txStatus
.
read
();
if
(
resp
.
error
==
0
)
if
(
resp
.
error
==
0
)
{
{
currentSessionID
=
resp
.
sessionID
;
currentSessionID
=
resp
.
sessionID
;
...
@@ -226,7 +240,7 @@ void client( stream<ipTuple>& openConnection,
...
@@ -226,7 +240,7 @@ void client( stream<ipTuple>& openConnection,
case
CHECK_REQ
:
case
CHECK_REQ
:
if
(
!
txStatus
.
empty
())
if
(
!
txStatus
.
empty
())
{
{
a
ppTxRsp
resp
=
txStatus
.
read
();
internalA
ppTxRsp
resp
=
txStatus
.
read
();
if
(
resp
.
error
==
0
)
if
(
resp
.
error
==
0
)
{
{
currentSessionID
=
resp
.
sessionID
;
currentSessionID
=
resp
.
sessionID
;
...
@@ -428,18 +442,18 @@ void clock( hls::stream<bool>& startSignal,
...
@@ -428,18 +442,18 @@ void clock( hls::stream<bool>& startSignal,
}
}
void
iperf_client
(
stream
<
ap_uint
<
16
>
>&
listenPort
,
void
iperf_client
(
hls
::
stream
<
ap_uint
<
16
>
>&
listenPort
,
stream
<
bool
>&
listenPortStatus
,
hls
::
stream
<
bool
>&
listenPortStatus
,
stream
<
appNotification
>&
notifications
,
hls
::
stream
<
appNotification
>&
notifications
,
stream
<
appReadRequest
>&
readRequest
,
hls
::
stream
<
appReadRequest
>&
readRequest
,
stream
<
ap_uint
<
16
>
>&
rxMetaData
,
hls
::
stream
<
ap_uint
<
16
>
>&
rxMetaData
,
stream
<
net_axis
<
DATA_WIDTH
>
>&
rxData
,
hls
::
stream
<
net_axis
<
DATA_WIDTH
>
>&
rxData
,
stream
<
ipTuple
>&
openConnection
,
hls
::
stream
<
ipTuple
>&
openConnection
,
stream
<
openStatus
>&
openConStatus
,
hls
::
stream
<
openStatus
>&
openConStatus
,
stream
<
ap_uint
<
16
>
>&
closeConnection
,
hls
::
stream
<
ap_uint
<
16
>
>&
closeConnection
,
stream
<
appTxMeta
>&
txMetaData
,
hls
::
stream
<
appTxMeta
>&
txMetaData
,
stream
<
net_axis
<
DATA_WIDTH
>
>&
txData
,
hls
::
stream
<
net_axis
<
DATA_WIDTH
>
>&
txData
,
stream
<
appTxRsp
>&
txStatus
,
hls
::
stream
<
appTxRsp
>&
txStatus
,
ap_uint
<
1
>
runExperiment
,
ap_uint
<
1
>
runExperiment
,
ap_uint
<
1
>
dualModeEn
,
ap_uint
<
1
>
dualModeEn
,
ap_uint
<
14
>
useConn
,
ap_uint
<
14
>
useConn
,
...
@@ -509,15 +523,21 @@ void iperf_client( stream<ap_uint<16> >& listenPort,
...
@@ -509,15 +523,21 @@ void iperf_client( stream<ap_uint<16> >& listenPort,
#pragma HLS STREAM variable=startSignalFifo depth=2
#pragma HLS STREAM variable=startSignalFifo depth=2
#pragma HLS STREAM variable=stopSignalFifo depth=2
#pragma HLS STREAM variable=stopSignalFifo depth=2
//This is required to buffer up to 1024 reponses => supporting up to 1024 connections
static
hls
::
stream
<
internalAppTxRsp
>
txStatusBuffer
(
"txStatusBuffer"
);
#pragma HLS STREAM variable=txStatusBuffer depth=1024
/*
/*
* Client
* Client
*/
*/
status_handler
(
txStatus
,
txStatusBuffer
);
client
<
DATA_WIDTH
>
(
openConnection
,
client
<
DATA_WIDTH
>
(
openConnection
,
openConStatus
,
openConStatus
,
closeConnection
,
closeConnection
,
txMetaData
,
txMetaData
,
txData
,
txData
,
txStatus
,
txStatus
Buffer
,
startSignalFifo
,
startSignalFifo
,
stopSignalFifo
,
stopSignalFifo
,
runExperiment
,
runExperiment
,
...
...
This diff is collapsed.
Click to expand it.
hls/iperf_client/iperf_client.hpp
+
10
−
1
View file @
0df3eb3a
/************************************************
/************************************************
Copyright (c) 201
8
, Systems Group, ETH Zurich.
Copyright (c) 201
9
, Systems Group, ETH Zurich.
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
...
@@ -82,6 +82,15 @@ public:
...
@@ -82,6 +82,15 @@ public:
}
}
};
};
struct
internalAppTxRsp
{
ap_uint
<
16
>
sessionID
;
ap_uint
<
2
>
error
;
internalAppTxRsp
()
{}
internalAppTxRsp
(
ap_uint
<
16
>
id
,
ap_uint
<
2
>
err
)
:
sessionID
(
id
),
error
(
err
)
{}
};
void
iperf_client
(
hls
::
stream
<
ap_uint
<
16
>
>&
listenPort
,
void
iperf_client
(
hls
::
stream
<
ap_uint
<
16
>
>&
listenPort
,
hls
::
stream
<
bool
>&
listenPortStatus
,
hls
::
stream
<
bool
>&
listenPortStatus
,
hls
::
stream
<
appNotification
>&
notifications
,
hls
::
stream
<
appNotification
>&
notifications
,
...
...
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