aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/json_frontend.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-02-01 16:26:58 +0000
committerGitHub <noreply@github.com>2020-02-01 16:26:58 +0000
commita0091eb44b3b1248409038b43143b049b43d0233 (patch)
tree8f7fee3c63dd8054deb2ee68d1968b581a43099f /frontend/json_frontend.cc
parent85f4452b0a3bd47ccb25be023859542ffef888f7 (diff)
parent24e3f8417e861321d1f934d52fd33535e08d9817 (diff)
downloadnextpnr-a0091eb44b3b1248409038b43143b049b43d0233.tar.gz
nextpnr-a0091eb44b3b1248409038b43143b049b43d0233.tar.bz2
nextpnr-a0091eb44b3b1248409038b43143b049b43d0233.zip
Merge pull request #388 from YosysHQ/mwk/json-fixes
json: fix handling of 32-bit parameters
Diffstat (limited to 'frontend/json_frontend.cc')
-rw-r--r--frontend/json_frontend.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/frontend/json_frontend.cc b/frontend/json_frontend.cc
index f1310e71..136786fc 100644
--- a/frontend/json_frontend.cc
+++ b/frontend/json_frontend.cc
@@ -105,10 +105,14 @@ struct JsonFrontendImpl
Property parse_property(const Json &val) const
{
- if (val.is_number())
+ if (val.is_number()) {
+ if (val.int_value() != val.number_value())
+ log_error("Found an out-of-range integer parameter in the JSON file.\n"
+ "Please regenerate the input file with an up-to-date version of yosys.\n");
return Property(val.int_value(), 32);
- else
+ } else {
return Property::from_string(val.string_value());
+ }
}
template <typename TFunc> void foreach_attr(const Json &obj, TFunc Func) const