There are two different flows you can use for NIOS II software design. The first is the IDE flow. This flow does not make use of the "_sw.tcl" file. Instead it uses a component.mk file to describe the software file associated with a custom component.
The "_sw.tcl" file is used with the software build tools flow. The "_sw.tcl" file is used to describe the software driver associated with a component (hardware or software component). You can find out more in Chapter 4 of the NIOS 2 software developer's handbook:
http://www.altera.com/literature/hb/nios2/n2sw_nii52015.pdf (
http://www.altera.com/literature/hb/nios2/n2sw_nii52015.pdf)
You can also look at some of the example TCL script in the individual component folders of the IP libraries.
Jake