aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-06-25 18:19:25 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-06-25 18:19:25 +0200
commitbe47fc3e9a81a4890b05223ae18803cb07674dc9 (patch)
treeb0690ae9c7fd1c06db96ab036c3e177d50f6961d /ice40
parentec47ce2320fdc9d698e71c07af0844f7ecc2445c (diff)
downloadnextpnr-be47fc3e9a81a4890b05223ae18803cb07674dc9.tar.gz
nextpnr-be47fc3e9a81a4890b05223ae18803cb07674dc9.tar.bz2
nextpnr-be47fc3e9a81a4890b05223ae18803cb07674dc9.zip
clangformat run
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc5
-rw-r--r--ice40/main.cc16
-rw-r--r--ice40/pack.cc32
3 files changed, 26 insertions, 27 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index d58951dd..0b1d280c 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -694,8 +694,9 @@ bool Arch::place()
return retVal;
}
-bool Arch::route() {
- bool retVal = router1(getCtx(), Router1Cfg(getCtx()));
+bool Arch::route()
+{
+ bool retVal = router1(getCtx(), Router1Cfg(getCtx()));
getCtx()->settings[getCtx()->id("route")] = "1";
archInfoToAttributes();
return retVal;
diff --git a/ice40/main.cc b/ice40/main.cc
index de618cbf..83cb04b0 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -36,7 +36,7 @@ class Ice40CommandHandler : public CommandHandler
public:
Ice40CommandHandler(int argc, char **argv);
virtual ~Ice40CommandHandler(){};
- std::unique_ptr<Context> createContext(std::unordered_map<std::string,Property> &values) override;
+ std::unique_ptr<Context> createContext(std::unordered_map<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override;
void validate() override;
void customAfterLoad(Context *ctx) override;
@@ -116,7 +116,7 @@ void Ice40CommandHandler::setupArchContext(Context *ctx)
}
}
-std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<std::string,Property> &values)
+std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<std::string, Property> &values)
{
ArchArgs chipArgs;
chipArgs.type = ArchArgs::NONE;
@@ -158,12 +158,12 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s
if (vm.count("package"))
chipArgs.package = vm["package"].as<std::string>();
- if (values.find("arch.name")!=values.end()) {
+ if (values.find("arch.name") != values.end()) {
std::string arch_name = values["arch.name"].str;
if (arch_name != "ice40")
log_error("Unsuported architecture '%s'.\n", arch_name.c_str());
}
- if (values.find("arch.type")!=values.end()) {
+ if (values.find("arch.type") != values.end()) {
std::string arch_type = values["arch.type"].str;
if (chipArgs.type != ArchArgs::NONE)
log_error("Overriding architecture is unsuported.\n");
@@ -190,14 +190,14 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s
chipArgs.type = ArchArgs::U4K;
}
if (chipArgs.type == ArchArgs::NONE)
- log_error("Unsuported FPGA type '%s'.\n",arch_type.c_str());
+ log_error("Unsuported FPGA type '%s'.\n", arch_type.c_str());
}
- if (values.find("arch.package")!=values.end()) {
+ if (values.find("arch.package") != values.end()) {
if (vm.count("package"))
log_error("Overriding architecture is unsuported.\n");
chipArgs.package = values["arch.package"].str;
}
-
+
if (chipArgs.type == ArchArgs::NONE) {
chipArgs.type = ArchArgs::HX1K;
chipArgs.package = "tq144";
@@ -209,7 +209,7 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s
#endif
auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
- for(auto &val : values)
+ for (auto &val : values)
ctx->settings[ctx->id(val.first)] = val.second;
ctx->settings[ctx->id("arch.package")] = ctx->archArgs().package;
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 66c5c0e8..d1366c9c 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -340,10 +340,9 @@ static void pack_constants(Context *ctx)
gnd_net->driver.cell = gnd_cell.get();
gnd_net->driver.port = ctx->id("O");
gnd_cell->ports.at(ctx->id("O")).net = gnd_net.get();
-
- NetInfo* gnd_net_info = gnd_net.get();
- if (ctx->nets.find(ctx->id("$PACKER_GND_NET"))!=ctx->nets.end())
- {
+
+ NetInfo *gnd_net_info = gnd_net.get();
+ if (ctx->nets.find(ctx->id("$PACKER_GND_NET")) != ctx->nets.end()) {
gnd_net_info = ctx->nets.find(ctx->id("$PACKER_GND_NET"))->second.get();
}
@@ -354,10 +353,9 @@ static void pack_constants(Context *ctx)
vcc_net->driver.cell = vcc_cell.get();
vcc_net->driver.port = ctx->id("O");
vcc_cell->ports.at(ctx->id("O")).net = vcc_net.get();
-
- NetInfo* vcc_net_info = vcc_net.get();
- if (ctx->nets.find(ctx->id("$PACKER_VCC_NET"))!=ctx->nets.end())
- {
+
+ NetInfo *vcc_net_info = vcc_net.get();
+ if (ctx->nets.find(ctx->id("$PACKER_VCC_NET")) != ctx->nets.end()) {
vcc_net_info = ctx->nets.find(ctx->id("$PACKER_VCC_NET"))->second.get();
}
@@ -387,8 +385,7 @@ static void pack_constants(Context *ctx)
}
// Vcc cell always inserted for now, as it may be needed during carry legalisation (TODO: trim later if actually
// never used?)
- if (vcc_net_info == vcc_net.get())
- {
+ if (vcc_net_info == vcc_net.get()) {
ctx->cells[vcc_cell->name] = std::move(vcc_cell);
ctx->nets[vcc_net->name] = std::move(vcc_net);
}
@@ -1239,13 +1236,14 @@ static void pack_special(Context *ctx)
}
auto feedback_path = packed->params[ctx->id("FEEDBACK_PATH")];
- std::string fbp_value = feedback_path == "DELAY"
- ? "0"
- : feedback_path == "SIMPLE"
- ? "1"
- : feedback_path == "PHASE_AND_DELAY"
- ? "2"
- : feedback_path == "EXTERNAL" ? "6" : std::string(feedback_path);
+ std::string fbp_value =
+ feedback_path == "DELAY"
+ ? "0"
+ : feedback_path == "SIMPLE"
+ ? "1"
+ : feedback_path == "PHASE_AND_DELAY"
+ ? "2"
+ : feedback_path == "EXTERNAL" ? "6" : std::string(feedback_path);
if (!std::all_of(fbp_value.begin(), fbp_value.end(), isdigit))
log_error("PLL '%s' has unsupported FEEDBACK_PATH value '%s'\n", ci->name.c_str(ctx),
feedback_path.c_str());