Merge pull request #294 from YosysHQ/eddie/whiteboxes
Changes to cope with YosysHQ/yosys#943
This commit is contained in:
commit
76ff791913
@ -285,7 +285,7 @@ void vcc_net(Context *ctx, NetInfo *net)
|
|||||||
// true, false otherwise
|
// true, false otherwise
|
||||||
bool is_blackbox(JsonNode *node)
|
bool is_blackbox(JsonNode *node)
|
||||||
{
|
{
|
||||||
JsonNode *attr_node, *bbox_node;
|
JsonNode *attr_node, *bbox_node = nullptr, *wbox_node = nullptr;
|
||||||
|
|
||||||
if (node->data_dict.count("attributes") == 0)
|
if (node->data_dict.count("attributes") == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -296,14 +296,19 @@ bool is_blackbox(JsonNode *node)
|
|||||||
return false;
|
return false;
|
||||||
if (GetSize(attr_node->data_dict) == 0)
|
if (GetSize(attr_node->data_dict) == 0)
|
||||||
return false;
|
return false;
|
||||||
if (attr_node->data_dict.count("blackbox") == 0)
|
if (attr_node->data_dict.count("blackbox"))
|
||||||
return false;
|
|
||||||
bbox_node = attr_node->data_dict.at("blackbox");
|
bbox_node = attr_node->data_dict.at("blackbox");
|
||||||
if (bbox_node == NULL)
|
if (attr_node->data_dict.count("whitebox"))
|
||||||
|
wbox_node = attr_node->data_dict.at("whitebox");
|
||||||
|
if (bbox_node == NULL && wbox_node == NULL)
|
||||||
return false;
|
return false;
|
||||||
if (bbox_node->type != 'N')
|
if (bbox_node && bbox_node->type != 'N')
|
||||||
log_error("JSON module blackbox is not a number\n");
|
log_error("JSON module blackbox attribute value is not a number\n");
|
||||||
if (bbox_node->data_number == 0)
|
if (bbox_node && bbox_node->data_number == 0)
|
||||||
|
return false;
|
||||||
|
if (wbox_node && wbox_node->type != 'N')
|
||||||
|
log_error("JSON module whitebox attribute value is not a number\n");
|
||||||
|
if (wbox_node && wbox_node->data_number == 0)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user