Skip to content

Commit

Permalink
changed the time unit to nanosecond for finer-grain profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi Li committed Jan 14, 2022
1 parent 4e7a5f5 commit 865d7c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/target-sc/ilator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ bool Ilator::GenerateExecuteKernel(const std::string& dir) {
"void {project}::LogInstrSequence(const std::string& instr_name, const long int& exec_time) {{\n"
" instr_log << \"Instr No. \" << std::setw(8) << GetInstrCntr() << '\\t';\n"
" instr_log << instr_name << \" is activated\\t\";\n"
" instr_log << \"exec_time: \" << exec_time * 1e-3 << \" ms\\n\";\n"
" instr_log << \"exec_time: \" << exec_time * 1e-6 << \" ms\\n\";\n"
" IncrementInstrCntr();\n"
"}}\n",
fmt::arg("project", GetProjectName()));
Expand Down Expand Up @@ -530,10 +530,10 @@ bool Ilator::GenerateExecuteKernel(const std::string& dir) {
" auto start = std::chrono::high_resolution_clock::now();\n"
"#endif\n"
" {update_func_name}();\n"
" {child_counter}"
" {child_counter}\n"
"#ifdef ILATOR_VERBOSE\n"
" auto stop = std::chrono::high_resolution_clock::now();\n"
" auto exec_time = std::chrono::duration_cast<std::chrono::microseconds>(stop-start).count();\n"
" auto exec_time = std::chrono::duration_cast<std::chrono::nanoseconds>(stop-start).count();\n"
" LogInstrSequence(\"{instr_name}\", exec_time);\n"
"#endif\n"
"}}\n",
Expand Down

0 comments on commit 865d7c9

Please sign in to comment.