From 0711aa1bd6e1289708b891f2e78ed8b453920ee8 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 10 Sep 2019 16:56:14 -0600 Subject: [PATCH] minor bug fixing --- vpr7_x2p/vpr/SRC/fpga_x2p/verilog/verilog_decoders.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vpr7_x2p/vpr/SRC/fpga_x2p/verilog/verilog_decoders.cpp b/vpr7_x2p/vpr/SRC/fpga_x2p/verilog/verilog_decoders.cpp index d24773c49..c237c23f9 100644 --- a/vpr7_x2p/vpr/SRC/fpga_x2p/verilog/verilog_decoders.cpp +++ b/vpr7_x2p/vpr/SRC/fpga_x2p/verilog/verilog_decoders.cpp @@ -190,10 +190,17 @@ void print_verilog_submodule_mux_local_decoders(ModuleManager& module_manager, std::vector branch_mux_graphs = mux_graph.build_mux_branch_graphs(); /* Add the decoder to the decoder library */ for (auto branch_mux_graph : branch_mux_graphs) { + /* The decoder size depends on the number of memories of a branch MUX. + * Note that only when there are >=2 memories, a decoder is needed + */ + size_t decoder_data_size = branch_mux_graph.num_memory_bits(); + if (2 > decoder_data_size) { + continue; + } /* Try to find if the decoder already exists in the library, * If there is no such decoder, add it to the library */ - add_mux_local_decoder_to_library(decoder_lib, branch_mux_graph.num_inputs()); + add_mux_local_decoder_to_library(decoder_lib, decoder_data_size); } }