Compare commits
5 Commits
f27c728472
...
6fbdcf9016
Author | SHA1 | Date | |
---|---|---|---|
6fbdcf9016 | |||
7bb7049eea | |||
98a7a5d170 | |||
953818f43c | |||
72dabd64db |
@ -10,12 +10,12 @@ static int need_fix = 1;
|
|||||||
|
|
||||||
/* LUT Definitions (correct offset, no fix must be applied) */
|
/* LUT Definitions (correct offset, no fix must be applied) */
|
||||||
static int LUT4_BITMAP[16] = {
|
static int LUT4_BITMAP[16] = {
|
||||||
16, 17, 18, 19, 20, 21, 22, 23,
|
24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
24, 25, 26, 27, 28, 29, 30, 31
|
16, 17, 18, 19, 20, 21, 22, 23
|
||||||
};
|
};
|
||||||
static int LUT3_BITMAP[2][8] = {
|
static int LUT3_BITMAP[2][8] = {
|
||||||
{16, 17, 18, 19, 20, 21, 22, 23},
|
{24, 25, 26, 27, 28, 29, 30, 31},
|
||||||
{24, 25, 26, 27, 28, 29, 30, 31}
|
{16, 17, 18, 19, 20, 21, 22, 23}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* LUT Config Definitions */
|
/* LUT Config Definitions */
|
||||||
@ -61,7 +61,13 @@ static int ROUTE_BITMAP[8] = {
|
|||||||
static int BIT_LED_LUT_IN = 28;
|
static int BIT_LED_LUT_IN = 28;
|
||||||
static int BIT_LED_LUT_OUT_N = 29; /* Low-active */
|
static int BIT_LED_LUT_OUT_N = 29; /* Low-active */
|
||||||
|
|
||||||
static int fpga_cell_lut34_lut_get_mux(int lut, char port) {
|
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;
|
int i;
|
||||||
|
|
||||||
if (port == LUT_NET_DC)
|
if (port == LUT_NET_DC)
|
||||||
@ -74,7 +80,8 @@ static int fpga_cell_lut34_lut_get_mux(int lut, char port) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fpga_cell_lut34_lut_get_out_mux(int lut_group, char *ports) {
|
static int fpga_cell_lut34_lut_get_out_mux(int lut_group, char *ports)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
int lut;
|
int lut;
|
||||||
|
|
||||||
@ -88,11 +95,9 @@ static int fpga_cell_lut34_lut_get_out_mux(int lut_group, char *ports) {
|
|||||||
ports = ports + lut;
|
ports = ports + lut;
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i) {
|
for (i = 0; i < 4; ++i) {
|
||||||
if (ports[0] == LUT_OUT_DC ||
|
if (!fpga_cell_lut34_is_driven(ports[0]) ||
|
||||||
ports[0] == LUT_OUT_Z ||
|
|
||||||
ports[0] == LUT_OUT_MUX[lut][i]) {
|
ports[0] == LUT_OUT_MUX[lut][i]) {
|
||||||
if (ports[1] == LUT_OUT_DC ||
|
if (!fpga_cell_lut34_is_driven(ports[1]) ||
|
||||||
ports[1] == LUT_OUT_Z ||
|
|
||||||
ports[1] == LUT_OUT_MUX[lut + 1][i])
|
ports[1] == LUT_OUT_MUX[lut + 1][i])
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -232,15 +237,11 @@ char *fpga_cell_lut34_isp_generate_bitstream(struct fpga_cell *cell)
|
|||||||
"Couldn't set LUT output sel %d for output %d.", temp, i);
|
"Couldn't set LUT output sel %d for output %d.", temp, i);
|
||||||
|
|
||||||
}
|
}
|
||||||
for (i = 0; i < 2; ++i) {
|
for (i = 0; i < 4; ++i) {
|
||||||
temp = fpga_cell_bitstream_is_set(sbuf, LUT_OUT_BITMAP[i][0]); /* At some point, we set a specific output on this MUX */
|
temp = fpga_cell_lut34_is_driven(lut34->drive_sel[i]);
|
||||||
BS_SET_BIT(LUT_OUT_EN_N_BITMAP[i], !temp,
|
BS_SET_BIT(LUT_OUT_EN_N_BITMAP[i], !temp,
|
||||||
"Couldn't %s output for output %d.",
|
"Couldn't %s output for output %d.",
|
||||||
(!temp ? "enable" : "disabled"), i);
|
(!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 */
|
/* Routing */
|
||||||
@ -280,8 +281,10 @@ char *fpga_cell_lut34_isp_generate_bitstream(struct fpga_cell *cell)
|
|||||||
report(LL_DEBUG, "Bitstream result for %p:", cell);
|
report(LL_DEBUG, "Bitstream result for %p:", cell);
|
||||||
for (i = 0; i < 48; ++i) {
|
for (i = 0; i < 48; ++i) {
|
||||||
report(LL_DEBUG,
|
report(LL_DEBUG,
|
||||||
" %d: %d",
|
" %d: %d%s",
|
||||||
i, fpga_cell_bitstream_is_set(buf, i));
|
i,
|
||||||
|
fpga_cell_bitstream_is_set(buf, i),
|
||||||
|
(fpga_cell_bitstream_is_set(sbuf, i) ? "" : " (Z)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
free(sbuf);
|
free(sbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user