Commit db33a447 by Dinple

bug fixes

parent 5a2817ef
...@@ -9,7 +9,6 @@ from collections import namedtuple ...@@ -9,7 +9,6 @@ from collections import namedtuple
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle from matplotlib.patches import Rectangle
import numpy as np import numpy as np
from optax import smooth_labels
"""plc_client_os docstrings. """plc_client_os docstrings.
...@@ -354,9 +353,9 @@ class PlacementCost(object): ...@@ -354,9 +353,9 @@ class PlacementCost(object):
# node information # node information
_hard_macros_cnt = 0 _hard_macros_cnt = 0
_hard_macro_pins_cnt = 0 _hard_macro_pins_cnt = 0
_macro_cnt = 0 _macros_cnt = 0
_macro_pin_cnt = 0 _macro_pin_cnt = 0
_port_cnt = 0 _ports_cnt = 0
_soft_macros_cnt = 0 _soft_macros_cnt = 0
_soft_macro_pins_cnt = 0 _soft_macro_pins_cnt = 0
_stdcells_cnt = 0 _stdcells_cnt = 0
...@@ -377,11 +376,9 @@ class PlacementCost(object): ...@@ -377,11 +376,9 @@ class PlacementCost(object):
if 'Columns' in line_item and 'Rows' in line_item: if 'Columns' in line_item and 'Rows' in line_item:
# Columns and Rows should be defined on the same one-line # Columns and Rows should be defined on the same one-line
print("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH")
_columns = int(line_item[1]) _columns = int(line_item[1])
_rows = int(line_item[3]) _rows = int(line_item[3])
elif "Area" in line_item: elif "Area" in line_item:
print("WTFFFFFFFFFf")
# Total core area of modules # Total core area of modules
_area = float(line_item[1]) _area = float(line_item[1])
elif "Block" in line_item: elif "Block" in line_item:
...@@ -389,7 +386,6 @@ class PlacementCost(object): ...@@ -389,7 +386,6 @@ class PlacementCost(object):
_block = str(line_item[1]) _block = str(line_item[1])
elif all(it in line_item for it in\ elif all(it in line_item for it in\
['Routes', 'per', 'micron', 'hor', 'ver']): ['Routes', 'per', 'micron', 'hor', 'ver']):
print("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH")
# For routing congestion computation # For routing congestion computation
_routes_per_micron_hor = float(line_item[4]) _routes_per_micron_hor = float(line_item[4])
_routes_per_micron_ver = float(line_item[6]) _routes_per_micron_ver = float(line_item[6])
...@@ -412,13 +408,13 @@ class PlacementCost(object): ...@@ -412,13 +408,13 @@ class PlacementCost(object):
_hard_macro_pins_cnt = int(line_item[3]) _hard_macro_pins_cnt = int(line_item[3])
elif all(it in line_item for it in ['PORTs'])\ elif all(it in line_item for it in ['PORTs'])\
and len(line_item) == 2: and len(line_item) == 2:
_port_cnt = int(line_item[1]) _ports_cnt = int(line_item[1])
elif all(it in line_item for it in ['SOFT', 'MACROs'])\ elif all(it in line_item for it in ['SOFT', 'MACROs'])\
and len(line_item) == 3: and len(line_item) == 3:
_soft_macros_cnt = int(line_item[2]) _soft_macros_cnt = int(line_item[2])
elif all(it in line_item for it in ['SOFT', 'MACRO', 'PINs'])\ elif all(it in line_item for it in ['SOFT', 'MACRO', 'PINs'])\
and len(line_item) == 4: and len(line_item) == 4:
_soft_macros_pin_cnt = int(line_item[3]) _soft_macro_pins_cnt = int(line_item[3])
elif all(it in line_item for it in ['STDCELLs'])\ elif all(it in line_item for it in ['STDCELLs'])\
and len(line_item) == 2: and len(line_item) == 2:
_stdcells_cnt = int(line_item[1]) _stdcells_cnt = int(line_item[1])
...@@ -444,9 +440,9 @@ class PlacementCost(object): ...@@ -444,9 +440,9 @@ class PlacementCost(object):
"overlap_threshold":_overlap_threshold, "overlap_threshold":_overlap_threshold,
"hard_macros_cnt":_hard_macros_cnt, "hard_macros_cnt":_hard_macros_cnt,
"hard_macro_pins_cnt":_hard_macro_pins_cnt, "hard_macro_pins_cnt":_hard_macro_pins_cnt,
"macro_cnt":_macro_cnt, "macros_cnt":_macros_cnt,
"macro_pin_cnt":_macro_pin_cnt, "macro_pin_cnt":_macro_pin_cnt,
"port_cnt":_port_cnt, "ports_cnt":_ports_cnt,
"soft_macros_cnt":_soft_macros_cnt, "soft_macros_cnt":_soft_macros_cnt,
"soft_macro_pins_cnt":_soft_macro_pins_cnt, "soft_macro_pins_cnt":_soft_macro_pins_cnt,
"stdcells_cnt":_stdcells_cnt, "stdcells_cnt":_stdcells_cnt,
...@@ -470,7 +466,6 @@ class PlacementCost(object): ...@@ -470,7 +466,6 @@ class PlacementCost(object):
# validate netlist.pb.txt is on par with .plc # validate netlist.pb.txt is on par with .plc
if ifValidate: if ifValidate:
print(self.hard_macro_cnt, info_dict['hard_macros_cnt'])
assert(self.hard_macro_cnt == info_dict['hard_macros_cnt']) assert(self.hard_macro_cnt == info_dict['hard_macros_cnt'])
assert(self.hard_macro_pin_cnt == info_dict['hard_macro_pins_cnt']) assert(self.hard_macro_pin_cnt == info_dict['hard_macro_pins_cnt'])
assert(self.soft_macro_cnt == info_dict['soft_macros_cnt']) assert(self.soft_macro_cnt == info_dict['soft_macros_cnt'])
......
...@@ -18,7 +18,7 @@ Test Utility Class for Google's API plc_wrapper_main with plc_client.py and plc_ ...@@ -18,7 +18,7 @@ Test Utility Class for Google's API plc_wrapper_main with plc_client.py and plc_
Example: Example:
At ./MacroPlacement/CodeElement, run the following command: At ./MacroPlacement/CodeElement, run the following command:
$ python -m Plc_client.plc_client_os_test $ python -m Plc_client.plc_client_os_test [NETLIST_PATH] [PLC_PATH]
Todo: Todo:
* Clean up code * Clean up code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment