Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,14 @@ def get_args() -> argparse.Namespace:
return parser.parse_args()


def get_memory_type(json_data):
if "memory_type" in json_data:
return json_data["memory_type"]
return "RAM"


def get_port_config(json_data):
if "port_configuration" in json_data:
return json_data["port_configuration"]
return "SP"


def main(args: argparse.Namespace):
json_data = RunUtils.get_config(args.config)
# Create a process object (shared by all srams)
process = Process(json_data)
timing_data = TimingData(json_data)

memory_type = get_memory_type(json_data)
port_config = get_port_config(json_data)
memory_type = json_data.get("memory_type", "RAM")
port_config = json_data.get("port_configuration", "SP")

# Go through each sram and generate the lib, lef and v files
for sram_data in json_data["srams"]:
Expand Down
7 changes: 2 additions & 5 deletions utils/class_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ def __init__(self, json_data):
+ (self.pin_width_um / 2.0)
)

if "bitcell_width_um" in json_data and "bitcell_height_um" in json_data:
self.bitcell_width_um = float(json_data["bitcell_width_um"])
self.bitcell_height_um = float(json_data["bitcell_height_um"])
else:
self.bitcell_width_um = self.bitcell_height_um = None
self.bitcell_width_um = json_data.get("bitcell_width_um", None)
self.bitcell_height_um = json_data.get("bitcell_height_um", None)
Comment on lines +66 to +67
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to do 'float' on the value and now doesn't. Is that ok?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the original implementation didn't trust the types coming in from JSON, so I was going with that. But, I've only entered floats for these values in the config, so felt it was OK


def has_defined_bitcell_size(self):
return self.bitcell_width_um and self.bitcell_height_um
Expand Down
Loading