Recently, automotive semiconductor devices need miniaturization. One of the most important technologies is the package which encapsulates devices. In addition, the outer shape of the package is needed to change according to the mounted space. Conventional devices are mounted in the case, and encapsulated with potting resin. However this package structure is difficult to miniaturize because the case size limit. This report describes the development of the packaging technology for miniature and particular outer shape. The devices are set in the cavity and molded to one package. The three-dimension flow simulation is applied to analyze the flow in the cavity. The results of simulation correspond with experimental results. The cavity structure and the mold resin can be optimized by the simulation.