From 7bb7049eea9f9202ed99fbcd70384aa1c7dbb267 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 23 Sep 2019 21:28:54 +0200 Subject: [PATCH] sw: Fix logic to determine when to enable the output drivers Before, it was always enabling all outputs, even when they should have been tristated. --- sw/kousaten/src/fpga_cell_lut34.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sw/kousaten/src/fpga_cell_lut34.c b/sw/kousaten/src/fpga_cell_lut34.c index 5a3da15..744e0bb 100644 --- a/sw/kousaten/src/fpga_cell_lut34.c +++ b/sw/kousaten/src/fpga_cell_lut34.c @@ -235,15 +235,11 @@ char *fpga_cell_lut34_isp_generate_bitstream(struct fpga_cell *cell) "Couldn't set LUT output sel %d for output %d.", temp, i); } - for (i = 0; i < 2; ++i) { - temp = fpga_cell_bitstream_is_set(sbuf, LUT_OUT_BITMAP[i][0]); /* At some point, we set a specific output on this MUX */ + for (i = 0; i < 4; ++i) { + temp = fpga_cell_lut34_is_driven(lut34->drive_sel[i]); BS_SET_BIT(LUT_OUT_EN_N_BITMAP[i], !temp, "Couldn't %s output for output %d.", (!temp ? "enable" : "disabled"), i); - if (!temp) { - BS_SET_BITS(0, 2 , LUT_OUT_BITMAP[i], - "Couldn't set LUT output sel 0 for output %d (undriven by user logic).", i); - } } /* Routing */