diff options
author | David Shah <davey1576@gmail.com> | 2018-06-10 13:38:34 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-10 13:38:34 +0200 |
commit | 8d5da98122e23f2559e971bd42e8ad0d27113c66 (patch) | |
tree | a44340a3c3e0b0575d230b768bdfc54a6adfca9a /ice40 | |
parent | 4e6d6e632ff1a8604bbab5a1c43cb53211742bc9 (diff) | |
download | nextpnr-8d5da98122e23f2559e971bd42e8ad0d27113c66.tar.gz nextpnr-8d5da98122e23f2559e971bd42e8ad0d27113c66.tar.bz2 nextpnr-8d5da98122e23f2559e971bd42e8ad0d27113c66.zip |
ice40: Set config bits for unused IO
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/bitstream.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index 524a8fee..818ba180 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -188,9 +188,27 @@ void write_asc(const Design &design, std::ostream &out) assert(false); } } + // Set config bits in unused IO + for (auto bel : chip.getBels()) { + if (chip.bel_to_cell[bel.index] == IdString() && chip.getBelType(bel) == TYPE_SB_IO) { + TileInfoPOD &ti = bi.tiles_nonrouting[TILE_IO]; + const BelInfoPOD &beli = ci.bel_data[bel.index]; + int x = beli.x, y = beli.y, z = beli.z; + auto ieren = get_ieren(bi, x, y, z); + int iex, iey, iez; + std::tie(iex, iey, iez) = ieren; + if (iez != -1) { + set_config(ti, config.at(iey).at(iex), + "IoCtrl.IE_" + std::to_string(iez), true); + set_config(ti, config.at(iey).at(iex), + "IoCtrl.REN_" + std::to_string(iez), false); + } + } + } + // Set other config bits - currently just disable RAM to stop icebox_vlog // crashing - // TODO: ColBufCtrl , unused IO + // TODO: ColBufCtrl for (int y = 0; y < ci.height; y++) { for (int x = 0; x < ci.width; x++) { TileType tile = tile_at(chip, x, y); |