mirror of https://github.com/VLSIDA/OpenRAM.git
power added to datasheet (finally)
This commit is contained in:
parent
374e7a31eb
commit
e131af2cc3
|
|
@ -507,7 +507,8 @@ class lib:
|
||||||
def parse_info(self,corner,lib_name):
|
def parse_info(self,corner,lib_name):
|
||||||
""" Copies important characterization data to datasheet.info to be added to datasheet """
|
""" Copies important characterization data to datasheet.info to be added to datasheet """
|
||||||
if OPTS.is_unit_test:
|
if OPTS.is_unit_test:
|
||||||
git_id = 'AAAAAAAAAAAAAAAAAAAA'
|
git_id = 'FFFFFFFFFFFFFFFFFFFF'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
with open(os.devnull, 'wb') as devnull:
|
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)
|
proc = subprocess.Popen(['git','rev-parse','HEAD'], cwd=os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/', stdout=subprocess.PIPE)
|
||||||
|
|
@ -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.write("END\n")
|
||||||
datasheet.close()
|
datasheet.close()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class datasheet():
|
||||||
# self.html += operating_conditions(self.operating,table_id='data').__html__()
|
# self.html += operating_conditions(self.operating,table_id='data').__html__()
|
||||||
self.html += self.operating_table.to_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 = ''
|
model = ''
|
||||||
if self.ANALYTICAL_MODEL:
|
if self.ANALYTICAL_MODEL:
|
||||||
model = "analytical model: results may not be percise"
|
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 += timing_and_current_data(self.timing,table_id='data').__html__()
|
||||||
self.html += self.timing_table.to_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 += '<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 += characterization_corners(self.corners,table_id='data').__html__()
|
||||||
self.html += self.corners_table.to_html()
|
self.html += self.corners_table.to_html()
|
||||||
|
|
|
||||||
|
|
@ -166,31 +166,31 @@ def parse_characterizer_csv(f, pages):
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+2]
|
item[2] = row[col+2]
|
||||||
|
|
||||||
col += 2
|
col += 2
|
||||||
|
|
||||||
col += 1
|
col += 1
|
||||||
|
|
||||||
|
|
@ -205,31 +205,31 @@ def parse_characterizer_csv(f, pages):
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+2]
|
item[2] = row[col+2]
|
||||||
|
|
||||||
col += 2
|
col += 2
|
||||||
|
|
||||||
col += 1
|
col += 1
|
||||||
|
|
||||||
|
|
@ -244,31 +244,31 @@ def parse_characterizer_csv(f, pages):
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+2]
|
item[2] = row[col+2]
|
||||||
|
|
||||||
col += 2
|
col += 2
|
||||||
|
|
||||||
col += 1
|
col += 1
|
||||||
|
|
||||||
|
|
@ -283,31 +283,31 @@ def parse_characterizer_csv(f, pages):
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+2]
|
item[2] = row[col+2]
|
||||||
|
|
||||||
col += 2
|
col += 2
|
||||||
|
|
||||||
col += 1
|
col += 1
|
||||||
|
|
||||||
|
|
@ -322,31 +322,31 @@ def parse_characterizer_csv(f, pages):
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+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]):
|
if float(row[col+1]) < float(item[1]):
|
||||||
item[1] = row[col+1]
|
item[1] = row[col+1]
|
||||||
if float(row[col+2]) > float(item[2]):
|
if float(row[col+2]) > float(item[2]):
|
||||||
item[2] = row[col+2]
|
item[2] = row[col+2]
|
||||||
|
|
||||||
col += 2
|
col += 2
|
||||||
|
|
||||||
col += 1
|
col += 1
|
||||||
|
|
||||||
|
|
@ -354,8 +354,35 @@ def parse_characterizer_csv(f, pages):
|
||||||
for element in row[col_start: col - 1]:
|
for element in row[col_start: col - 1]:
|
||||||
sheet.description.append(str(element))
|
sheet.description.append(str(element))
|
||||||
break
|
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(
|
new_sheet.dlv_table.add_row(
|
||||||
['.lib', 'Synthesis models', '<a href="file://{0}">{1}</a>'.format(LIB_NAME, LIB_NAME.replace(OUT_DIR, ''))])
|
['.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 = table_gen.table_gen("corners")
|
||||||
new_sheet.corners_table.add_row(
|
new_sheet.corners_table.add_row(
|
||||||
['Transistor Type', 'Power Supply', 'Temperature', 'Corner Name'])
|
['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(
|
new_sheet.operating_table = table_gen.table_gen(
|
||||||
"operating_table")
|
"operating_table")
|
||||||
new_sheet.operating_table.add_row(
|
new_sheet.operating_table.add_row(
|
||||||
|
|
@ -393,6 +421,9 @@ def parse_characterizer_csv(f, pages):
|
||||||
# failed to provide non-zero MIN_PERIOD
|
# failed to provide non-zero MIN_PERIOD
|
||||||
new_sheet.operating_table.add_row(
|
new_sheet.operating_table.add_row(
|
||||||
['Operating Frequency (F)', '', '', "not available in netlist only", 'MHz'])
|
['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 = table_gen.table_gen("timing")
|
||||||
new_sheet.timing_table.add_row(
|
new_sheet.timing_table.add_row(
|
||||||
['Parameter', 'Min', 'Max', 'Units'])
|
['Parameter', 'Min', 'Max', 'Units'])
|
||||||
|
|
@ -523,6 +554,32 @@ def parse_characterizer_csv(f, pages):
|
||||||
sheet.description.append(str(element))
|
sheet.description.append(str(element))
|
||||||
break
|
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 = table_gen.table_gen("dlv")
|
||||||
new_sheet.dlv_table.add_row(['Type', 'Description', 'Link'])
|
new_sheet.dlv_table.add_row(['Type', 'Description', 'Link'])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ num_w_ports = 0
|
||||||
tech_name = "scn4m_subm"
|
tech_name = "scn4m_subm"
|
||||||
process_corners = ["TT"]
|
process_corners = ["TT"]
|
||||||
supply_voltages = [5.0]
|
supply_voltages = [5.0]
|
||||||
temperatures = [25]
|
temperatures = [25,50]
|
||||||
|
|
||||||
output_path = "temp"
|
output_path = "temp"
|
||||||
output_name = "sram_1rw_1r_{0}_{1}_{2}".format(word_size,num_words,tech_name)
|
output_name = "sram_1rw_1r_{0}_{1}_{2}".format(word_size,num_words,tech_name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue