aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorZipCPU <dgisselq@ieee.org>2018-06-07 09:38:14 -0400
committerZipCPU <dgisselq@ieee.org>2018-06-07 09:38:14 -0400
commitf32b9622d5c61610f6027f6544ab9683cd57282b (patch)
treedf3bb9add472148dcf4d4556eafae5431bb0f66c /frontend
parent0dbfa4662f74b89c5f3f8c4fa5ebbef6a89d532b (diff)
downloadnextpnr-f32b9622d5c61610f6027f6544ab9683cd57282b.tar.gz
nextpnr-f32b9622d5c61610f6027f6544ab9683cd57282b.tar.bz2
nextpnr-f32b9622d5c61610f6027f6544ab9683cd57282b.zip
Initial (random) placer capability
This commit also includes changes to jsonparse to allow it to 1) recognize ports with no connection, and set their net pointers to NULL 2) recognize designs with a ports node rather than a ports_direction The rule checker has also been modified to accommodate possible NULL netlists The ice40 chip now also has iterator operations ++bi and bi++.
Diffstat (limited to 'frontend')
-rw-r--r--frontend/json/jsonparse.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc
index 41ecebd4..3d7c52ea 100644
--- a/frontend/json/jsonparse.cc
+++ b/frontend/json/jsonparse.cc
@@ -413,7 +413,25 @@ void json_import_cell_ports(Design *design, string &modname, CellInfo *cell,
is_bus = (wire_group_node->data_array.size()>1);
// Now loop through all of the connections to this port.
- for(int index=0; index < wire_group_node->data_array.size(); index++) {
+ if (wire_group_node->data_array.size() == 0) {
+ //
+ // There is/are no connections to this port.
+ //
+ // Create the port, but leave the net NULL
+ PortInfo this_port;
+
+ //
+ this_port.name = port_info.name;
+ this_port.type = port_info.type;
+ this_port.net = NULL;
+
+ cell->ports[this_port.name] = this_port;
+
+ if (json_debug) log_info(" Port \'%s\' has no connection in \'%s\'\n",
+ this_port.name.c_str(), cell->name.c_str());
+
+ } else for(int index=0; index < wire_group_node->data_array.size();
+ index++) {
//
JsonNode *wire_node;
PortInfo this_port;