From 83a218141c1a333b582c257c316ddea63e1ca519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Wed, 26 May 2021 02:49:50 +0200 Subject: kernel/mem: Add sub_addr helpers. --- passes/opt/opt_mem_feedback.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'passes/opt') diff --git a/passes/opt/opt_mem_feedback.cc b/passes/opt/opt_mem_feedback.cc index 8e93c93b9..131103843 100644 --- a/passes/opt/opt_mem_feedback.cc +++ b/passes/opt/opt_mem_feedback.cc @@ -145,9 +145,7 @@ struct OptMemFeedbackWorker continue; for (int sub = 0; sub < (1 << port.wide_log2); sub++) { - SigSpec addr = sigmap_xmux(port.addr); - for (int i = 0; i < port.wide_log2; i++) - addr[i] = State(sub >> i & 1); + SigSpec addr = sigmap_xmux(port.sub_addr(sub)); async_rd_bits[addr].resize(mem.width); for (int i = 0; i < mem.width; i++) async_rd_bits[addr][i].insert(sigmap(port.data[i + sub * mem.width])); @@ -168,9 +166,7 @@ struct OptMemFeedbackWorker for (int sub = 0; sub < (1 << port.wide_log2); sub++) { - SigSpec addr = sigmap_xmux(port.addr); - for (int k = 0; k < port.wide_log2; k++) - addr[k] = State(sub >> k & 1); + SigSpec addr = sigmap_xmux(port.sub_addr(sub)); if (!async_rd_bits.count(addr)) continue; -- cgit v1.2.3