From fd2ac3ad8dee11630885e095cc07b0827e12f832 Mon Sep 17 00:00:00 2001 From: Alain Dargelas Date: Tue, 4 Mar 2025 09:22:55 -0800 Subject: [PATCH] simplify --- passes/silimate/annotate_cell_fanout.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/passes/silimate/annotate_cell_fanout.cc b/passes/silimate/annotate_cell_fanout.cc index 1f7d9720c..71f3ccfca 100644 --- a/passes/silimate/annotate_cell_fanout.cc +++ b/passes/silimate/annotate_cell_fanout.cc @@ -217,7 +217,7 @@ RTLIL::SigSpec getCellOutputSigSpec(Cell *cell, SigMap &sigmap) // Get new output signal for a given signal, used all datastructures with change to buffer SigSpec updateToBuffer(std::map &bufferIndexes, - std::map>> &buffer_outputs, + std::map>> &buffer_outputs, dict> &sig2CellsInFanout, std::map &bufferActualFanout, std::map &usedBuffers, int max_output_per_buffer, Cell *fanoutcell, SigSpec sigToReplace, bool debug) @@ -235,12 +235,12 @@ SigSpec updateToBuffer(std::map &bufferIndexes, } // Retrieve the buffer information for that cell's chunk - std::vector> &buf_info_vec = buffer_outputs[sigToReplace]; + std::vector> &buf_info_vec = buffer_outputs[sigToReplace]; // Retrieve which buffer is getting filled int bufferIndex = bufferIndexes[sigToReplace]; - std::tuple &buf_info = buf_info_vec[bufferIndex]; - SigSpec newSig = std::get<0>(buf_info); - Cell *newBuf = std::get<1>(buf_info); + std::pair &buf_info = buf_info_vec[bufferIndex]; + SigSpec newSig = buf_info.first; + Cell *newBuf = buf_info.second; // Keep track of fanout map information for recursive calls sig2CellsInFanout[newSig].insert(fanoutcell); // Increment buffer capacity @@ -309,14 +309,14 @@ void fixfanout(RTLIL::Module *module, SigMap &sigmap, dict bufferActualFanout; // Array of buffers (The buffer output signal and the buffer cell) per cell output chunks - std::map>> buffer_outputs; + std::map>> buffer_outputs; // Keep track of which buffer in the array is getting filled for a given chunk std::map bufferIndexes; // Create new buffers and new wires int index_buffer = 0; for (SigChunk chunk : sigToBuffer.chunks()) { - std::vector> buffer_chunk_outputs; + std::vector> buffer_chunk_outputs; for (int i = 0; i < num_buffers; ++i) { RTLIL::Cell *buffer = module->addCell(signame + "_fbuf" + std::to_string(index_buffer), ID($pos)); bufferActualFanout[buffer] = 0; @@ -324,7 +324,7 @@ void fixfanout(RTLIL::Module *module, SigMap &sigmap, dictsetPort(ID(A), chunk); buffer->setPort(ID(Y), sigmap(buffer_output)); buffer->fixup_parameters(); - buffer_chunk_outputs.push_back(std::make_tuple(buffer_output, buffer)); // Old - New + buffer_chunk_outputs.push_back(std::make_pair(buffer_output, buffer)); // Old - New bufferIndexes[chunk] = 0; index_buffer++; }