| 586 | } |
| 587 | |
| 588 | void update_softmax_module_opcode_table(Opcode_info & obj_module_opcode,map<opcode_num_e, Opcode_info> & opcode_info_map,int batch_size){ |
| 589 | |
| 590 | Module_info module_default; |
| 591 | module_default.module_target_info = CPU; |
| 592 | module_default.module_type = SW_SOFTMAX; |
| 593 | module_default.module_name = "Softmax"; /// TODO abid needs to update the layer information based on the enum instead of layer name |
| 594 | module_default.num_total_ports=11; // TODO need to check with buffer management & init module |
| 595 | obj_module_opcode.mega_module = module_default; |
| 596 | |
| 597 | /*** softmax mega module ports & these port order should be same as deploy file*********/ |
| 598 | |
| 599 | Port_info port_defualt; |
| 600 | port_defualt.data_type = XI_FLOAT; |
| 601 | port_defualt.size_datatype = XI_FLOAT_S; |
| 602 | port_defualt.memory_align_required=32; // TODO need to check with buffer management & init module |
| 603 | port_defualt.memory_map_info = __MALLOC_TYPE; |
| 604 | port_defualt.port_enum=XI_INPUT; |
| 605 | port_defualt.qant_scheme_type = g_quant_value; |
| 606 | obj_module_opcode.port_vec.push_back(port_defualt); |
| 607 | |
| 608 | packinfo input_p_info; |
| 609 | |
| 610 | input_p_info.dim = XI_CHANNEL; |
| 611 | input_p_info.mem_contiguous = true; |
| 612 | input_p_info.mod_div_factor = (port_defualt.port_width/port_defualt.size_datatype)/batch_size; |
| 613 | input_p_info.sep=XI_DIVISION; |
| 614 | |
| 615 | port_defualt.pack_info_vec.push_back(input_p_info); |
| 616 | |
| 617 | input_p_info.dim = XI_HEIGHT; |
| 618 | input_p_info.mem_contiguous = true; |
| 619 | input_p_info.mod_div_factor = 0; |
| 620 | input_p_info.sep=XI_NONE; |
| 621 | |
| 622 | port_defualt.pack_info_vec.push_back(input_p_info); |
| 623 | |
| 624 | input_p_info.dim = XI_WIDTH; |
| 625 | input_p_info.mem_contiguous = true; |
| 626 | input_p_info.mod_div_factor = 0; |
| 627 | input_p_info.sep=XI_NONE; |
| 628 | |
| 629 | port_defualt.pack_info_vec.push_back(input_p_info); |
| 630 | |
| 631 | input_p_info.dim = XI_INTERLEAVED; |
| 632 | input_p_info.mem_contiguous = true; |
| 633 | input_p_info.mod_div_factor = (port_defualt.port_width/port_defualt.size_datatype)/batch_size; |
| 634 | input_p_info.sep=XI_MODULO; |
| 635 | |
| 636 | port_defualt.pack_info_vec.push_back(input_p_info); |
| 637 | |
| 638 | input_p_info.dim = XI_BATCH; |
| 639 | input_p_info.mem_contiguous = true; |
| 640 | input_p_info.mod_div_factor = 0; |
| 641 | input_p_info.sep=XI_NONE; |
| 642 | |
| 643 | port_defualt.pack_info_vec.push_back(input_p_info); |
| 644 | |
| 645 | Port_info port_defualt1; |