From 3e0a49e58d69eb8f7826bd30b129022145b07eff Mon Sep 17 00:00:00 2001 From: Hunter Nichols Date: Sun, 25 Jul 2021 22:28:23 -0700 Subject: [PATCH] Added options for the model type in timing graph (cacti or elmore) --- compiler/base/timing_graph.py | 25 +++++++++++++++++++++---- compiler/characterizer/cacti.py | 2 ++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/compiler/base/timing_graph.py b/compiler/base/timing_graph.py index f91d3d6e..8f10a39f 100644 --- a/compiler/base/timing_graph.py +++ b/compiler/base/timing_graph.py @@ -92,7 +92,7 @@ class timing_graph(): path.pop() visited.remove(cur_node) - def get_timing(self, path, corner, slew, load, cacti_params): + def get_timing(self, path, corner, slew, load, params): """Returns the analytical delays in the input path""" if len(path) == 0: @@ -108,14 +108,31 @@ class timing_graph(): cout = 0 for node in self.graph[path[i + 1]]: output_edge_mod = self.edge_mods[(path[i + 1], node)] + if params["model_name"] == "cacti": + cout+=output_edge_mod.get_input_capacitance() + elif params["model_name"] == "elmore": + cout+=output_edge_mod.get_cin() + else: + debug.error("Undefined model_name for analytical timing: {}".format(params["model_name"]), + return_value=1) #cout+=output_edge_mod.get_cin() # logical effort based CIN - cout+=output_edge_mod.get_input_capacitance() + #cout+=output_edge_mod.get_input_capacitance() #cacti called from module + #func = cacti_params["cin_function"] + #cout+=output_edge_mod.func() # If at the last output, include the final output load if i == len(path) - 2: cout += load - + + if params["model_name"] == "cacti": + delays.append(path_edge_mod.cacti_delay(corner, cur_slew, cout, params)) + elif params["model_name"] == "elmore": + delays.append(path_edge_mod.analytical_delay(corner, cur_slew, cout)) + else: + debug.error("Undefined model_name for analytical timing: {}".format(params["model_name"]), + return_value=1) #delays.append(path_edge_mod.analytical_delay(corner, cur_slew, cout)) - delays.append(path_edge_mod.cacti_delay(corner, cur_slew, cout, cacti_params)) + #delays.append(path_edge_mod.cacti_delay(corner, cur_slew, cout, cacti_params)) + #delays.append(path_edge_mod.cacti_params["delay_function"](corner, cur_slew, cout, cacti_params)) cur_slew = delays[-1].slew return delays diff --git a/compiler/characterizer/cacti.py b/compiler/characterizer/cacti.py index e4601515..b5da3213 100644 --- a/compiler/characterizer/cacti.py +++ b/compiler/characterizer/cacti.py @@ -37,6 +37,8 @@ class cacti(simulation): def set_params(self): """Set parameters specific to the corner being simulated""" self.params = {} + # Set the specific functions to use for timing defined in the SRAM module + self.params["model_name"] = OPTS.model_name # Only parameter right now is r_on which is dependent on Vdd self.params["r_nch_on"] = self.vdd_voltage / tech.spice["i_on_n"] self.params["r_pch_on"] = self.vdd_voltage / tech.spice["i_on_p"]