EDA Problems¶
Environment for Electronic Design Automation (EDA) problems
Decap Placement Problem (DPP)¶
DPPEnv
¶
DPPEnv(
generator: DPPGenerator = None,
generator_params: dict = {},
**kwargs
)
Bases: RL4COEnvBase
Decap Placement Problem (DPP) as done in DevFormer paper: https://arxiv.org/abs/2205.13225
The environment is a 10x10 grid with 100 locations containing either a probing port or a keepout region. The goal is to place decaps (decoupling capacitors) to maximize the impedance suppression at the probing port. Decaps cannot be placed in keepout regions or at the probing port and the number of decaps is limited.
Observations
- locations of the probing port and keepout regions
- current decap placement
- remaining decaps
Constraints
- decaps cannot be placed at the probing port or keepout regions
- the number of decaps is limited
Finish Condition
- the number of decaps exceeds the limit
Reward
- the impedance suppression at the probing port
Parameters:
-
generator
(DPPGenerator
, default:None
) –DPPGenerator instance as the data generator
-
generator_params
(dict
, default:{}
) –parameters for the generator
Source code in rl4co/envs/eda/dpp/env.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
DPPGenerator
¶
DPPGenerator(
min_loc: float = 0.0,
max_loc: float = 1.0,
num_keepout_min: int = 1,
num_keepout_max: int = 50,
max_decaps: int = 20,
data_dir: str = "data/dpp/",
chip_file: str = "10x10_pkg_chip.npy",
decap_file: str = "01nF_decap.npy",
freq_file: str = "freq_201.npy",
url: str = None,
**unused_kwargs
)
Bases: Generator
Data generator for the Decap Placement Problem (DPP).
Parameters:
-
min_loc
(float
, default:0.0
) –Minimum location value. Defaults to 0.
-
max_loc
(float
, default:1.0
) –Maximum location value. Defaults to 1.
-
num_keepout_min
(int
, default:1
) –Minimum number of keepout regions. Defaults to 1.
-
num_keepout_max
(int
, default:50
) –Maximum number of keepout regions. Defaults to 50.
-
max_decaps
(int
, default:20
) –Maximum number of decaps. Defaults to 20.
-
data_dir
(str
, default:'data/dpp/'
) –Directory to store data. Defaults to "data/dpp/". This can be downloaded from this url.
-
chip_file
(str
, default:'10x10_pkg_chip.npy'
) –Name of the chip file. Defaults to "10x10_pkg_chip.npy".
-
decap_file
(str
, default:'01nF_decap.npy'
) –Name of the decap file. Defaults to "01nF_decap.npy".
-
freq_file
(str
, default:'freq_201.npy'
) –Name of the frequency file. Defaults to "freq_201.npy".
-
url
(str
, default:None
) –URL to download data from. Defaults to None.
Returns:
-
–
A TensorDict with the following keys: locs [batch_size, num_loc, 2]: locations of each customer depot [batch_size, 2]: location of the depot demand [batch_size, num_loc]: demand of each customer capacity [batch_size]: capacity of the vehicle
Source code in rl4co/envs/eda/dpp/generator.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
Multi-port Decap Placement Problem (mDPP)¶
MDPPEnv
¶
MDPPEnv(
generator: MDPPGenerator = None,
generator_params: dict = {},
reward_type: str = "minmax",
**kwargs
)
Bases: DPPEnv
Multiple decap placement problem (mDPP) environment This is a modified version of the DPP environment where we allow multiple probing ports
Observations
- locations of the probing ports and keepout regions
- current decap placement
- remaining decaps
Constraints
- decaps cannot be placed at the probing ports or keepout regions
- the number of decaps is limited
Finish Condition
- the number of decaps exceeds the limit
Reward
- the impedance suppression at the probing ports
Parameters:
-
generator
(MDPPGenerator
, default:None
) –DPPGenerator instance as the data generator
-
generator_params
(dict
, default:{}
) –parameters for the generator
-
reward_type
(str
, default:'minmax'
) –reward type, either minmax or meansum
- minmax: min of the max of the decap scores
- meansum: mean of the sum of the decap scores
Note
The minmax is more challenging as it requires to find the best decap location for the worst case
Source code in rl4co/envs/eda/mdpp/env.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
MDPPGenerator
¶
MDPPGenerator(
min_loc: float = 0.0,
max_loc: float = 1.0,
num_keepout_min: int = 1,
num_keepout_max: int = 50,
num_probes_min: int = 2,
num_probes_max: int = 5,
max_decaps: int = 20,
data_dir: str = "data/dpp/",
chip_file: str = "10x10_pkg_chip.npy",
decap_file: str = "01nF_decap.npy",
freq_file: str = "freq_201.npy",
url: str = None,
**unused_kwargs
)
Bases: Generator
Data generator for the Multi Decap Placement Problem (MDPP).
Parameters:
-
min_loc
(float
, default:0.0
) –Minimum location value. Defaults to 0.
-
max_loc
(float
, default:1.0
) –Maximum location value. Defaults to 1.
-
num_keepout_min
(int
, default:1
) –Minimum number of keepout regions. Defaults to 1.
-
num_keepout_max
(int
, default:50
) –Maximum number of keepout regions. Defaults to 50.
-
max_decaps
(int
, default:20
) –Maximum number of decaps. Defaults to 20.
-
data_dir
(str
, default:'data/dpp/'
) –Directory to store data. Defaults to "data/dpp/". This can be downloaded from this url.
-
chip_file
(str
, default:'10x10_pkg_chip.npy'
) –Name of the chip file. Defaults to "10x10_pkg_chip.npy".
-
decap_file
(str
, default:'01nF_decap.npy'
) –Name of the decap file. Defaults to "01nF_decap.npy".
-
freq_file
(str
, default:'freq_201.npy'
) –Name of the frequency file. Defaults to "freq_201.npy".
-
url
(str
, default:None
) –URL to download data from. Defaults to None.
Returns:
-
–
A TensorDict with the following keys: locs [batch_size, num_loc, 2]: locations of each customer depot [batch_size, 2]: location of the depot demand [batch_size, num_loc]: demand of each customer capacity [batch_size]: capacity of the vehicle
Source code in rl4co/envs/eda/mdpp/generator.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|