aboutsummaryrefslogtreecommitdiffstats
path: root/mistral/io.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-01-19 13:22:40 +0000
committerGitHub <noreply@github.com>2022-01-19 13:22:40 +0000
commitfbeef2b8c2734210a70e51a3ac629c2065c06d19 (patch)
tree9f0aa005ecfbb5a22a14c377a3d663465639a5a7 /mistral/io.cc
parent58a1b473b85ae8bc4312eed14af1829b93958341 (diff)
parent27d38de612ce4109723704f863ac82a6cbddf10c (diff)
downloadnextpnr-fbeef2b8c2734210a70e51a3ac629c2065c06d19.tar.gz
nextpnr-fbeef2b8c2734210a70e51a3ac629c2065c06d19.tar.bz2
nextpnr-fbeef2b8c2734210a70e51a3ac629c2065c06d19.zip
Merge pull request #895 from galibert/master
Sync with the current state of mistral
Diffstat (limited to 'mistral/io.cc')
-rw-r--r--mistral/io.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/mistral/io.cc b/mistral/io.cc
index dab3672e..a0a01af3 100644
--- a/mistral/io.cc
+++ b/mistral/io.cc
@@ -30,10 +30,12 @@ void Arch::create_gpio(int x, int y)
WireId pad = add_wire(x, y, id(stringf("PAD[%d]", z)));
BelId bel = add_bel(x, y, id(stringf("IO[%d]", z)), id_MISTRAL_IO);
add_bel_pin(bel, id_PAD, PORT_INOUT, pad);
- // FIXME: is the port index of zero always correct?
- add_bel_pin(bel, id_I, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAOUT, 0));
- add_bel_pin(bel, id_OE, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::OEIN, 0));
- add_bel_pin(bel, id_O, PORT_OUT, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAIN, 0));
+ if(has_port(CycloneV::GPIO, x, y, z, CycloneV::DATAOUT, 0)) {
+ // FIXME: is the port index of zero always correct?
+ add_bel_pin(bel, id_I, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAOUT, 0));
+ add_bel_pin(bel, id_OE, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::OEIN, 0));
+ add_bel_pin(bel, id_O, PORT_OUT, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAIN, 0));
+ }
bel_data(bel).block_index = z;
}
}