aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2020-04-16 15:57:03 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-04-21 19:09:00 +0200
commit02f1c7b9afd1d35964245ea045db8642d8da3d14 (patch)
tree6b180b534c91d704684e5c162ec561682c9d7ca3
parentb4d76309e1e2a264fdac46341548e8d74c552f07 (diff)
downloadyosys-02f1c7b9afd1d35964245ea045db8642d8da3d14.tar.gz
yosys-02f1c7b9afd1d35964245ea045db8642d8da3d14.tar.bz2
yosys-02f1c7b9afd1d35964245ea045db8642d8da3d14.zip
write_json: dump default parameter values
Fixes #1823. This will allow nextpnr to reuse the default value information already present in yosys cells_sim.v and avoid duplicating (and probably desyncing) this information.
-rw-r--r--backends/json/json.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/json/json.cc b/backends/json/json.cc
index 1da23bb7d..1a8b757ef 100644
--- a/backends/json/json.cc
+++ b/backends/json/json.cc
@@ -141,6 +141,12 @@ struct JsonWriter
write_parameters(module->attributes, /*for_module=*/true);
f << stringf("\n },\n");
+ if (module->parameter_default_values.size()) {
+ f << stringf(" \"parameter_default_values\": {");
+ write_parameters(module->parameter_default_values, /*for_module=*/true);
+ f << stringf("\n },\n");
+ }
+
f << stringf(" \"ports\": {");
bool first = true;
for (auto n : module->ports) {
@@ -310,6 +316,10 @@ struct JsonBackend : public Backend {
log(" <attribute_name>: <attribute_value>,\n");
log(" ...\n");
log(" },\n");
+ log(" \"parameter_default_values\": {\n");
+ log(" <parameter_name>: <parameter_value>,\n");
+ log(" ...\n");
+ log(" },\n");
log(" \"ports\": {\n");
log(" <port_name>: <port_details>,\n");
log(" ...\n");