Propagate errors
This commit is contained in:
parent
8436191307
commit
503fafd574
@ -75,6 +75,8 @@ struct GateMateCCFReader
|
|||||||
if (name == "LOC") {
|
if (name == "LOC") {
|
||||||
if (is_default)
|
if (is_default)
|
||||||
log_error("Value '%s' can not be defined for default GPIO in line %d.\n", name.c_str(), lineno);
|
log_error("Value '%s' can not be defined for default GPIO in line %d.\n", name.c_str(), lineno);
|
||||||
|
if (ctx->get_package_pin_bel(ctx->id(value)) == BelId())
|
||||||
|
log_error("Unknown location '%s' used in line %d.\n", value.c_str(), lineno);
|
||||||
props->emplace(ctx->id(name.c_str()), Property(value));
|
props->emplace(ctx->id(name.c_str()), Property(value));
|
||||||
} else if (name == "SCHMITT_TRIGGER" || name == "PULLUP" || name == "PULLDOWN" || name == "KEEPER" ||
|
} else if (name == "SCHMITT_TRIGGER" || name == "PULLUP" || name == "PULLDOWN" || name == "KEEPER" ||
|
||||||
name == "FF_IBF" || name == "FF_OBF" || name == "LVDS_BOOST" || name == "LVDS_RTERM") {
|
name == "FF_IBF" || name == "FF_OBF" || name == "LVDS_BOOST" || name == "LVDS_RTERM") {
|
||||||
@ -119,9 +121,8 @@ struct GateMateCCFReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool run()
|
void run()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
log_info("Parsing CCF file..\n");
|
log_info("Parsing CCF file..\n");
|
||||||
|
|
||||||
std::string line;
|
std::string line;
|
||||||
@ -164,8 +165,7 @@ struct GateMateCCFReader
|
|||||||
boost::algorithm::to_lower(type);
|
boost::algorithm::to_lower(type);
|
||||||
if (type == "default_gpio") {
|
if (type == "default_gpio") {
|
||||||
if (words.size() != 1)
|
if (words.size() != 1)
|
||||||
log_error("line with default_GPIO should not contain only parameters (in line %d).\n",
|
log_error("line with default_GPIO should not contain only parameters (in line %d).\n", lineno);
|
||||||
lineno);
|
|
||||||
params.erase(params.begin());
|
params.erase(params.begin());
|
||||||
parse_params(params, true, &defaults);
|
parse_params(params, true, &defaults);
|
||||||
|
|
||||||
@ -198,20 +198,16 @@ struct GateMateCCFReader
|
|||||||
}
|
}
|
||||||
if (!isempty(linebuf))
|
if (!isempty(linebuf))
|
||||||
log_error("unexpected end of CCF file\n");
|
log_error("unexpected end of CCF file\n");
|
||||||
return true;
|
|
||||||
} catch (log_execution_error_exception) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool GateMateImpl::parse_ccf(const std::string &filename)
|
void GateMateImpl::parse_ccf(const std::string &filename)
|
||||||
{
|
{
|
||||||
std::ifstream in(filename);
|
std::ifstream in(filename);
|
||||||
if (!in)
|
if (!in)
|
||||||
log_error("failed to open CCF file '%s'\n", filename.c_str());
|
log_error("failed to open CCF file '%s'\n", filename.c_str());
|
||||||
GateMateCCFReader reader(ctx, in);
|
GateMateCCFReader reader(ctx, in);
|
||||||
return reader.run();
|
reader.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -45,7 +45,7 @@ struct GateMateImpl : HimbaechelAPI
|
|||||||
|
|
||||||
void drawBel(std::vector<GraphicElement> &g, GraphicElement::style_t style, IdString bel_type, Loc loc) override;
|
void drawBel(std::vector<GraphicElement> &g, GraphicElement::style_t style, IdString bel_type, Loc loc) override;
|
||||||
|
|
||||||
bool parse_ccf(const std::string &filename);
|
void parse_ccf(const std::string &filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HimbaechelHelpers h;
|
HimbaechelHelpers h;
|
||||||
|
Loading…
Reference in New Issue
Block a user