return 0;
uint32_t num_segs = input_config->num_segments;
- char **segment_table = new char *[num_segs];
+ char **segt = new char *[num_segs];
bool is_kernel = false;
/* Reconstruct the segment table for libmrpsim */
if (input_config->input_mode != TRINITY_INPUT_HW) {
EmulElement *elem = elem_map_.find (dmabuf);
if (elem == nullptr) {
- delete[] segment_table;
+ delete[] segt;
return -EINVAL;
}
/* Here, set virtual address for emulations */
- segment_table[i] = static_cast<char *> (elem->getAddr ()) + offset;
+ segt[i] = static_cast<char *> (elem->getAddr ()) + offset;
} else {
is_kernel = true;
break;
/* internal logic error */
assert (status == 0);
/* FIXME: does not support execution of kernel requests in emulation */
- delete[] segment_table;
+ delete[] segt;
} else {
std::string cmd_path (prefix_share_);
if (elem_model->getNpuTops () == 2)
cmd_path += "/mRPsim/triv2.cmd";
std::string prof_path (prefix_profile_);
- prof_path += "/ne_profile." + std::to_string (req_id);
+ prof_path += "/ne_profile_" + std::to_string (getpid ());
- req->run_emul (prog, segment_table, static_cast<char *> (elem_metadata->getAddr ()), cmd_path,
- prof_path);
+ if (createDirectory (prof_path)) {
+ prof_path += "/req_id_" + std::to_string (req_id);
+ req->run_emul (prog, segt, static_cast<char *> (elem_metadata->getAddr ()), cmd_path,
+ prof_path);
+ } else {
+ logerr (TAG, "Unable to create a profile directory: %s\n", prof_path.c_str ());
+ delete[] segt;
+ }
delete req;
}
}
std::string prof_path (prefix_profile_);
- prof_path += "/ne_profile." + std::to_string (req_id) + ".rec";
+ prof_path += "/ne_profile_" + std::to_string (getpid ());
+ prof_path += "/req_id_" + std::to_string (req_id) + ".rec";
std::ifstream ifs (prof_path, std::ios::binary);
if (!ifs.good ()) {