Skip to content

Commit

Permalink
Fix formatting using clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ravikiranchollangi committed Dec 2, 2024
1 parent 6353d60 commit 3825f02
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
25 changes: 13 additions & 12 deletions src/Compiler/CompilerRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ std::string CompilerRS::FinishSynthesisScript(const std::string &script) {
no_sat = "-no_sat";
}

std::string init_registers = std::string("-init_registers ") + std::to_string(SynthInitRegisters()) + std::string(" ");
std::string init_registers = std::string("-init_registers ") +
std::to_string(SynthInitRegisters()) +
std::string(" ");
std::string limits;
limits += std::string("-max_lut ") + std::to_string(MaxDeviceLUTCount()) +
std::string(" ");
Expand Down Expand Up @@ -758,12 +760,12 @@ bool CompilerRS::RegisterCommands(TclInterpreter *interp, bool batchMode) {
if (option == "-init_registers" && i + 1 < argc) {
std::string arg = argv[++i];
if (arg == "2" || arg == "1" || arg == "0") {
const auto &[value, ok] = StringUtils::to_number<int>(arg);
if (ok) compiler->SynthInitRegisters(value);
continue;
}
else {
compiler->ErrorMessage("Unknown init registers option <0|1|2>: " + arg);
const auto &[value, ok] = StringUtils::to_number<int>(arg);
if (ok) compiler->SynthInitRegisters(value);
continue;
} else {
compiler->ErrorMessage("Unknown init registers option <0|1|2>: " +
arg);
return TCL_ERROR;
}
}
Expand Down Expand Up @@ -1076,8 +1078,7 @@ ArgumentsMap FOEDAG::TclArgs_getRsSynthesisOptions() {
argumets.addArgument("no_flatten",
compiler->SynthNoFlatten() ? "true" : "false");
argumets.addArgument("fast", compiler->SynthFast() ? "true" : "false");
argumets.addArgument("no_sat",
compiler->SynthNoSat() ? "true" : "false");
argumets.addArgument("no_sat", compiler->SynthNoSat() ? "true" : "false");
switch (compiler->GetNetlistType()) {
case Compiler::NetlistType::Blif:
argumets.addArgument("netlist_lang", "blif");
Expand Down Expand Up @@ -1108,7 +1109,8 @@ ArgumentsMap FOEDAG::TclArgs_getRsSynthesisOptions() {
argumets.addArgument("bram_limit", bram);
auto carry = StringUtils::to_string(compiler->MaxUserCarryLength());
argumets.addArgument("carry_chain_limit", carry);
auto init_registers = StringUtils::to_string(compiler->SynthInitRegisters());
auto init_registers =
StringUtils::to_string(compiler->SynthInitRegisters());
argumets.addArgument("init_registers", init_registers);
if (!compiler->BaseDeviceName().empty() &&
compiler->BaseDeviceName()[0] == 'e') {
Expand Down Expand Up @@ -1215,8 +1217,7 @@ void FOEDAG::TclArgs_setRsSynthesisOptions(const ArgumentsMap &argsStr) {
}
auto init_registers = argsStr.value("init_registers");
if (init_registers) {
const auto &[value, ok] =
StringUtils::to_number<int>(init_registers);
const auto &[value, ok] = StringUtils::to_number<int>(init_registers);
if (ok) compiler->SynthInitRegisters(value);
}
auto fast = argsStr.value("fast");
Expand Down
4 changes: 3 additions & 1 deletion src/Compiler/CompilerRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ class CompilerRS : public CompilerOpenFPGA {
bool SynthNoSat() { return m_synthNoSat; }
void SynthNoSat(bool no_sat) { m_synthNoSat = no_sat; }
int SynthInitRegisters() { return m_synthInitRegisters; }
void SynthInitRegisters(int initRegisters) { m_synthInitRegisters = initRegisters; }
void SynthInitRegisters(int initRegisters) {
m_synthInitRegisters = initRegisters;
}

void StarsExecPath(const std::filesystem::path& path) {
m_starsExecutablePath = path;
Expand Down
15 changes: 9 additions & 6 deletions src/ConfigurationRS/Ocla/OclaIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,19 @@ ocla_trigger_config OclaIP::get_channel_config(uint32_t channel) const {

switch (cfg.type) {
case EDGE:
cfg.event = (ocla_trigger_event)(
((reg.tcur & TCUR_ET_Msk) >> TCUR_ET_Pos) | 0x10);
cfg.event =
(ocla_trigger_event)(((reg.tcur & TCUR_ET_Msk) >> TCUR_ET_Pos) |
0x10);
break;
case LEVEL:
cfg.event = (ocla_trigger_event)(
((reg.tcur & TCUR_LT_Msk) >> TCUR_LT_Pos) | 0x20);
cfg.event =
(ocla_trigger_event)(((reg.tcur & TCUR_LT_Msk) >> TCUR_LT_Pos) |
0x20);
break;
case VALUE_COMPARE:
cfg.event = (ocla_trigger_event)(
((reg.tcur & TCUR_VC_Msk) >> TCUR_VC_Pos) | 0x30);
cfg.event =
(ocla_trigger_event)(((reg.tcur & TCUR_VC_Msk) >> TCUR_VC_Pos) |
0x30);
cfg.value = reg.tdcr;
cfg.compare_width = ((reg.tssr & TSSR_CW_Msk) >> TSSR_CW_Pos) + 1;
break;
Expand Down

0 comments on commit 3825f02

Please sign in to comment.