aboutsummaryrefslogtreecommitdiffstats
path: root/json
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 /json
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 'json')
-rw-r--r--json/jsonwrite.cc11
1 files changed, 1 insertions, 10 deletions
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<IdString, Property> &parameters,
bool for_module = false)
{
@@ -61,7 +52,7 @@ void write_parameters(std::ostream &f, Context *ctx, const std::unordered_map<Id
for (auto &param : parameters) {
f << stringf("%s\n", first ? "" : ",");
f << stringf(" %s%s: ", for_module ? "" : " ", get_name(param.first, ctx).c_str());
- write_parameter_value(f, param.second);
+ f << get_string(param.second.to_string());
first = false;
}
}