#!/bin/csh
####################################################
# Variables automatically created by the ETM
####################################################
#setenv JOB  meco_test
#setenv STEP  orig
#setenv ETSET  1
#setenv SPLIT  split_1
#setenv ADAPTER_NAME  hh-test
#setenv DIR_PATH  C:/opt/genesis/fw/jobs/meco_test/steps/orig/et/1/split_1/output/
#setenv FORMAT  ipcd-356a
#setenv TESTER_TYPE  flying_probe
####################################################

source $1
cat $1 > /tmp/post_etm_output

set netlist_files = (`ls $DIR_PATH `)


#
# Difference made between fixture tester or flying probe tester
#

#echo "Tester type : $TESTER_TYPE"
#echo "Format : $FORMAT"

if ( $TESTER_TYPE == "flying_probe" && $FORMAT == "epc+atf") then

    if (-e $DIR_PATH"/"$JOB) then
    
       rm -r $DIR_PATH"/"$JOB
       mkdir $DIR_PATH"/"$JOB
    
    else
    
       mkdir $DIR_PATH"/"$JOB
     
    endif
   
    set destination_dir = $DIR_PATH"/"$JOB"/"
   
    if (-e /tmp/post_etm) rm /tmp/post_etm
   
    foreach file ( $netlist_files )
     
        if !(-d $DIR_PATH"/"$file) then
        
          switch ($file)
         
            case "et_net":
                     
              mv $DIR_PATH"/"$file $destination_dir$JOB".les"
        
            breaksw
     
            case "et_net.ipcd":
                         
              mv $DIR_PATH"/"$file $destination_dir$JOB".ipc"
              
            breaksw
     
            case "orig_s0.bol":
        
              mv $DIR_PATH"/"$file $destination_dir$JOB".bol"
              
            breaksw
            
            case "orig_s0.lin":
        
              mv $DIR_PATH"/"$file $destination_dir$JOB".lin"
              
            breaksw
            
            case "orig_s0.pad":
        
              mv $DIR_PATH"/"$file $destination_dir$JOB".pad"
              
            breaksw
            
            case "orig_s0.car":
        
              mv $DIR_PATH"/"$file $destination_dir$JOB".car"
              
            breaksw
            
            case "orig_s0.n2f":
        
              mv $DIR_PATH"/"$file $destination_dir$JOB".n2f"
              
            breaksw
            
          endsw
        endif   
    end
endif


### EOF ###

####EOF###