mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-15 19:54:46 +00:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
e4066b784d
23 changed files with 425 additions and 60 deletions
|
@ -542,6 +542,12 @@ void RTLIL::Const::bitvectorize() const {
|
|||
}
|
||||
}
|
||||
|
||||
void RTLIL::Const::append(const RTLIL::Const &other) {
|
||||
bitvectorize();
|
||||
bitvectype& bv = get_bits();
|
||||
bv.insert(bv.end(), other.begin(), other.end());
|
||||
}
|
||||
|
||||
RTLIL::State RTLIL::Const::const_iterator::operator*() const {
|
||||
if (auto bv = parent.get_if_bits())
|
||||
return (*bv)[idx];
|
||||
|
@ -1471,6 +1477,40 @@ namespace {
|
|||
return;
|
||||
}
|
||||
|
||||
if (cell->type == ID($macc_v2)) {
|
||||
if (param(ID::NPRODUCTS) < 0)
|
||||
error(__LINE__);
|
||||
if (param(ID::NADDENDS) < 0)
|
||||
error(__LINE__);
|
||||
param_bits(ID::PRODUCT_NEGATED, max(param(ID::NPRODUCTS), 1));
|
||||
param_bits(ID::ADDEND_NEGATED, max(param(ID::NADDENDS), 1));
|
||||
param_bits(ID::A_SIGNED, max(param(ID::NPRODUCTS), 1));
|
||||
param_bits(ID::B_SIGNED, max(param(ID::NPRODUCTS), 1));
|
||||
param_bits(ID::C_SIGNED, max(param(ID::NADDENDS), 1));
|
||||
if (cell->getParam(ID::A_SIGNED) != cell->getParam(ID::B_SIGNED))
|
||||
error(__LINE__);
|
||||
param_bits(ID::A_WIDTHS, max(param(ID::NPRODUCTS) * 16, 1));
|
||||
param_bits(ID::B_WIDTHS, max(param(ID::NPRODUCTS) * 16, 1));
|
||||
param_bits(ID::C_WIDTHS, max(param(ID::NADDENDS) * 16, 1));
|
||||
const Const &a_width = cell->getParam(ID::A_WIDTHS);
|
||||
const Const &b_width = cell->getParam(ID::B_WIDTHS);
|
||||
const Const &c_width = cell->getParam(ID::C_WIDTHS);
|
||||
int a_width_sum = 0, b_width_sum = 0, c_width_sum = 0;
|
||||
for (int i = 0; i < param(ID::NPRODUCTS); i++) {
|
||||
a_width_sum += a_width.extract(16 * i, 16).as_int(false);
|
||||
b_width_sum += b_width.extract(16 * i, 16).as_int(false);
|
||||
}
|
||||
for (int i = 0; i < param(ID::NADDENDS); i++) {
|
||||
c_width_sum += c_width.extract(16 * i, 16).as_int(false);
|
||||
}
|
||||
port(ID::A, a_width_sum);
|
||||
port(ID::B, b_width_sum);
|
||||
port(ID::C, c_width_sum);
|
||||
port(ID::Y, param(ID::Y_WIDTH));
|
||||
check_expected();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cell->type == ID($logic_not)) {
|
||||
param_bool(ID::A_SIGNED);
|
||||
port(ID::A, param(ID::A_WIDTH));
|
||||
|
@ -4146,6 +4186,11 @@ void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
|
|||
return;
|
||||
}
|
||||
|
||||
if (type == ID($macc_v2)) {
|
||||
parameters[ID::Y_WIDTH] = GetSize(connections_[ID::Y]);
|
||||
return;
|
||||
}
|
||||
|
||||
bool signedness_ab = !type.in(ID($slice), ID($concat), ID($macc));
|
||||
|
||||
if (connections_.count(ID::A)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue