| 2033 | } |
| 2034 | |
| 2035 | void kernelInfo::kernelinfo_function(int opcode, Opcode_info *arg_opcode) |
| 2036 | { |
| 2037 | |
| 2038 | cout << "enters kernel info function"<<endl; |
| 2039 | Port_info port_obj; |
| 2040 | int num_ports; |
| 2041 | |
| 2042 | switch(opcode) |
| 2043 | { |
| 2044 | case HW_CONV: |
| 2045 | arg_opcode->op_code = opcode; |
| 2046 | |
| 2047 | arg_opcode->mega_module.module_type = HW_CONV; |
| 2048 | |
| 2049 | /* input port info filling */ |
| 2050 | num_ports = 2; |
| 2051 | arg_opcode->mega_module.num_input_ports = num_ports; |
| 2052 | |
| 2053 | for(int portid=0; portid<num_ports; portid++) |
| 2054 | { |
| 2055 | port_obj.used = 1; |
| 2056 | port_obj.data_type = XI_INT8; |
| 2057 | port_obj.pack_info = XI_CHANNEL_INTERLEAVED_2; |
| 2058 | port_obj.port_width = XI_128BIT_WIDTH; |
| 2059 | port_obj.port_idx = portid; |
| 2060 | arg_opcode->in_port_vec.push_back(port_obj); |
| 2061 | } |
| 2062 | |
| 2063 | /* output port info filling */ |
| 2064 | num_ports = 2; |
| 2065 | arg_opcode->mega_module.num_output_ports = num_ports; |
| 2066 | |
| 2067 | for(int portid=0; portid<num_ports; portid++) |
| 2068 | { |
| 2069 | port_obj.used = 1; |
| 2070 | port_obj.data_type = XI_INT8; |
| 2071 | port_obj.pack_info = XI_CHANNEL_INTERLEAVED_2; |
| 2072 | port_obj.port_width = XI_128BIT_WIDTH; |
| 2073 | port_obj.port_idx = portid; |
| 2074 | arg_opcode->out_port_vec.push_back(port_obj); |
| 2075 | } |
| 2076 | |
| 2077 | |
| 2078 | /* weight port info filling */ |
| 2079 | num_ports = 4; |
| 2080 | arg_opcode->mega_module.num_weight_ports = num_ports; |
| 2081 | |
| 2082 | for(int portid=0; portid<num_ports; portid++) |
| 2083 | { |
| 2084 | port_obj.used = 1; |
| 2085 | port_obj.data_type = XI_INT8; |
| 2086 | port_obj.pack_info = XI_CHANNEL_INTERLEAVED_2; |
| 2087 | port_obj.port_width = XI_128BIT_WIDTH; |
| 2088 | port_obj.port_idx = portid; |
| 2089 | arg_opcode->wt_port_vec.push_back(port_obj); |
| 2090 | } |
| 2091 | |
| 2092 | arg_opcode->mega_module.num_bias_ports = 1; |
no test coverage detected