def METHOD_NAME(self, valid, wen_en):
    for i in range(self.banks):
        self.wen[i] = 0
    for i in range(self.interconnect_input_ports):
        if (valid[i]):
            to_get = self.addr_gens[i]
            if (self.banks == 1):
                self.wen[0] = wen_en[i]
                break
            else:
                self.wen[to_get.get_address() >> (self.mem_addr_width)] = wen_en[i]
    return self.wen