frontends/json/jsonparse.cc: Like the upto field read_json can also read the signedne...
authorVamsi K Vytla <vamsi.vytla@gmail.com>
Mon, 27 Apr 2020 17:36:18 +0000 (10:36 -0700)
committerVamsi K Vytla <vamsi.vytla@gmail.com>
Mon, 27 Apr 2020 17:36:18 +0000 (10:36 -0700)
frontends/json/jsonparse.cc

index 7aceffbfce4fff59d04ca44bd58dea115789d340..8ae7c657861c28790fa6b4b6a5a401932405f107 100644 (file)
@@ -309,6 +309,12 @@ void json_import(Design *design, string &modname, JsonNode *node)
                                        port_wire->upto = val->data_number != 0;
                        }
 
+                       if (port_node->data_dict.count("signed") != 0) {
+                               JsonNode *val = port_node->data_dict.at("signed");
+                               if (val->type == 'N')
+                                       port_wire->is_signed = val->data_number != 0;
+                       }
+
                        if (port_node->data_dict.count("offset") != 0) {
                                JsonNode *val = port_node->data_dict.at("offset");
                                if (val->type == 'N')
@@ -573,4 +579,3 @@ struct JsonFrontend : public Frontend {
 } JsonFrontend;
 
 YOSYS_NAMESPACE_END
-