Skip to content

Commit

Permalink
added some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
MitjaNemec committed Oct 12, 2023
1 parent 5370263 commit 7b8b3c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions save_restore_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ def replicate_tracks(self, src_anchor_fp, src_tracks, dst_anchor_fp, net_pairs,
delta_orientation = dst_anchor_fp_angle - src_anchor_fp_angle

net_pairs, net_dict = net_pairs
logger.info(f'Net pairs are: {repr(net_pairs)}')

# go through all the tracks
nr_tracks = len(src_tracks)
Expand Down Expand Up @@ -1173,19 +1174,24 @@ def replicate_zones(self, src_anchor_fp, src_zones, dst_anchor_fp, net_pairs, la
delta_orientation = dst_anchor_fp_angle - src_anchor_fp_angle

net_pairs, net_dict = net_pairs
logger.info(f'Net pairs are: {repr(net_pairs)}')
# go through all the zones
nr_zones = len(src_zones)
for zone_index in range(nr_zones):
zone = src_zones[zone_index]

# get from which net we are cloning
from_net_name = zone.GetNetname()
logger.info(f'Handlilng zone connected to: {repr(from_net_name)}')

# if zone is not on copper layer it does not matter on which net it is
if not zone.IsOnCopperLayer():
tup = [('', '')]
else:
if from_net_name:
tup = [item for item in net_pairs if item[0] == from_net_name]
logger.info(f'Zone list of net tuples: {repr(tup)}')
# TODO - what if the designed is restored in a project where some net does not exist?
else:
tup = [('', '')]

Expand All @@ -1194,6 +1200,15 @@ def replicate_zones(self, src_anchor_fp, src_zones, dst_anchor_fp, net_pairs, la
# Allow keepout zones to be cloned.
if not zone.IsOnCopperLayer():
tup = [('', '')]
# TODO should probably need to cover the else case
else:
logger.info(f'unhandled net pair case with zone. The zone has a name: {repr(zone.GetZoneName())}\n'
f'is connected: {repr(zone.IsConnected())}\n'
f'is on net: {repr(zone.GetNetname())}\n'
f'has flags: {repr(zone.GetFlags())}\n'
f'is of class: {repr(zone.GetClass())}\n'
f'is of type: {repr(zone.GetTypeDesc())}\n'
f'has center at: {repr(zone.GetCenter())}\n')

# start the clone
to_net_name = tup[0][1]
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
2.1.2

0 comments on commit 7b8b3c6

Please sign in to comment.