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
d0759cb2
Commit
d0759cb2
authored
Aug 09, 2018
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change character codec
parent
1fc5e482
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
179 additions
and
179 deletions
+179
-179
main.cpp
hls/lines128_length256/main.cpp
+6
-6
router.cpp
hls/lines128_length256/router.cpp
+161
-161
router.hpp
hls/lines128_length256/router.hpp
+12
-12
No files found.
hls/lines128_length256/main.cpp
View file @
d0759cb2
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
using
namespace
std
;
using
namespace
std
;
//
テストデータ (文字列形式
)
//
テストデータ (文字列形式)
// NL_Q00.txt
// NL_Q00.txt
//char boardstr[BOARDSTR_SIZE] = "X10Y05Z3L0000107041L0004107002L0102102021L0900100003";
//char boardstr[BOARDSTR_SIZE] = "X10Y05Z3L0000107041L0004107002L0102102021L0900100003";
// NL_Q06.txt
// NL_Q06.txt
...
@@ -29,9 +29,9 @@ int main(int argc, char *argv[]) {
...
@@ -29,9 +29,9 @@ int main(int argc, char *argv[]) {
// NL_Q08.txt
// NL_Q08.txt
//char boardstr[BOARDSTR_SIZE] = "X17Y20Z2L0000103022L1603115052L0916107032L0302108012L1104111042L1002100002L0919116162L1616113182L1001115012L0500201182L1603213152L0600210022";
//char boardstr[BOARDSTR_SIZE] = "X17Y20Z2L0000103022L1603115052L0916107032L0302108012L1104111042L1002100002L0919116162L1616113182L1001115012L0500201182L1603213152L0600210022";
//
指定されてればコマンドラインから問題文字列を読み込む
//
指定されてればコマンドラインから問題文字列を読み込む
if
(
1
<
argc
)
{
if
(
1
<
argc
)
{
//
先頭がXではないならば標準入力から読み込む
//
先頭がXではないならば標準入力から読み込む
if
(
argv
[
1
][
0
]
!=
'X'
)
if
(
argv
[
1
][
0
]
!=
'X'
)
{
{
char
*
c_p
=
fgets
(
boardstr
,
BOARDSTR_SIZE
,
stdin
);
char
*
c_p
=
fgets
(
boardstr
,
BOARDSTR_SIZE
,
stdin
);
...
@@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
...
@@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
}
}
}
}
//
指定されてればシード値を読み込む
//
指定されてればシード値を読み込む
int
seed
=
12345
;
int
seed
=
12345
;
if
(
2
<
argc
)
{
if
(
2
<
argc
)
{
seed
=
atoi
(
argv
[
2
]);
seed
=
atoi
(
argv
[
2
]);
...
@@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
...
@@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
int
size_y
=
(
boardstr
[
4
]
-
'0'
)
*
10
+
(
boardstr
[
5
]
-
'0'
);
int
size_y
=
(
boardstr
[
4
]
-
'0'
)
*
10
+
(
boardstr
[
5
]
-
'0'
);
int
size_z
=
(
boardstr
[
7
]
-
'0'
);
int
size_z
=
(
boardstr
[
7
]
-
'0'
);
//
ソルバ実行
//
ソルバ実行
ap_int
<
32
>
status
;
ap_int
<
32
>
status
;
clock_t
clock_start
,
clock_done
;
clock_t
clock_start
,
clock_done
;
clock_start
=
clock
();
clock_start
=
clock
();
...
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
...
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
cout
<<
"status = "
<<
(
int
)
status
<<
endl
;
cout
<<
"status = "
<<
(
int
)
status
<<
endl
;
cout
<<
"elapsed = "
<<
((
double
)(
clock_done
-
clock_start
)
/
CLOCKS_PER_SEC
)
<<
endl
<<
endl
;
cout
<<
"elapsed = "
<<
((
double
)(
clock_done
-
clock_start
)
/
CLOCKS_PER_SEC
)
<<
endl
<<
endl
;
//
解表示
//
解表示
cout
<<
"SOLUTION"
<<
endl
;
cout
<<
"SOLUTION"
<<
endl
;
cout
<<
"========"
<<
endl
;
cout
<<
"========"
<<
endl
;
cout
<<
"SIZE "
<<
size_x
<<
"X"
<<
size_y
<<
"X"
<<
size_z
<<
endl
;
cout
<<
"SIZE "
<<
size_x
<<
"X"
<<
size_y
<<
"X"
<<
size_z
<<
endl
;
...
...
hls/lines128_length256/router.cpp
View file @
d0759cb2
This diff is collapsed.
Click to expand it.
hls/lines128_length256/router.hpp
View file @
d0759cb2
...
@@ -13,33 +13,33 @@
...
@@ -13,33 +13,33 @@
#include <ap_int.h>
#include <ap_int.h>
#endif
#endif
//#define DEBUG_PRINT //
いろいろ表示する
//#define DEBUG_PRINT //
いろいろ表示する
#define USE_ASTAR // A*
探索を使う
#define USE_ASTAR // A*
探索を使う
#define USE_MOD_CALC //
ターゲットラインの選択に剰余演算を用いる
#define USE_MOD_CALC //
ターゲットラインの選択に剰余演算を用いる
using
namespace
std
;
using
namespace
std
;
//
各種設定値
//
各種設定値
#define MAX_WIDTH 72 // X, Y
の最大値 (7ビットで収まる
)
#define MAX_WIDTH 72 // X, Y
の最大値 (7ビットで収まる)
#define BITWIDTH_XY 13
#define BITWIDTH_XY 13
#define BITMASK_XY 65528 // 1111 1111 1111 1000
#define BITMASK_XY 65528 // 1111 1111 1111 1000
#define MAX_LAYER 8 // Z
の最大値 (3ビット
)
#define MAX_LAYER 8 // Z
の最大値 (3ビット)
#define BITWIDTH_Z 3
#define BITWIDTH_Z 3
#define BITMASK_Z 7 // 0000 0000 0000 0111
#define BITMASK_Z 7 // 0000 0000 0000 0111
#define MAX_CELLS 41472 //
セルの総数 =72*72*8 (16ビットで収まる
)
#define MAX_CELLS 41472 //
セルの総数 =72*72*8 (16ビットで収まる)
#define MAX_LINES 128 //
ライン数の最大値 (7ビット
)
#define MAX_LINES 128 //
ライン数の最大値 (7ビット)
#define MAX_PATH 256 // 1
つのラインが対応するセル数の最大値 (8ビット
)
#define MAX_PATH 256 // 1
つのラインが対応するセル数の最大値 (8ビット)
#define MAX_PQ 4096 //
探索時のプライオリティ・キューの最大サイズ (12ビット) 足りないかも?
#define MAX_PQ 4096 //
探索時のプライオリティ・キューの最大サイズ (12ビット) 足りないかも?
#define PQ_PRIORITY_WIDTH 16
#define PQ_PRIORITY_WIDTH 16
#define PQ_PRIORITY_MASK 65535 // 0000 0000 0000 0000 1111 1111 1111 1111
#define PQ_PRIORITY_MASK 65535 // 0000 0000 0000 0000 1111 1111 1111 1111
#define PQ_DATA_WIDTH 16
#define PQ_DATA_WIDTH 16
#define PQ_DATA_MASK 4294901760 // 1111 1111 1111 1111 0000 0000 0000 0000
#define PQ_DATA_MASK 4294901760 // 1111 1111 1111 1111 0000 0000 0000 0000
#define MAX_WEIGHT 255 //
重みの最大値 (8ビットで収まる
)
#define MAX_WEIGHT 255 //
重みの最大値 (8ビットで収まる)
#define BOARDSTR_SIZE 41472 //
ボードストリングの最大文字数 (セル数 72*72*8 あれば良い
)
#define BOARDSTR_SIZE 41472 //
ボードストリングの最大文字数 (セル数 72*72*8 あれば良い)
void
lfsr_random_init
(
ap_uint
<
32
>
seed
);
void
lfsr_random_init
(
ap_uint
<
32
>
seed
);
...
...
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