power added to datasheet (finally)

This commit is contained in:
Jesse Cirimelli-Low 2019-02-06 20:31:22 -08:00
parent 374e7a31eb
commit e131af2cc3
4 changed files with 136 additions and 42 deletions

View File

@ -507,7 +507,8 @@ class lib:
def parse_info(self,corner,lib_name):
""" Copies important characterization data to datasheet.info to be added to datasheet """
if OPTS.is_unit_test:
git_id = 'AAAAAAAAAAAAAAAAAAAA'
git_id = 'FFFFFFFFFFFFFFFFFFFF'
else:
with open(os.devnull, 'wb') as devnull:
proc = subprocess.Popen(['git','rev-parse','HEAD'], cwd=os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/', stdout=subprocess.PIPE)
@ -524,7 +525,7 @@ class lib:
git_id = 'Failed to retruieve'
datasheet = open(OPTS.openram_temp +'/datasheet.info', 'a+')
current_time = datetime.date.today()
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},".format(
OPTS.output_name,
@ -654,8 +655,41 @@ class lib:
))
for port in self.all_ports:
name = ''
read_write = ''
if port in self.read_ports:
web_name = " & !WEb{0}".format(port)
name = "!CSb{0} & clk{0}{1}".format(port, web_name)
read_write = 'Read'
datasheet.write("{0},{1},{2},{3},".format(
"power",
name,
read_write,
np.mean(self.char_port_results[port]["read1_power"] + self.char_port_results[port]["read0_power"])/2
))
if port in self.write_ports:
web_name = " & WEb{0}".format(port)
name = "!CSb{0} & !clk{0}{1}".format(port, web_name)
read_write = 'Write'
datasheet.write("{0},{1},{2},{3},".format(
'power',
name,
read_write,
np.mean(self.char_port_results[port]["write1_power"] + self.char_port_results[port]["write0_power"])/2
))
control_str = 'CSb0'
for i in range(1, self.total_port_num):
control_str += ' & CSb{0}'.format(i)
datasheet.write("{0},{1},{2},".format('leak', control_str, self.char_sram_results["leakage_power"]))
datasheet.write("END\n")
datasheet.close()

View File

@ -58,7 +58,7 @@ class datasheet():
# self.html += operating_conditions(self.operating,table_id='data').__html__()
self.html += self.operating_table.to_html()
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Timing and Current Data</p>'
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Timing Data</p>'
model = ''
if self.ANALYTICAL_MODEL:
model = "analytical model: results may not be percise"
@ -68,6 +68,9 @@ class datasheet():
# self.html += timing_and_current_data(self.timing,table_id='data').__html__()
self.html += self.timing_table.to_html()
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Power Data</p>'
self.html += self.power_table.to_html()
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Characterization Corners</p>'
# self.html += characterization_corners(self.corners,table_id='data').__html__()
self.html += self.corners_table.to_html()

View File

@ -166,31 +166,31 @@ def parse_characterizer_csv(f, pages):
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('setup falling'):
if item[0].endswith('setup falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold rising'):
if item[0].endswith('hold rising'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold falling'):
if item[0].endswith('hold falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
col += 1
@ -205,31 +205,31 @@ def parse_characterizer_csv(f, pages):
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('cell fall'):
if item[0].endswith('cell fall'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('rise transition'):
if item[0].endswith('rise transition'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('fall transition'):
if item[0].endswith('fall transition'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
col += 1
@ -244,31 +244,31 @@ def parse_characterizer_csv(f, pages):
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('setup falling'):
if item[0].endswith('setup falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold rising'):
if item[0].endswith('hold rising'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold falling'):
if item[0].endswith('hold falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
col += 1
@ -283,31 +283,31 @@ def parse_characterizer_csv(f, pages):
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('setup falling'):
if item[0].endswith('setup falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold rising'):
if item[0].endswith('hold rising'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold falling'):
if item[0].endswith('hold falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
col += 1
@ -322,31 +322,31 @@ def parse_characterizer_csv(f, pages):
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('setup falling'):
if item[0].endswith('setup falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold rising'):
if item[0].endswith('hold rising'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
elif item[0].endswith('hold falling'):
if item[0].endswith('hold falling'):
if float(row[col+1]) < float(item[1]):
item[1] = row[col+1]
if float(row[col+2]) > float(item[2]):
item[2] = row[col+2]
col += 2
col += 2
col += 1
@ -354,8 +354,35 @@ def parse_characterizer_csv(f, pages):
for element in row[col_start: col - 1]:
sheet.description.append(str(element))
break
while(True):
col_start = col
if row[col] == 'power':
for item in sheet.power_table.rows:
if item[0].startswith(row[col+1]):
if item[2].startswith('{0} Rising'.format(row[col+2])):
if float(item[2]) < float(row[col+3]):
item[2] = row[col+3]
if item[2].startswith('{0} Falling'.format(row[col+2])):
if float(item[2]) < float(row[col+3]):
item[2] = row[col+3]
col += 4
else:
break
new_sheet.corners_table.add_row([PROC, VOLT, TEMP, LIB_NAME.replace(OUT_DIR, '').replace(NAME, '')])
while(True):
col_start = col
if row[col] == 'leak':
for item in sheet.power_table.rows:
if item[0].startswith(row[col+1]):
if float(item[2]) < float(row[col+2]):
item[2] = row[col+2]
col += 3
else:
break
new_sheet.corners_table.add_row(
[PROC, VOLT, TEMP, LIB_NAME.replace(OUT_DIR, '').replace(NAME, '')])
new_sheet.dlv_table.add_row(
['.lib', 'Synthesis models', '<a href="file://{0}">{1}</a>'.format(LIB_NAME, LIB_NAME.replace(OUT_DIR, ''))])
@ -376,7 +403,8 @@ def parse_characterizer_csv(f, pages):
new_sheet.corners_table = table_gen.table_gen("corners")
new_sheet.corners_table.add_row(
['Transistor Type', 'Power Supply', 'Temperature', 'Corner Name'])
new_sheet.corners_table.add_row([PROC, VOLT, TEMP, LIB_NAME.replace(OUT_DIR, '').replace(NAME, '')])
new_sheet.corners_table.add_row(
[PROC, VOLT, TEMP, LIB_NAME.replace(OUT_DIR, '').replace(NAME, '')])
new_sheet.operating_table = table_gen.table_gen(
"operating_table")
new_sheet.operating_table.add_row(
@ -393,6 +421,9 @@ def parse_characterizer_csv(f, pages):
# failed to provide non-zero MIN_PERIOD
new_sheet.operating_table.add_row(
['Operating Frequency (F)', '', '', "not available in netlist only", 'MHz'])
new_sheet.power_table = table_gen.table_gen("power")
new_sheet.power_table.add_row(
['Pins', 'Mode', 'Power', 'Units'])
new_sheet.timing_table = table_gen.table_gen("timing")
new_sheet.timing_table.add_row(
['Parameter', 'Min', 'Max', 'Units'])
@ -523,6 +554,32 @@ def parse_characterizer_csv(f, pages):
sheet.description.append(str(element))
break
while(True):
start = col
if(row[col].startswith('power')):
new_sheet.power_table.add_row([row[col+1],
'{0} Rising'.format(
row[col+2]),
row[col+3][0:6],
'mW']
)
new_sheet.power_table.add_row([row[col+1],
'{0} Falling'.format(
row[col+2]),
row[col+3][0:6],
'mW']
)
col += 4
elif(row[col].startswith('leak')):
new_sheet.power_table.add_row(
[row[col+1], 'leakage', row[col+2], 'mW'])
col += 3
else:
break
new_sheet.dlv_table = table_gen.table_gen("dlv")
new_sheet.dlv_table.add_row(['Type', 'Description', 'Link'])

View File

@ -10,7 +10,7 @@ num_w_ports = 0
tech_name = "scn4m_subm"
process_corners = ["TT"]
supply_voltages = [5.0]
temperatures = [25]
temperatures = [25,50]
output_path = "temp"
output_name = "sram_1rw_1r_{0}_{1}_{2}".format(word_size,num_words,tech_name)