Skip to content

Commit 0426d80

Browse files
authored
FPGA: reduce snappy decompression simulation duration (#1478)
When using Questa FSE, the simulation time of the snappy decompression of Stratix 10 was excessively long, This PR reduces the problem size when running in simulation to speed up the execution time. This PR is a port of #1475.
1 parent 876a9de commit 0426d80

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
3+
4+
5+
ALICE'S ADVENTURES IN WONDERLAND
6+
7+
Lewis Carroll
8+
9+
THE MILLENNIUM FULCRUM EDITION 2.9
10+
11+
12+
13+
14+
CHAPTER I
15+
16+
Down the Rabbit-Hole
17+
18+
19+
Alice was beginning to get very tired of sitting by her sister
20+
on the bank, and of having nothing to do: once or twice she had
21+
peeped into the book her sister was reading, but it had no
22+
pictures or conversations in it, `and what is the use of a book,'
23+
thought Alice `without pictures or conversation?'

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress/src/main.cpp

+17-3
Original file line numberDiff line numberDiff line change
@@ -240,23 +240,37 @@ bool RunGzipTest(sycl::queue& q, GzipDecompressorT decompressor,
240240
bool RunSnappyTest(sycl::queue& q, SnappyDecompressorT decompressor,
241241
const std::string test_dir) {
242242

243+
244+
#ifdef FPGA_SIMULATOR
243245
std::cout << ">>>>> Alice In Wonderland Test <<<<<" << std::endl;
244-
std::string alice_in_file = test_dir + "/alice29.txt.sz";
246+
std::string alice_in_file = test_dir + "/alice29_small.txt.sz";
245247
auto in_bytes = ReadInputFile(alice_in_file);
246248
auto result = decompressor.DecompressBytes(q, in_bytes, 1, false);
247249

248-
std::string alice_ref_file = test_dir + "/alice29.ref.txt";
250+
std::string alice_ref_file = test_dir + "/alice29_small_ref.txt";
249251
auto ref_bytes = ReadInputFile(alice_ref_file);
250252
bool alice_test_pass =
251253
(result != std::nullopt) && (result.value() == ref_bytes);
252254

253255
PrintTestResults("Alice In Wonderland Test", alice_test_pass);
254256
std::cout << std::endl;
255257

256-
#ifdef FPGA_SIMULATOR
257258
return alice_test_pass;
258259
#else
259260

261+
std::cout << ">>>>> Alice In Wonderland Test <<<<<" << std::endl;
262+
std::string alice_in_file = test_dir + "/alice29.txt.sz";
263+
auto in_bytes = ReadInputFile(alice_in_file);
264+
auto result = decompressor.DecompressBytes(q, in_bytes, 1, false);
265+
266+
std::string alice_ref_file = test_dir + "/alice29.ref.txt";
267+
auto ref_bytes = ReadInputFile(alice_ref_file);
268+
bool alice_test_pass =
269+
(result != std::nullopt) && (result.value() == ref_bytes);
270+
271+
PrintTestResults("Alice In Wonderland Test", alice_test_pass);
272+
std::cout << std::endl;
273+
260274
std::cout << ">>>>> Only Literal Strings Test <<<<<" << std::endl;
261275
auto test1_bytes = GenerateSnappyCompressedData(333, 3, 0, 0, 3);
262276
auto test1_ret = decompressor.DecompressBytes(q, test1_bytes, 1, false);

0 commit comments

Comments
 (0)