mirror of https://github.com/VLSIDA/OpenRAM.git
Fixed input scaling bugs delay prediction model
This commit is contained in:
parent
77d7e3b1cf
commit
8a75b83889
|
|
@ -585,11 +585,14 @@ class lib:
|
||||||
def compute_delay(self):
|
def compute_delay(self):
|
||||||
"""Compute SRAM delays for current corner"""
|
"""Compute SRAM delays for current corner"""
|
||||||
if self.use_model:
|
if self.use_model:
|
||||||
|
import math
|
||||||
#FIXME: ML models only designed for delay. Cannot produce all values for Lib
|
#FIXME: ML models only designed for delay. Cannot produce all values for Lib
|
||||||
d = linear_regression()
|
d = linear_regression()
|
||||||
model_inputs = [OPTS.num_words,
|
temp_wpr = 2.0 #OPTS not working right now
|
||||||
|
log_num_words = math.log(OPTS.num_words, 2)
|
||||||
|
model_inputs = [log_num_words,
|
||||||
OPTS.word_size,
|
OPTS.word_size,
|
||||||
OPTS.words_per_row,
|
temp_wpr,
|
||||||
self.sram.width * self.sram.height]
|
self.sram.width * self.sram.height]
|
||||||
char_results = d.get_prediction(model_inputs)
|
char_results = d.get_prediction(model_inputs)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,12 @@ class linear_regression():
|
||||||
|
|
||||||
def get_prediction(self, model_inputs):
|
def get_prediction(self, model_inputs):
|
||||||
|
|
||||||
train_sets = []
|
|
||||||
test_sets = []
|
|
||||||
|
|
||||||
file_path = data_dir +'/'+data_filename
|
file_path = data_dir +'/'+data_filename
|
||||||
scaled_inputs = np.asarray(scale_input_datapoint(model_inputs, data_dir))
|
scaled_inputs = np.asarray([scale_input_datapoint(model_inputs, data_dir)])
|
||||||
|
|
||||||
features, labels = get_scaled_data(file_path, data_dir)
|
features, labels = get_scaled_data(file_path, data_dir)
|
||||||
self.train_model(features, labels)
|
self.train_model(features, labels)
|
||||||
scaled_pred = model_prediction(model_inputs)
|
scaled_pred = self.model_prediction(scaled_inputs)
|
||||||
pred = unscale_data(scaled_pred.tolist(), data_dir)
|
pred = unscale_data(scaled_pred.tolist(), data_dir)
|
||||||
debug.info(1,"Unscaled Prediction = {}".format(pred))
|
debug.info(1,"Unscaled Prediction = {}".format(pred))
|
||||||
return pred
|
return pred
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue