Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2018-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
adc2018
adc2018-system
Commits
ab546e29
Commit
ab546e29
authored
Aug 30, 2018
by
kazushi.kawamura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update a bitstream file
parent
266ebb97
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1130 additions
and
4 deletions
+1130
-4
Makefile.cygwin
hls_2018/router_05/Makefile.cygwin
+1
-1
router_design.bit
hls_2018/router_05/bitstream_kaba-san/router_design.bit
+0
-0
router_design.tcl
hls_2018/router_05/bitstream_kaba-san/router_design.tcl
+1113
-0
router.cpp
hls_2018/router_05/router.cpp
+15
-2
router.hpp
hls_2018/router_05/router.hpp
+1
-1
No files found.
hls_2018/router_05/Makefile.cygwin
View file @
ab546e29
...
...
@@ -7,7 +7,7 @@ CXXFLAGS = -O3 -Wall -Wno-unknown-pragmas -Wno-unused-label -DSOFTWARE -DCALCTIM
all
:
$(TARGET)
$(TARGET)
:
$(OBJS)
$(CXX)
-O3
-Wl
,--stack,
33554432
-o
$@
$(OBJS)
$(CXX)
-O3
-Wl
,--stack,
134217728
-o
$@
$(OBJS)
clean
:
rm
*
.o
...
...
hls_2018/router_05/bitstream_kaba-san/router_design.bit
0 → 100755
View file @
ab546e29
File added
hls_2018/router_05/bitstream_kaba-san/router_design.tcl
0 → 100755
View file @
ab546e29
This diff is collapsed.
Click to expand it.
hls_2018/router_05/router.cpp
View file @
ab546e29
...
...
@@ -17,11 +17,13 @@
static
ap_uint
<
32
>
lfsr
;
void
lfsr_random_init
(
ap_uint
<
32
>
seed
)
{
#pragma HLS INLINE
lfsr
=
seed
;
}
ap_uint
<
32
>
lfsr_random
()
{
#pragma HLS INLINE
bool
b_32
=
lfsr
.
get_bit
(
32
-
32
);
bool
b_22
=
lfsr
.
get_bit
(
32
-
22
);
...
...
@@ -54,9 +56,12 @@ bool pynqrouter(char boardstr[BOARDSTR_SIZE], char boardstr_high[BOARDSTR_SIZE],
*
status
=
-
1
;
// board
ap_int
<
LINE_BIT
+
1
>
board
[
MAX_CELLS
];
// -1024 ~ 1023 (Negative values mean terminals)
ap_int
<
LINE_BIT
+
1
>
board
[
MAX_CELLS
];
#pragma HLS ARRAY_PARTITION variable=board cyclic factor=64 dim=1
// -1024 ~ 1023 (Negative values mean terminals)
INIT_BOARD_ARRAY:
for
(
ap_uint
<
CELL_BIT
>
i
=
0
;
i
<
(
ap_uint
<
CELL_BIT
>
)(
BOARDSTR_SIZE
);
i
++
)
{
#pragma HLS UNROLL factor=128
board
[
i
]
=
0
;
}
...
...
@@ -97,8 +102,11 @@ bool pynqrouter(char boardstr[BOARDSTR_SIZE], char boardstr_high[BOARDSTR_SIZE],
// For each line
ap_uint
<
LINE_BIT
>
connected_line_num
=
0
;
bool
connected
[
MAX_LINES
];
#pragma HLS ARRAY_PARTITION variable=connected cyclic factor=2 dim=1
INIT_CONNECTED:
for
(
ap_uint
<
LINE_BIT
>
i
=
1
;
i
<=
(
ap_uint
<
LINE_BIT
>
)(
line_num
);
i
++
)
{
#pragma HLS LOOP_TRIPCOUNT min=2 max=20736
#pragma HLS UNROLL factor=4
connected
[
i
]
=
false
;
}
...
...
@@ -127,7 +135,7 @@ bool pynqrouter(char boardstr[BOARDSTR_SIZE], char boardstr_high[BOARDSTR_SIZE],
ap_uint
<
LINE_BIT
>
target
=
lfsr_random
()
%
line_num
+
1
;
#ifdef DEBUG_PRINT
cout
<<
"(round "
<<
round
<<
") LINE #"
<<
(
int
)
target
<<
" "
<<
lfsr_random
()
<<
endl
;
//
cout << "(round " << round << ") LINE #" << (int)target << " " << lfsr_random() << endl;
#endif
if
(
connected
[
target
])
continue
;
...
...
@@ -200,6 +208,7 @@ bool pynqrouter(char boardstr[BOARDSTR_SIZE], char boardstr_high[BOARDSTR_SIZE],
// ================================ //
bool
inside_board
(
ap_uint
<
CELL_BIT
>
cell_id
)
{
#pragma HLS INLINE
ap_uint
<
13
>
cell_xy
=
(
ap_uint
<
13
>
)(
cell_id
>>
BITWIDTH_Z
);
ap_uint
<
7
>
cell_x
=
(
ap_uint
<
7
>
)(
cell_xy
/
MAX_WIDTH
);
...
...
@@ -256,6 +265,7 @@ bool connectable(ap_int<LINE_BIT+1> board[MAX_CELLS], ap_uint<LINE_BIT> target,
ap_uint
<
CELL_BIT
>
id
=
prev
[
goal_id
];
BACKTRACK:
while
(
id
!=
start_id
)
{
#pragma HLS LOOP_TRIPCOUNT min=0 max=256
board
[
id
]
=
target
;
id
=
prev
[
id
];
}
}
...
...
@@ -266,6 +276,7 @@ bool connectable(ap_int<LINE_BIT+1> board[MAX_CELLS], ap_uint<LINE_BIT> target,
void
remove_line
(
ap_int
<
LINE_BIT
+
1
>
board
[
MAX_CELLS
],
ap_uint
<
LINE_BIT
>
rip_up
)
{
for
(
ap_uint
<
CELL_BIT
>
i
=
0
;
i
<
(
ap_uint
<
CELL_BIT
>
)(
MAX_CELLS
);
i
++
)
{
#pragma HLS UNROLL factor=64
if
(
!
inside_board
(
i
))
continue
;
if
(
board
[
i
]
==
rip_up
)
board
[
i
]
=
0
;
...
...
@@ -383,6 +394,7 @@ bool available(ap_uint<2> avail[MAX_CELLS], ap_uint<CELL_BIT> prev[MAX_CELLS], a
ap_uint
<
3
>
j
,
t
;
SHUFFLE_1:
for
(
ap_uint
<
3
>
a
=
0
;
a
<
p
;
a
++
)
{
#pragma HLS LOOP_TRIPCOUNT min=1 max=3
j
=
lfsr_random
()
%
p
;
t
=
search_order
[
a
];
search_order
[
a
]
=
search_order
[
j
];
...
...
@@ -390,6 +402,7 @@ bool available(ap_uint<2> avail[MAX_CELLS], ap_uint<CELL_BIT> prev[MAX_CELLS], a
}
SHUFFLE_2:
for
(
ap_uint
<
3
>
a
=
p
;
a
<
6
;
a
++
)
{
#pragma HLS LOOP_TRIPCOUNT min=3 max=5
j
=
lfsr_random
()
%
(
6
-
p
)
+
p
;
t
=
search_order
[
a
];
search_order
[
a
]
=
search_order
[
j
];
...
...
hls_2018/router_05/router.hpp
View file @
ab546e29
...
...
@@ -13,7 +13,7 @@
#include <ap_int.h>
#endif
//
#define DEBUG_PRINT // for debug
#define DEBUG_PRINT // for debug
#ifdef DEBUG_PRINT
using
namespace
std
;
...
...
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