mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
parent
039f4f48d5
commit
a23d9409e7
2 changed files with 46 additions and 0 deletions
|
@ -52,6 +52,18 @@ struct OptMemPass : public Pass {
|
|||
int total_count = 0;
|
||||
for (auto module : design->selected_modules()) {
|
||||
for (auto &mem : Mem::get_selected_memories(module)) {
|
||||
bool changed = false;
|
||||
for (auto &port : mem.wr_ports) {
|
||||
if (port.en.is_fully_zero()) {
|
||||
port.removed = true;
|
||||
changed = true;
|
||||
total_count++;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
mem.emit();
|
||||
}
|
||||
|
||||
if (mem.wr_ports.empty() && mem.inits.empty()) {
|
||||
mem.remove();
|
||||
total_count++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue