Clang-format C++

This commit is contained in:
abejgonzalez 2023-05-26 01:17:38 -07:00
parent 938351f426
commit 4b37e602e5
5 changed files with 16 additions and 20 deletions

View File

@ -213,10 +213,8 @@ size_t tracerv_t::process_tokens(int num_beats, int minimum_batch_beats) {
size_t minimum_batch_bytes = minimum_batch_beats * STREAM_WIDTH_BYTES;
// TODO. as opt can mmap file and just load directly into it.
alignas(4096) char OUTBUF[this->stream_depth * STREAM_WIDTH_BYTES];
auto bytes_received = pull(this->stream_idx,
OUTBUF,
maximum_batch_bytes,
minimum_batch_bytes);
auto bytes_received =
pull(this->stream_idx, OUTBUF, maximum_batch_bytes, minimum_batch_bytes);
// check that a tracefile exists (one is enough) since the manager
// does not create a tracefile when trace_enable is disabled, but the
// TracerV bridge still exists, and no tracefile is created by default.
@ -229,7 +227,7 @@ size_t tracerv_t::process_tokens(int num_beats, int minimum_batch_beats) {
std::placeholders::_1,
std::placeholders::_2);
}
serialize((uint64_t*)OUTBUF,
serialize((uint64_t *)OUTBUF,
bytes_received,
tracefile,
addInstruction,

View File

@ -281,7 +281,8 @@ void simulator_tick(
exit(exit_code);
}
} catch (std::exception &e) {
fprintf(stderr, "Caught Exception headed for the simulator: %s.\n", e.what());
fprintf(
stderr, "Caught Exception headed for the simulator: %s.\n", e.what());
abort();
} catch (...) {
// seriously, VCS will give you an unhelpful message if you let an exception
@ -293,11 +294,11 @@ void simulator_tick(
}
void simulator_entry() {
s_vpi_vlog_info info;
if (!vpi_get_vlog_info(&info)) {
abort();
}
s_vpi_vlog_info info;
if (!vpi_get_vlog_info(&info)) {
abort();
}
entry(info.argc, info.argv);
entry(info.argc, info.argv);
}
}

View File

@ -27,7 +27,8 @@ create_simulation(simif_t &simif,
extern std::unique_ptr<simif_t>
create_simif(const TargetConfig &config, int argc, char **argv);
std::unique_ptr<simif_t> simulator; // must exist for dpi.cc calls in emulation, must be global to avoid deletion
std::unique_ptr<simif_t> simulator; // must exist for dpi.cc calls in emulation,
// must be global to avoid deletion
std::unique_ptr<simulation_t> simulation; // must be global to avoid deletion
// Entry point of the driver.
@ -60,8 +61,7 @@ int entry(int argc, char **argv) {
#define GET_BRIDGE_CONSTRUCTOR
#include "FireSim-generated.const.h"
#undef GET_BRIDGE_CONSTRUCTOR
}
// clang-format on
} // clang-format on
// Create the simulation instance.
simulation = create_simulation(simif, *widget_registry_ptr, args);

View File

@ -3,6 +3,4 @@
#include "entry.h"
// Calls the entry point of the driver.
int main(int argc, char **argv) {
return entry(argc, argv);
}
int main(int argc, char **argv) { return entry(argc, argv); }

View File

@ -1,5 +1,5 @@
#include <signal.h>
#include "emul/simif_emul.h"
#include <signal.h>
/**
* VCS-specific metasimulator implementation.
@ -21,8 +21,7 @@ simif_emul_vcs_t::simif_emul_vcs_t(const TargetConfig &config,
int argc,
char **argv)
: simif_emul_t(config, std::vector<std::string>(argv + 1, argv + argc)),
argc(argc), argv(argv) {
}
argc(argc), argv(argv) {}
int simif_emul_vcs_t::run(simulation_t &sim) {
start_driver(sim);