Removed area as an input feature to regression model

This commit is contained in:
Hunter Nichols 2021-02-10 14:20:38 -08:00
parent f81c1ee4fc
commit 4700f14e82
2 changed files with 15 additions and 7 deletions

View File

@ -35,24 +35,31 @@ def get_data(file_name):
with open(file_name, newline='') as csvfile:
csv_reader = csv.reader(csvfile, delimiter=' ', quotechar='|')
row_iter = 0
removed_items = 1
for row in csv_reader:
row_iter += 1
if row_iter == 1:
feature_names = row[0].split(',')
input_list = [[] for _ in feature_names]
scaled_list = [[] for _ in feature_names]
input_list = [[] for _ in range(len(feature_names)-removed_items)]
scaled_list = [[] for _ in range(len(feature_names)-removed_items)]
# Save to remove area
area_ind = feature_names.index('area')
try:
process_ind = feature_names.index('process')
except:
debug.error('Process not included as a feature.')
continue
data = []
split_str = row[0].split(',')
for i in range(len(split_str)):
if i == process_ind:
data.append(process_transform[split_str[i]])
elif i == area_ind:
continue
else:
data.append(float(split_str[i]))

View File

@ -57,10 +57,11 @@ class regression_model(simulation):
model_inputs = [log_num_words,
OPTS.word_size,
OPTS.words_per_row,
self.sram.width * self.sram.height,
process_transform[self.process],
self.vdd_voltage,
self.temperature]
# Area removed for now
# self.sram.width * self.sram.height,
self.create_measurement_names()
models = self.train_models()
@ -92,10 +93,10 @@ class regression_model(simulation):
port_data[port]['disabled_read0_power'].append(sram_vals['read0_power'])
debug.info(1, '{}, {}, {}, {}, {}'.format(slew,
load,
port,
sram_vals['delay_lh'],
sram_vals['slew_lh']))
load,
port,
sram_vals['delay_lh'],
sram_vals['slew_lh']))
# Estimate the period as double the delay with margin
period_margin = 0.1
sram_data = {"min_period": sram_vals['delay_lh'] * 2,