From 24e3f8417e861321d1f934d52fd33535e08d9817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= Date: Sat, 1 Feb 2020 17:23:05 +0100 Subject: json: fix handling of 32-bit parameters See YosysHQ/yosys#1671 for rationale. Also, added some validation to our parser, so that out-of-range values are reported and the user knows they should update yosys. --- json/jsonwrite.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'json') diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc index 477bfca5..d4a62a5a 100644 --- a/json/jsonwrite.cc +++ b/json/jsonwrite.cc @@ -45,15 +45,6 @@ std::string get_string(std::string str) std::string get_name(IdString name, Context *ctx) { return get_string(name.c_str(ctx)); } -void write_parameter_value(std::ostream &f, const Property &value) -{ - if (value.size() == 32 && value.is_fully_def()) { - f << stringf("%d", value.as_int64()); - } else { - f << get_string(value.to_string()); - } -} - void write_parameters(std::ostream &f, Context *ctx, const std::unordered_map ¶meters, bool for_module = false) { @@ -61,7 +52,7 @@ void write_parameters(std::ostream &f, Context *ctx, const std::unordered_map