diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-01-02 13:59:47 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-01-02 13:59:47 +0100 |
commit | bbf89c4dc68475b57709897ab0728e31963a1ddb (patch) | |
tree | eabe436692079854cf4bcd3ab00dea0ca63feb85 /passes/memory | |
parent | 36c20f2ede51580f7c68b96b9cde9473187a8fc6 (diff) | |
download | yosys-bbf89c4dc68475b57709897ab0728e31963a1ddb.tar.gz yosys-bbf89c4dc68475b57709897ab0728e31963a1ddb.tar.bz2 yosys-bbf89c4dc68475b57709897ab0728e31963a1ddb.zip |
Progress in memory_bram
Diffstat (limited to 'passes/memory')
-rw-r--r-- | passes/memory/memory_bram.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/passes/memory/memory_bram.cc b/passes/memory/memory_bram.cc index 853950a34..1f7436d2d 100644 --- a/passes/memory/memory_bram.cc +++ b/passes/memory/memory_bram.cc @@ -306,10 +306,10 @@ bool replace_cell(Cell *cell, const rules_t::bram_t &bram, const rules_t::match_ SigBit last_en_bit = State::S1; for (int i = 0; i < mem_width; i++) { if (pi.enable && i % (bram.dbits / pi.enable) == 0) { - last_en_bit = wr_en[i]; + last_en_bit = wr_en[i + cell_port_i*mem_width]; sig_en.append(last_en_bit); } - if (last_en_bit != wr_en[i]) { + if (last_en_bit != wr_en[i + cell_port_i*mem_width]) { log(" Bram port %c%d has incompatible enable structure.\n", pi.group + 'A', pi.index + 1); goto skip_bram_wport; } @@ -328,6 +328,7 @@ bool replace_cell(Cell *cell, const rules_t::bram_t &bram, const rules_t::match_ pi.sig_addr = wr_addr.extract(cell_port_i*mem_abits, mem_abits); pi.sig_data = wr_data.extract(cell_port_i*mem_width, mem_width); + bram_port_i++; goto mapped_wr_port; } @@ -338,6 +339,7 @@ bool replace_cell(Cell *cell, const rules_t::bram_t &bram, const rules_t::match_ int grow_read_ports_cursor = -1; bool try_growing_more_read_ports = false; + auto backup_clock_domains = clock_domains; if (0) { grow_read_ports:; @@ -360,6 +362,7 @@ grow_read_ports:; } try_growing_more_read_ports = false; portinfos.swap(new_portinfos); + clock_domains = backup_clock_domains; dup_count++; } @@ -448,7 +451,7 @@ grow_read_ports:; string prefix = stringf("%c%d", pi.group + 'A', pi.index + 1); const char *pf = prefix.c_str(); - if (pi.clocks) + if (pi.clocks && (!clocks.count(pi.clocks) || pi.sig_clock.wire)) clocks[pi.clocks] = pi.sig_clock; SigSpec addr_ok; |