Skip to content

Commit 8429e9e

Browse files
authored
feat all: remove redundant data and rename the tool to Simplifier (#17)
1 parent 3952640 commit 8429e9e

8 files changed

Lines changed: 476 additions & 469 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
### TMP files
22
.tmp
33
.TMP
4+
_tmp
5+
_TMP
46
experiment_table_*
57
light_review_*
68

BENCHMARKING.md

Lines changed: 421 additions & 0 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ endif()
7878

7979
# ===================================== SIMPLIFY ==================================== #
8080

81-
add_executable(simplify app/simplify.cpp)
82-
target_link_libraries(simplify argparse)
81+
add_executable(simplifier app/simplifier.cpp)
82+
target_link_libraries(simplifier argparse)
8383

8484
# *********************************************************************************** #

Makefile

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 39 additions & 421 deletions
Large diffs are not rendered by default.

app/simplify.cpp renamed to app/simplifier.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::optional<std::ofstream> openFileStat(argparse::ArgumentParser const& progra
120120
{
121121
std::ofstream statistics_stream(*output_file);
122122
statistics_stream << std::setprecision(3) << std::fixed;
123-
statistics_stream << "File path,Gates before,Gates after,Simplify time";
123+
statistics_stream << "File path,Gates before,Gates after,Simplificaton time";
124124

125125
// The following statistics is currently supported only for AIG basis.
126126
if (basis == AIG_BASIS)
@@ -219,7 +219,7 @@ void dumpStatistics(
219219
* @param logger Logger instance.
220220
* @param statistics_stream stream for statistics dumping (if provided).
221221
*/
222-
void simplify(
222+
void simplifier(
223223
std::string const& instance_path,
224224
argparse::ArgumentParser const& program,
225225
csat::Logger& logger,
@@ -308,10 +308,10 @@ void loadDatabases(argparse::ArgumentParser const& program, csat::Logger const&
308308
*/
309309
int main(int argn, char** argv)
310310
{
311-
csat::Logger logger("Simplify");
311+
csat::Logger logger("Simplifier");
312312

313313
// Set up argument parser.
314-
argparse::ArgumentParser program("simplify", "0.1");
314+
argparse::ArgumentParser program("simplifier", "0.1");
315315
program.add_argument("-i", "--input-path").help("directory with input .BENCH files");
316316
program.add_argument("-o", "--output").help("path to resulting directory");
317317
program.add_argument("-s", "--statistics").metavar("FILE").help("path to file for statistics writing");
@@ -321,7 +321,7 @@ int main(int argn, char** argv)
321321
.help("Path to a directory with databases.");
322322

323323
program.add_description(
324-
"The Simplify tool provides simplification of boolean circuits provided in\n"
324+
"The Simplifier tool provides simplification of boolean circuits provided in\n"
325325
"one of two bases: `AIG` or `BENCH`. To run simplification one should provide\n"
326326
"an `--input-path` and `--output` parameters: first is a path to the directory\n"
327327
"with boolean circuits, and second is a path where simplified circuits are to\n"
@@ -345,7 +345,7 @@ int main(int argn, char** argv)
345345
"\n"
346346
"Example usage command:\n"
347347
"\n"
348-
" ./build/simplify -i input_circuit/ -o result_circuits/ -s statistics.csv\n"
348+
" ./build/simplifier -i input_circuit/ -o result_circuits/ -s statistics.csv\n"
349349
"");
350350

351351
// Parse provided program arguments.
@@ -379,7 +379,7 @@ int main(int argn, char** argv)
379379

380380
std::string path = instance_path.path().string();
381381
logger.info("Processing benchmark ", path, ".");
382-
simplify(path, program, logger, statistics_stream);
382+
simplifier(path, program, logger, statistics_stream);
383383
}
384384

385385
return 0;

tools/table_2_finalizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def table_2_finalizer(
2323
):
2424
"""
2525
Finalizes statistics collected during "Table 2. Comparison of several runs of resyn2
26-
against several runs of resyn2 followed by a run of simplify." described in the
26+
against several runs of resyn2 followed by a run of Simplifier." described in the
2727
README.
2828
2929
Note that some paths are hardcoded by intention because this script purpose is
@@ -62,7 +62,7 @@ def table_2_finalizer(
6262

6363
r6_s_result = pd.read_csv(experiment_dir_path / "r6_s_result.csv", delimiter=',')
6464
r6_s_result = r6_s_result.rename(
65-
columns={'File path': 'circuit_name', 'Simplify time': 'time_r6_s'}
65+
columns={'File path': 'circuit_name', 'Simplifier time': 'time_r6_s'}
6666
)
6767
r6_s_result = r6_s_result[['circuit_name', 'time_r6_s']]
6868
r6_s_result['circuit_name'] = r6_s_result['circuit_name'].apply(
@@ -71,7 +71,7 @@ def table_2_finalizer(
7171

7272
r2_s_result = pd.read_csv(experiment_dir_path / "r2_s_result.csv", delimiter=',')
7373
r2_s_result = r2_s_result.rename(
74-
columns={'File path': 'circuit_name', 'Simplify time': 'time_r2_s'}
74+
columns={'File path': 'circuit_name', 'Simplifier time': 'time_r2_s'}
7575
)
7676
r2_s_result = r2_s_result[['circuit_name', 'time_r2_s']]
7777
r2_s_result['circuit_name'] = r2_s_result['circuit_name'].apply(

tools/table_3_finalizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def table_3_finalizer(
2323
):
2424
"""
2525
Finalizes statistics collected during "Table 3. Comparison of circuit sizes and
26-
running times between resyn2 and resyn2+simplify" described in the README.
26+
running times between resyn2 and resyn2+Simplifier" described in the README.
2727
2828
Note that some paths are hardcoded by intention because this script purpose is
2929
solely to finalize a specific experiment (as result, it expects specific files to be
@@ -56,7 +56,7 @@ def table_3_finalizer(
5656

5757
rs_result = pd.read_csv(experiment_dir_path / "rs_result.csv", delimiter=',')
5858
rs_result['circuit_name'] = rs_result['File path'].map(lambda x: x.rsplit('/')[-1])
59-
rs_result = rs_result.rename(columns={"Simplify time": "time_s"})
59+
rs_result = rs_result.rename(columns={"Simplifier time": "time_s"})
6060

6161
rs_result = rs_result[['circuit_name', 'time_s', 'Reduced subcircuits by iter']]
6262
rs_result['circuit_name'] = rs_result[['circuit_name']].map(

0 commit comments

Comments
 (0)