done = self.checkdone(roundedperformancemetrics) File "D:\OPAMP…
- User
done = self.check_done(rounded_performance_metrics) File "D:\OPAMP CIRCUITS\RLGNN_LTSpice\RL_GNN_LTS_Train_Test3.py", line 120, in check_done if performance_metrics[metric_name] != self.target_metrics[metric_name]: IndexError: only integers, slices (
:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indicesFor your understanding i am giving following results to rectify the error, print(self.target_metrics) gives following result [ 76 80063 64248703 68]
if we perform metrics_order = ['gain', 'bw', 'ugf', 'pm'] target_metrics = {k: self.target_metrics[i] for i, k in enumerate(metrics_order)} print("target_metrics", target_metrics) then it gives target_metrics {'gain': 76, 'bw': 80063, 'ugf': 64248703, 'pm': 68}
My Code:
Define Circuit Environment
class CircuitEnvironment: PERFORMANCE_METRICS_TARGET_LOW = np.array([48, 30e3, 10e6, 60]) PERFORMANCE_METRICS_TARGET_HIGH = np.array([100, 100e3, 100e6, 75]) LARGE_REWARD = 10 VERY_HIGH_REWARD = 50 PENALTY = 20
codedef __init__(self, bounds_low, bounds_high): # Initialization code: setup bounds self.bounds_low = bounds_low self.bounds_high = bounds_high # Initialize tensors as None self.node_features_tensor = None self.edge_index = None self.target_metrics = None def step(self, raw_actions, previous_metrics, target_metrics): raw_actions = np.squeeze(raw_actions) performance_metrics, temp_netlist_path = run_simulation(raw_actions) node_features_tensor, edge_index = netlist_to_graph(temp_netlist_path) self.target_metrics = target_metrics # Round off the previous and current performance metrics to integer values for comparison rounded_performance_metrics = {k: int(round(v)) for k, v in performance_metrics.items()} rounded_previous_metrics = {k: int(round(v)) for k, v in previous_metrics.items()} reward = self.calculate_reward(rounded_performance_metrics, rounded_previous_metrics) done = self.check_done(rounded_performance_metrics) # Update previous state previous_metrics = rounded_performance_metrics self.node_features_tensor = node_features_tensor self.edge_index = edge_index print(f"Reward:", reward) logging.info(f"Reward: {reward}") return node_features_tensor, edge_index, reward, done, previous_metrics def check_done(self, performance_metrics): print(self.target_metrics) if self.target_metrics is None: return False metrics_order = ['gain', 'bw', 'ugf', 'pm'] for metric_name in metrics_order: if performance_metrics[metric_name] != self.target_metrics[metric_name]: return False return True - Assistant
- User
correct the grammatical mistakes "i am doing optimization process in the analog circuit design, in the reference papers they didnot gave all the necessary circuit design values, they only gave the W/L ratios, Ibias and VDD, and they did not provided the AC input parameter details and DC bias voltage to the input transistors details. even if i vary those ungiven values with in the specific ranges, i am not getting the same results(performance metrics) which is mentioned in the reference paper and also each and every paper have their own benchmark target performance specifications. so i canot able to tune my optimization process without the complete benchmark circuit(circuit with all design values). so i need your help to provide me which ever circuit which i mentioned previously, with all circuit design values and simulation settings values. i will keep it performance metrics as benchmark to tune my optimization process. Now in our college CADENCE server were updated to new version. So, Prof. Kumaravel sir's existing cadence circuit(for those circuits which i asked) is not opening in the new version, so he advised me to seek your goodself for help."
- Assistant
Certainly! Here’s a corrected and refined version of your text:
"I am currently involved in the optimization process of analog circuit design. In the reference papers I have consulted, the authors did not provide all the necessary circuit design values. They only provided the W/L ratios, Ibias, and VDD. Additionally, they did not include the AC input parameter details or the DC bias voltage for the input transistors. Despite varying these unspecified values within specific ranges, I am unable to achieve the same performance metrics as mentioned in the reference papers. Moreover, each paper has its own benchmark target performance specifications, making it difficult to tune my optimization process without a complete benchmark circuit (i.e., a circuit with all design values).
Therefore, I need your assistance in providing the circuit details I previously mentioned, along with all the design values and simulation settings. I will use these performance metrics as a benchmark to fine-tune my optimization process.
Recently, our college's CADENCE server was updated to a new version. Consequently, Prof. Kumaravel's existing CADENCE circuit (for the circuits I asked about) is not opening in the new version. He advised me to seek assistance from you. Your help would be greatly appreciated."