sw: Create function to determine whether an output is driven

sw
Markus Koch 2019-09-23 21:27:45 +02:00
parent 953818f43c
commit 98a7a5d170
1 changed files with 7 additions and 4 deletions

View File

@ -61,6 +61,11 @@ static int ROUTE_BITMAP[8] = {
static int BIT_LED_LUT_IN = 28;
static int BIT_LED_LUT_OUT_N = 29; /* Low-active */
static inline int fpga_cell_lut34_is_driven(char drive_sel)
{
return (drive_sel != LUT_OUT_DC && drive_sel != LUT_OUT_Z);
}
static int fpga_cell_lut34_lut_get_mux(int lut, char port) {
int i;
@ -88,11 +93,9 @@ static int fpga_cell_lut34_lut_get_out_mux(int lut_group, char *ports) {
ports = ports + lut;
for (i = 0; i < 4; ++i) {
if (ports[0] == LUT_OUT_DC ||
ports[0] == LUT_OUT_Z ||
if (!fpga_cell_lut34_is_driven(ports[0]) ||
ports[0] == LUT_OUT_MUX[lut][i]) {
if (ports[1] == LUT_OUT_DC ||
ports[1] == LUT_OUT_Z ||
if (!fpga_cell_lut34_is_driven(ports[1]) ||
ports[1] == LUT_OUT_MUX[lut + 1][i])
return i;
}