@@ -1577,15 +1577,21 @@ struct FasmBackend
1577
1577
}
1578
1578
};
1579
1579
1580
- // value 1 is equivalent to 2 here, see UG479
1581
- // also, prjxray only has bits for values 0 and 2
1582
- auto areg = int_or_default (ci->params , ctx->id (" AREG" ), 0 );
1583
- write_bit (" AREG_" + std::to_string (areg == 1 ? 2 : areg));
1580
+ // value 1 is equivalent to 2, according to UG479
1581
+ // but in real life, Vivado sets AREG_0 is 0,
1582
+ // no bit is 1, and AREG_2 is 2
1583
+ auto areg = int_or_default (ci->params , ctx->id (" AREG" ), 1 );
1584
+ if (areg == 0 or areg == 2 ) write_bit (" AREG_" + std::to_string (areg));
1585
+
1584
1586
auto ainput = str_or_default (ci->params , ctx->id (" A_INPUT" ), " DIRECT" );
1585
1587
if (ainput == " CASCADE" ) write_bit (" A_INPUT[0]" );
1586
1588
1587
- auto breg = int_or_default (ci->params , ctx->id (" BREG" ), 0 );
1588
- write_bit (" BREG_" + std::to_string (breg == 1 ? 2 : breg));
1589
+ // value 1 is equivalent to 2, according to UG479
1590
+ // but in real life, Vivado sets AREG_0 is 0,
1591
+ // no bit is 1, and AREG_2 is 2
1592
+ auto breg = int_or_default (ci->params , ctx->id (" BREG" ), 1 );
1593
+ if (breg == 0 or breg == 2 ) write_bit (" BREG_" + std::to_string (breg));
1594
+
1589
1595
auto binput = str_or_default (ci->params , ctx->id (" B_INPUT" ), " DIRECT" );
1590
1596
if (binput == " CASCADE" ) write_bit (" B_INPUT[0]" );
1591
1597
0 commit comments