aboutsummaryrefslogtreecommitdiffstats
path: root/mistral
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-02-16 17:09:54 +0000
committergatecat <gatecat@ds0.me>2022-02-16 17:09:54 +0000
commit76683a1e3c123d28deff750c38467c6377936879 (patch)
tree379b38c06745919df0e87c1be1410e16793b0925 /mistral
parent9ef0bc3d3ad667d937ed803eba7b216a604d5624 (diff)
downloadnextpnr-76683a1e3c123d28deff750c38467c6377936879.tar.gz
nextpnr-76683a1e3c123d28deff750c38467c6377936879.tar.bz2
nextpnr-76683a1e3c123d28deff750c38467c6377936879.zip
refactor: Use constids instead of id("..")
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'mistral')
-rw-r--r--mistral/arch.cc8
-rw-r--r--mistral/constids.inc8
-rw-r--r--mistral/globals.cc6
-rw-r--r--mistral/main.cc2
4 files changed, 16 insertions, 8 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc
index c50e30f4..e79a3910 100644
--- a/mistral/arch.cc
+++ b/mistral/arch.cc
@@ -446,7 +446,7 @@ ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const
bool Arch::place()
{
- std::string placer = str_or_default(settings, id("placer"), defaultPlacer);
+ std::string placer = str_or_default(settings, id_placer, defaultPlacer);
if (placer == "heap") {
PlacerHeapCfg cfg(getCtx());
@@ -468,7 +468,7 @@ bool Arch::place()
log_error("Mistral architecture does not support placer '%s'\n", placer.c_str());
}
- getCtx()->attrs[getCtx()->id("step")] = std::string("place");
+ getCtx()->attrs[id_step] = std::string("place");
archInfoToAttributes();
return true;
}
@@ -479,7 +479,7 @@ bool Arch::route()
lab_pre_route();
- std::string router = str_or_default(settings, id("router"), defaultRouter);
+ std::string router = str_or_default(settings, id_router, defaultRouter);
bool result;
if (router == "router1") {
result = router1(getCtx(), Router1Cfg(getCtx()));
@@ -489,7 +489,7 @@ bool Arch::route()
} else {
log_error("Mistral architecture does not support router '%s'\n", router.c_str());
}
- getCtx()->attrs[getCtx()->id("step")] = std::string("route");
+ getCtx()->attrs[id_step] = std::string("route");
archInfoToAttributes();
return result;
}
diff --git a/mistral/constids.inc b/mistral/constids.inc
index 2aa2c157..d241c8ef 100644
--- a/mistral/constids.inc
+++ b/mistral/constids.inc
@@ -97,3 +97,11 @@ X(WE_INV)
X(cyclonev_oscillator)
X(cyclonev_hps_interface_mpu_general_purpose)
+
+X(clkout)
+X(clkout1)
+X(compress_rbf)
+X(oscena)
+X(placer)
+X(router)
+X(step)
diff --git a/mistral/globals.cc b/mistral/globals.cc
index d41b2afe..1ba70919 100644
--- a/mistral/globals.cc
+++ b/mistral/globals.cc
@@ -58,9 +58,9 @@ void Arch::create_hps_mpu_general_purpose(int x, int y)
void Arch::create_control(int x, int y)
{
BelId oscillator_bel = add_bel(x, y, id_cyclonev_oscillator, id_cyclonev_oscillator);
- add_bel_pin(oscillator_bel, id("oscena"), PORT_IN, get_port(CycloneV::CTRL, x, y, -1, CycloneV::OSC_ENA, -1));
- add_bel_pin(oscillator_bel, id("clkout"), PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT, -1));
- add_bel_pin(oscillator_bel, id("clkout1"), PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT1, -1));
+ add_bel_pin(oscillator_bel, id_oscena, PORT_IN, get_port(CycloneV::CTRL, x, y, -1, CycloneV::OSC_ENA, -1));
+ add_bel_pin(oscillator_bel, id_clkout, PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT, -1));
+ add_bel_pin(oscillator_bel, id_clkout1, PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT1, -1));
}
NEXTPNR_NAMESPACE_END
diff --git a/mistral/main.cc b/mistral/main.cc
index bd9ef591..34bf759e 100644
--- a/mistral/main.cc
+++ b/mistral/main.cc
@@ -79,7 +79,7 @@ std::unique_ptr<Context> MistralCommandHandler::createContext(dict<std::string,
chipArgs.device = vm["device"].as<std::string>();
auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
if (vm.count("compress-rbf"))
- ctx->settings[ctx->id("compress_rbf")] = Property::State::S1;
+ ctx->settings[id_compress_rbf] = Property::State::S1;
return ctx;
}