Skip to content

Improve DSP max limit #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/synth_rapidsilicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8283,12 +8283,24 @@ void collect_clocks (RTLIL::Module* module,

void check_dsp_device_limit()
{
if (max_dsp == -1)
{
for (auto cell : _design->top_module()->cells())
{
if (cell->type == RTLIL::escape_id("$mul"))
{
cell->set_bool_attribute(RTLIL::escape_id("valid_map"));
}
}
return;
}
std::unordered_map<RTLIL::Cell *, int> dsp_control;

for (auto cell : _design->top_module()->cells())
{
if (cell->type == RTLIL::escape_id("$mul"))
{

int _a_width_ = cell->getParam(ID::A_WIDTH).as_int();
int _b_width_ = cell->getParam(ID::B_WIDTH).as_int();
int a_signed = cell->getParam(ID::A_SIGNED).as_int();
Expand Down Expand Up @@ -8359,11 +8371,9 @@ void collect_clocks (RTLIL::Module* module,
}
dsp_limit_message = "DSP exceeds the available DSP block limit (" + std::to_string(max_dsp) +
") on the device; the excess " + std::to_string(remaining_sum) +
" DSP blocks is mapped to soft logic.\n";
" DSP blocks are mapped to soft logic.\n";
log_warning("DSP exceeds the available DSP block limit (%d) on the device; the excess %d DSP blocks will be mapped to LUTs.\n",max_dsp, remaining_sum);
}


}

void script() override
Expand Down
Loading