This is Release 1.0 of DSA Pathfinding framework.
Developed by Yasmine Badr, PhD Candidate, EE Department, UCLA (ybadr@ucla.edu)
Advisor: Puneet Gupta
______________________________________________________________
Pre-requisites
----------------
Running the framework requires Open Access. It has been compiled using version 22.41.004.
The framework has been compiled using GCC 4.4.7, on a CENTOS distribution of linux on a 64-bit machine.
______________________________________________________________
Input Arguments
---------------
To run the program, two things are needed:
1- A file named "techCost.input". An example is provided in the downloaded directory. The contents of this file are explained in the next section. 
2- The following input arguments are needed. 
./dsa_pathfind <num_threads> <name_OA_DB> <path_OA_DB> <cell_name> layout <min_dsa_dist> <max_dsa_dist> <max_g> <min_dist_same_mask> <via_width> <via_height> <min_dist_diff_mask> <man_coll_flag> ilp n <1D_or_2D> <hotspot_file> <via_layer_name> <mask1_layer_name> <mask2_layer_name> .. <maskn_layer_name> <mask1_DSA_layerName> <mask2_DSA_layerName> .. < maskn_DSA_layerName> 

Description of the input arguments:
-----------------------------------
Note that some input values are fixed; these are the ones not within angled brackets. The other input arguments are explained in the following:
* num_threads: number of OpenMP threads to use. If you use 1 thread, then the problem will be solved sequentially, using one thread. If you are doing Minimum Cost technology cost, then the number of threads MUST be 1
* name_OA_DB: name of the Open Acess Database used as input
* path_OA_DB: path to the Open Access Database used as input (including the name of the database)
* cell_name: name of the topcell in the layout. A flat layout is expected.
* layout: Use layout
* min_dsa_dist: minimum distance between 2 vias in a DSA group in nm
* max_dsa_dist: maximum distance between 2 neighboring vias in a group in nm
* max_g: maximum number of vias in a DSA group
* min_dist_same_mask: minimum distance allowed between two vias (or two DSA groups) on the same mask
* via_width: Width of the via
* via_height: Height of the via
* min_dist_diff_mask: minimum distance allowed between two vias (or two DSA groups) on different masks
* man_coll_flag: This specifies the kind of allowed templates. 
	       *If it is required to allow manhattan and collinear DSA groups only, use "nonMan_nonColl_generic" ( recommended for 193i)
	       *If it is required to allow groups in which not all vias are collinear only, but each pair of neighboring vias are horizontally or vertically aligned, then use "man_nonColl_generic" (This is the more restrictive option for EUV).
	       *If it is desired to allow groups in which not all vias are collinear only, and each pair of neighboring vias do not have to be horizontally or vertically aligned, then use "nonMan_nonColl_generic" (This is the more flexible option for EUV).
* 1D_or_2D:      This determines whether all templates of each mask are allowed to be in the same direction (1D), or can be in both directions: vertical and horizontal (2D).
* hotspot_file: The path to the hotspot file. If no hotspots are to be provided, then use "none". The representation of the hotspots is described in the paper. An example is provided in patterns_input/sadp_seg and patterns_input/sadp_node, and in this case the hotspot_file should be "patterns_input/sadp". (Both segment and node representations are needed)
* via_layer_name: The name of the via layer under evaluation in Open Access (use same name used in the layer map file (layer.map)). 
* mask1_layer_name: The name of the Open Access layer where the first mask will be saved  [ not showing the DSA groups]
* mask2_layer_name: The name of the Open Access layer where the second mask will be saved (in case more than one mask is used)[not showing the DSA groups]
 ..
* maskn_layer_name: The name of the Open Access layer where the nth mask will be saved (in case n or more masks are used)[not showing the DSA groups]
* mask1_DSA_layerName: The name of the Open Access layer where the final first mask will be saved, showing the DSA groups.
* mask2_DSA_layerName: The name of the Open Access layer where the final second mask will be saved, showing the DSA groups.
..
* maskn_DSA_layerName: The name of the Open Access layer where the final nth mask will be saved, showing the DSA groups.
______________________________________________________________
Examples of the usage of the program
------------------------------------
In the same directory, there are example scripts named "run_EUV" and "run_EUV_minTechCost". However, to run the examples you need to provide a layout and technology database in Open Access yourself (We can not provide ours due to IP issues. If you are one of our CDEN partners, please contact us we may be able to work out an example together without violating IP). Each example includes the invocation scripts to convert gds to Open Access, run the ILP, and save the output as a gds. The commands for the C++ program solving the ILP for a couple of cases are  as follows
DSA+EUV Non-Manhattan
-----------------
This evaluates the DSA technology using EUV to print the guiding templates, with "nonMan_nonColl_generic" (explained above). To run this example, make sure that the techCost.input file has "doMinTechCost 0" at the beginning of the file. The script to run this example is run_EUV_nonManhattan. The included command to run the program is:
./dsa_pathfind 4 design_MP design_MP usbf_top layout 15 36 7 25 15 15 7 "nonMan_nonColl_generic" ilp n 2D none contacts mask1 mask1_dsa
 
DSA+EUV Manhattan templates only 
-----------------------------
This evaluates the DSA technology using EUV to print the guiding templates, with "man_nonColl_generic" (explained above). To run this example, make sure that the techCost.input file has "doMinTechCost 0" at the beginning of the file. The script to run this example is run_EUV. The included command to run the program is:
./dsa_pathfind 4 design_MP design_MP usbf_top layout 15 36 7 25 15 15 7 "man_nonColl_generic" ilp n 2D none contacts mask1 mask1_dsa

DSA+EUV Manhattan templates only  + minimum cost tech change
---------------------------------------------------------
This example finds the minimum-cost technology change to have a design-friendly technology, starting from an EUV technology allowing only "man_nonColl_generic" templates. To run this example, make sure that the techCost.input file has "doMinTechCost 1" at the beginning of the file. The script to run this example is run_EUV_minTechCost. The included command to run the program is:
./dsa_pathfind 1 design_MP design_MP usbf_top layout 15 36 7 25 15 15 7 man_nonColl_generic ilp n 2D none contacts mask1 mask1_dsa

193i +Triple Patterning
------------------------
This example evaluates the DSA technology using 193i+Triple Patterning to print the guiding templates. To run this example, make sure that the techCost.input file has "doMinTechCost 0" at the beginning of the file. The script to run this example is run_193i_TP.
./dsa_pathfind 4 design_MP design_MP usbf_top layout 15 36 3 75 15 15 10 man_coll_generic ilp n 2D none V1  mask1 mask2 mask3 mask1_dsa mask2_dsa mask3_dsa
______________________________________________________________
Description of techCost.input
------------------------------
The cost parameters for the minimum cost technology change computation are to provided  in a file named "techCost.input".
Note: if you want to run infeasibility analysis, number of threads MUST be set to 1 thread only. The following explains the input parameters defined in techCost.input file.

doMinTechCost			: input argument specifying whether minimum-cost technology change is desired to be computed (1) or not (0)
costViolatingHotspot		: input argument specifying the cost of violating one hotspot. Several occurrences of the same hotspot patternresult in the same cost as one occurrence only. 
costViolatingOverlapGps		: input argument specifying the cost of having the templates for DSA groups on different masks, overlap in space.
costViolatingUniDir		: input argument specifying the cost of violating the uni-directionality requirement if specified in the original technology conditions.
costMaxDSAPerDBU		: input argument specifying the cost of increasing the max_dsa_dist by 1 DBU.
costLithoDistPerDBU 		: input argument specifying the cost of increasing the min_dist_same_mask by 1 DBU.
costDiffMaskDistPerDBU		: input argument specifying the cost of increasing the min_dist_diff_mask by 1 DBU
baselineCostAlternateGrpCheck 	: input argument specifying the added cost due to using an alternate grouping checker. The alternate grouping checker is currently the EUV grouping checker where non-manhattan templates are allowed.
costRateMaxG 			: input argument specifying the cost of increasing max_g by 1 via.
maxGroupSizeIncreaseInTechCost 	: input argument specifying the maximum allowed increase in group size during the search for min-cost technology change.
______________________________________________________________                                           
Description of hotspot file 
---------------------------
The hotspot representation is described in the paper. Examples are shown in the patterns_input directory. Each set of hotspots needs to be represented as segments and as nodes (using _seg and _node files). The file format is as follows for the segment representation of the hotspot (_seg file):

new_size
<number of rows in the pattern>
<number of columns in the pattern>
<pattern>
same_size
<pattern>
..
<new_size>
<number of rows in the pattern>
<number of columns in the pattern>
<pattern>
..
-1

The format for the node representation of the hotspot (_node file):
<pattern>
<pattern>
..
<pattern>
-1

______________________________________________________________
Ouput of minimum-cost technology change
---------------------------------------
The output file will show the cost of the change as well as the chosen technology change in a list. The list of changes is interpreted as follows:
EL_L_x: Change the min_dist_same_mask to x DBU (instead of the provided value in nm)
EL_DM_x: Change the min_dist_diff_mask to x DBU (instead of the provided value in nm)
EL_H_x: Remove the xth hotspot
EL_OV: Allow the guiding templates which are assigned to different masks to overlap in space.
EL_U: Remove the unidirectionality constraint
GC_0_y_z: Use the provided grouping checker, but increase  max_dsa_dist to y, and increase max_g to z
GC_1_y_z: Use the alternate grouping checker, with  max_dsa_dist = y, and  max_g = z. The alternate grouping checker allows the same DSA groups as the EUV grouping checker, where non-manhatten groups are allowed.
______________________________________________________________
Output layout
-------------
The framework will produce a layout called result_MP_dsa.gds, where the final DSA groups are shown on layers 500, 501, 502, 503 for mask 1, 2, 3, 4 respectively.




