There is provided a semiconductor device comprising a semiconductor chip and an electronic part disposed adjacent to each other, wherein a terminal is provided on the side of each of the semiconductor chip and the electronic part, and the terminal is electrically connected to the other terminal in the state where the sides of the semiconductor chip and the electronic part approach to each other. Additionally, a method of forming a valve is disclosed. In this regard, when the process steps are switched, the control means compares parameters for a current process step with those for a next process step and then switches either the output intensities or the output modes before switching the output modes or the output intensities, respectively.