mirror of https://github.com/VLSIDA/OpenRAM.git
removed tabs and fixed bug in which datasheets generated without the characterizer running
This commit is contained in:
parent
49268b025f
commit
bc54bc238f
|
|
@ -64,7 +64,8 @@ s = sram(sram_config=c,
|
||||||
s.save()
|
s.save()
|
||||||
|
|
||||||
# generate datasheet from characterization of created SRAM
|
# generate datasheet from characterization of created SRAM
|
||||||
p = parser.parse(OPTS.openram_temp,os.environ.get('OPENRAM_HOME')+"/datasheets")
|
if not OPTS.analytical_delay:
|
||||||
|
p = parser.parse(OPTS.openram_temp,os.environ.get('OPENRAM_HOME')+"/datasheets")
|
||||||
|
|
||||||
# Delete temp files etc.
|
# Delete temp files etc.
|
||||||
end_openram()
|
end_openram()
|
||||||
|
|
|
||||||
|
|
@ -17,61 +17,61 @@ import contextlib
|
||||||
from globals import OPTS
|
from globals import OPTS
|
||||||
|
|
||||||
class deliverables(Table):
|
class deliverables(Table):
|
||||||
typ = Col('Type')
|
typ = Col('Type')
|
||||||
description = Col('Description')
|
description = Col('Description')
|
||||||
link = Col('Link')
|
link = Col('Link')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class deliverables_item(object):
|
class deliverables_item(object):
|
||||||
def __init__(self, typ, description,link):
|
def __init__(self, typ, description,link):
|
||||||
self.typ = typ
|
self.typ = typ
|
||||||
self.description = description
|
self.description = description
|
||||||
self.link = link
|
self.link = link
|
||||||
|
|
||||||
class operating_conditions(Table):
|
class operating_conditions(Table):
|
||||||
parameter = Col('Parameter')
|
parameter = Col('Parameter')
|
||||||
min = Col('Min')
|
min = Col('Min')
|
||||||
typ = Col('Typ')
|
typ = Col('Typ')
|
||||||
max = Col('Max')
|
max = Col('Max')
|
||||||
units = Col('Units')
|
units = Col('Units')
|
||||||
|
|
||||||
class operating_conditions_item(object):
|
class operating_conditions_item(object):
|
||||||
def __init__(self, parameter, min, typ, max, units):
|
def __init__(self, parameter, min, typ, max, units):
|
||||||
self.parameter = parameter
|
self.parameter = parameter
|
||||||
self.min = min
|
self.min = min
|
||||||
self.typ = typ
|
self.typ = typ
|
||||||
self.max = max
|
self.max = max
|
||||||
self.units = units
|
self.units = units
|
||||||
|
|
||||||
class timing_and_current_data(Table):
|
class timing_and_current_data(Table):
|
||||||
parameter = Col('Parameter')
|
parameter = Col('Parameter')
|
||||||
min = Col('Min')
|
min = Col('Min')
|
||||||
max = Col('Max')
|
max = Col('Max')
|
||||||
units = Col('Units')
|
units = Col('Units')
|
||||||
|
|
||||||
class timing_and_current_data_item(object):
|
class timing_and_current_data_item(object):
|
||||||
def __init__(self, parameter, min, max, units):
|
def __init__(self, parameter, min, max, units):
|
||||||
self.parameter = parameter
|
self.parameter = parameter
|
||||||
self.min = min
|
self.min = min
|
||||||
self.max = max
|
self.max = max
|
||||||
self.units = units
|
self.units = units
|
||||||
|
|
||||||
class characterization_corners(Table):
|
class characterization_corners(Table):
|
||||||
corner_name = Col('Corner Name')
|
corner_name = Col('Corner Name')
|
||||||
process = Col('Process')
|
process = Col('Process')
|
||||||
power_supply = Col('Power Supply')
|
power_supply = Col('Power Supply')
|
||||||
temperature = Col('Temperature')
|
temperature = Col('Temperature')
|
||||||
library_name_suffix = Col('Library Name Suffix')
|
library_name_suffix = Col('Library Name Suffix')
|
||||||
|
|
||||||
class characterization_corners_item(object):
|
class characterization_corners_item(object):
|
||||||
def __init__(self, corner_name, process, power_supply, temperature, library_name_suffix):
|
def __init__(self, corner_name, process, power_supply, temperature, library_name_suffix):
|
||||||
self.corner_name = corner_name
|
self.corner_name = corner_name
|
||||||
self.process = process
|
self.process = process
|
||||||
self.power_supply = power_supply
|
self.power_supply = power_supply
|
||||||
self.temperature = temperature
|
self.temperature = temperature
|
||||||
self.library_name_suffix = library_name_suffix
|
self.library_name_suffix = library_name_suffix
|
||||||
|
|
||||||
def process_name(corner):
|
def process_name(corner):
|
||||||
if corner == "TT":
|
if corner == "TT":
|
||||||
return "Typical - Typical"
|
return "Typical - Typical"
|
||||||
|
|
@ -81,12 +81,12 @@ def process_name(corner):
|
||||||
return "Fast - Fast"
|
return "Fast - Fast"
|
||||||
else:
|
else:
|
||||||
return "custom"
|
return "custom"
|
||||||
|
|
||||||
def parse_file(f,pages):
|
def parse_file(f,pages):
|
||||||
with open(f) as csv_file:
|
with open(f) as csv_file:
|
||||||
csv_reader = csv.reader(csv_file, delimiter=',')
|
csv_reader = csv.reader(csv_file, delimiter=',')
|
||||||
line_count = 0
|
line_count = 0
|
||||||
for row in csv_reader:
|
for row in csv_reader:
|
||||||
found = 0
|
found = 0
|
||||||
NAME = row[0]
|
NAME = row[0]
|
||||||
NUM_WORDS = row[1]
|
NUM_WORDS = row[1]
|
||||||
|
|
@ -102,14 +102,14 @@ def parse_file(f,pages):
|
||||||
OUT_DIR = row[11]
|
OUT_DIR = row[11]
|
||||||
LIB_NAME = row[12]
|
LIB_NAME = row[12]
|
||||||
for sheet in pages:
|
for sheet in pages:
|
||||||
|
|
||||||
|
|
||||||
if sheet.name == row[0]:
|
if sheet.name == row[0]:
|
||||||
found = 1
|
found = 1
|
||||||
#if the .lib information is for an existing datasheet compare timing data
|
#if the .lib information is for an existing datasheet compare timing data
|
||||||
|
|
||||||
for item in sheet.operating:
|
for item in sheet.operating:
|
||||||
|
|
||||||
if item.parameter == 'Operating Temperature':
|
if item.parameter == 'Operating Temperature':
|
||||||
if float(TEMP) > float(item.max):
|
if float(TEMP) > float(item.max):
|
||||||
item.typ = item.max
|
item.typ = item.max
|
||||||
|
|
@ -117,7 +117,7 @@ def parse_file(f,pages):
|
||||||
if float(TEMP) < float(item.min):
|
if float(TEMP) < float(item.min):
|
||||||
item.typ = item.min
|
item.typ = item.min
|
||||||
item.min = TEMP
|
item.min = TEMP
|
||||||
|
|
||||||
if item.parameter == 'Power supply (VDD) range':
|
if item.parameter == 'Power supply (VDD) range':
|
||||||
if float(VOLT) > float(item.max):
|
if float(VOLT) > float(item.max):
|
||||||
item.typ = item.max
|
item.typ = item.max
|
||||||
|
|
@ -125,36 +125,36 @@ def parse_file(f,pages):
|
||||||
if float(VOLT) < float(item.min):
|
if float(VOLT) < float(item.min):
|
||||||
item.typ = item.min
|
item.typ = item.min
|
||||||
item.min = VOLT
|
item.min = VOLT
|
||||||
|
|
||||||
if item.parameter == 'Operating Frequncy (F)':
|
if item.parameter == 'Operating Frequncy (F)':
|
||||||
if float(math.floor(1000/float(MIN_PERIOD)) < float(item.max)):
|
if float(math.floor(1000/float(MIN_PERIOD)) < float(item.max)):
|
||||||
item.max = str(math.floor(1000/float(MIN_PERIOD)))
|
item.max = str(math.floor(1000/float(MIN_PERIOD)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
new_sheet.corners.append(characterization_corners_item(PROC,process_name(PROC),VOLT,TEMP,LIB_NAME.replace(OUT_DIR,'').replace(NAME,'')))
|
new_sheet.corners.append(characterization_corners_item(PROC,process_name(PROC),VOLT,TEMP,LIB_NAME.replace(OUT_DIR,'').replace(NAME,'')))
|
||||||
new_sheet.dlv.append(deliverables_item('.lib','Synthesis models','<a href="file://{0}">{1}</a>'.format(LIB_NAME,LIB_NAME.replace(OUT_DIR,''))))
|
new_sheet.dlv.append(deliverables_item('.lib','Synthesis models','<a href="file://{0}">{1}</a>'.format(LIB_NAME,LIB_NAME.replace(OUT_DIR,''))))
|
||||||
|
|
||||||
if found == 0:
|
if found == 0:
|
||||||
new_sheet = datasheet(NAME)
|
new_sheet = datasheet(NAME)
|
||||||
pages.append(new_sheet)
|
pages.append(new_sheet)
|
||||||
|
|
||||||
new_sheet.corners.append(characterization_corners_item(PROC,process_name(PROC),VOLT,TEMP,LIB_NAME.replace(OUT_DIR,'').replace(NAME,'')))
|
new_sheet.corners.append(characterization_corners_item(PROC,process_name(PROC),VOLT,TEMP,LIB_NAME.replace(OUT_DIR,'').replace(NAME,'')))
|
||||||
|
|
||||||
new_sheet.operating.append(operating_conditions_item('Power supply (VDD) range',VOLT,VOLT,VOLT,'Volts'))
|
new_sheet.operating.append(operating_conditions_item('Power supply (VDD) range',VOLT,VOLT,VOLT,'Volts'))
|
||||||
new_sheet.operating.append(operating_conditions_item('Operating Temperature',TEMP,TEMP,TEMP,'Celsius'))
|
new_sheet.operating.append(operating_conditions_item('Operating Temperature',TEMP,TEMP,TEMP,'Celsius'))
|
||||||
new_sheet.operating.append(operating_conditions_item('Operating Frequency (F)','','',str(math.floor(1000/float(MIN_PERIOD))),'MHz'))
|
new_sheet.operating.append(operating_conditions_item('Operating Frequency (F)','','',str(math.floor(1000/float(MIN_PERIOD))),'MHz'))
|
||||||
|
|
||||||
new_sheet.timing.append(timing_and_current_data_item('1','2','3','4'))
|
new_sheet.timing.append(timing_and_current_data_item('1','2','3','4'))
|
||||||
|
|
||||||
new_sheet.dlv.append(deliverables_item('.sp','SPICE netlists','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'sp')))
|
new_sheet.dlv.append(deliverables_item('.sp','SPICE netlists','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'sp')))
|
||||||
new_sheet.dlv.append(deliverables_item('.v','Verilog simulation models','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'v')))
|
new_sheet.dlv.append(deliverables_item('.v','Verilog simulation models','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'v')))
|
||||||
new_sheet.dlv.append(deliverables_item('.gds','GDSII layout views','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'gds')))
|
new_sheet.dlv.append(deliverables_item('.gds','GDSII layout views','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'gds')))
|
||||||
new_sheet.dlv.append(deliverables_item('.lef','LEF files','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'lef')))
|
new_sheet.dlv.append(deliverables_item('.lef','LEF files','<a href="file://{0}{1}.{2}">{1}.{2}</a>'.format(OUT_DIR,NAME,'lef')))
|
||||||
new_sheet.dlv.append(deliverables_item('.lib','Synthesis models','<a href="file://{0}">{1}</a>'.format(LIB_NAME,LIB_NAME.replace(OUT_DIR,''))))
|
new_sheet.dlv.append(deliverables_item('.lib','Synthesis models','<a href="file://{0}">{1}</a>'.format(LIB_NAME,LIB_NAME.replace(OUT_DIR,''))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class datasheet():
|
class datasheet():
|
||||||
|
|
||||||
def __init__(self,identifier):
|
def __init__(self,identifier):
|
||||||
|
|
@ -163,7 +163,7 @@ class datasheet():
|
||||||
self.operating = []
|
self.operating = []
|
||||||
self.dlv = []
|
self.dlv = []
|
||||||
self.name = identifier
|
self.name = identifier
|
||||||
|
|
||||||
def print(self):
|
def print(self):
|
||||||
print("""<style>
|
print("""<style>
|
||||||
#data {
|
#data {
|
||||||
|
|
@ -197,40 +197,27 @@ class datasheet():
|
||||||
print(operating_conditions(self.operating,table_id='data').__html__())
|
print(operating_conditions(self.operating,table_id='data').__html__())
|
||||||
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Timing and Current Data</p>')
|
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Timing and Current Data</p>')
|
||||||
print(timing_and_current_data(self.timing,table_id='data').__html__())
|
print(timing_and_current_data(self.timing,table_id='data').__html__())
|
||||||
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Characterization Corners</p>')
|
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Characterization Corners</p>')
|
||||||
print(characterization_corners(self.corners,table_id='data').__html__())
|
print(characterization_corners(self.corners,table_id='data').__html__())
|
||||||
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Deliverables</p>')
|
print('<p style=font-size: 20px;font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;>Deliverables</p>')
|
||||||
print(deliverables(self.dlv,table_id='data').__html__().replace('<','<').replace('"','"').replace('>',">"))
|
print(deliverables(self.dlv,table_id='data').__html__().replace('<','<').replace('"','"').replace('>',">"))
|
||||||
|
|
||||||
|
|
||||||
class parse():
|
class parse():
|
||||||
def __init__(self,in_dir,out_dir):
|
def __init__(self,in_dir,out_dir):
|
||||||
|
|
||||||
if not (os.path.isdir(in_dir)):
|
if not (os.path.isdir(in_dir)):
|
||||||
os.mkdir(in_dir)
|
os.mkdir(in_dir)
|
||||||
|
|
||||||
if not (os.path.isdir(out_dir)):
|
if not (os.path.isdir(out_dir)):
|
||||||
os.mkdir(out_dir)
|
os.mkdir(out_dir)
|
||||||
|
|
||||||
datasheets = []
|
datasheets = []
|
||||||
parse_file(in_dir + "/datasheet.info", datasheets)
|
parse_file(in_dir + "/datasheet.info", datasheets)
|
||||||
|
|
||||||
|
|
||||||
for sheets in datasheets:
|
for sheets in datasheets:
|
||||||
print (out_dir + sheets.name + ".html")
|
print (out_dir + sheets.name + ".html")
|
||||||
with open(out_dir + "/" + sheets.name + ".html", 'w+') as f:
|
with open(out_dir + "/" + sheets.name + ".html", 'w+') as f:
|
||||||
with contextlib.redirect_stdout(f):
|
with contextlib.redirect_stdout(f):
|
||||||
sheets.print()
|
sheets.print()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,10 @@ class openram_test(openram_test):
|
||||||
files = glob.glob('{0}/*.lib'.format(out_path))
|
files = glob.glob('{0}/*.lib'.format(out_path))
|
||||||
self.assertTrue(len(files)>0)
|
self.assertTrue(len(files)>0)
|
||||||
|
|
||||||
# Make sure there is any .html file
|
# Make sure there is any .html file if characterizer was ran
|
||||||
datasheets = glob.glob('{0}/{1}/*html'.format(OPENRAM_HOME,datasheets))
|
if not OPTS.analytical_delay:
|
||||||
self.assertTrue(len(datasheets)>0)
|
datasheets = glob.glob('{0}/{1}/*html'.format(OPENRAM_HOME,'datasheets'))
|
||||||
|
self.assertTrue(len(datasheets)>0)
|
||||||
|
|
||||||
# grep any errors from the output
|
# grep any errors from the output
|
||||||
output_log = open("{0}/output.log".format(out_path),"r")
|
output_log = open("{0}/output.log".format(out_path),"r")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue