2019-04-26 12:21:50 -07:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2023-01-28 22:56:27 -08:00
|
|
|
# Copyright (c) 2016-2023 Regents of the University of California and The Board
|
2019-06-14 08:43:41 -07:00
|
|
|
# of Regents for the Oklahoma Agricultural and Mechanical College
|
|
|
|
|
# (acting for and on behalf of Oklahoma State University)
|
|
|
|
|
# All rights reserved.
|
2019-04-26 12:21:50 -07:00
|
|
|
#
|
2018-10-17 19:27:09 -07:00
|
|
|
import os
|
2018-12-06 10:13:28 -08:00
|
|
|
import base64
|
2022-11-27 13:01:20 -08:00
|
|
|
from openram import OPTS
|
|
|
|
|
from .table_gen import *
|
2018-10-11 16:03:05 -07:00
|
|
|
|
2019-01-15 19:47:48 -08:00
|
|
|
|
2018-10-11 16:03:05 -07:00
|
|
|
class datasheet():
|
2018-10-30 21:37:30 -07:00
|
|
|
"""
|
|
|
|
|
Defines the layout,but not the data, of the html datasheet
|
|
|
|
|
"""
|
2019-01-15 19:47:48 -08:00
|
|
|
|
|
|
|
|
def __init__(self, identifier):
|
2018-10-11 16:03:05 -07:00
|
|
|
self.name = identifier
|
|
|
|
|
self.html = ""
|
|
|
|
|
|
|
|
|
|
def generate_html(self):
|
2018-10-30 21:37:30 -07:00
|
|
|
"""
|
|
|
|
|
Generates html tables using flask-table
|
|
|
|
|
"""
|
2018-10-20 14:13:18 -07:00
|
|
|
with open(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/datasheet/assets/datasheet.css', 'r') as datasheet_css:
|
2019-01-15 19:47:48 -08:00
|
|
|
# css styling is kept in a seperate file
|
2018-10-20 14:13:18 -07:00
|
|
|
self.html += datasheet_css.read()
|
2018-10-31 12:29:13 -07:00
|
|
|
|
2021-01-06 12:45:34 -08:00
|
|
|
if OPTS.output_datasheet_info:
|
|
|
|
|
datasheet_path = OPTS.output_path
|
|
|
|
|
else:
|
2022-07-22 19:52:38 +03:00
|
|
|
datasheet_path = OPTS.openram_temp
|
2021-01-06 12:45:34 -08:00
|
|
|
with open(datasheet_path + "/datasheet.info") as info:
|
2018-11-13 17:29:43 -08:00
|
|
|
self.html += '<!--'
|
2019-01-15 20:48:20 -08:00
|
|
|
for row in info:
|
|
|
|
|
self.html += row
|
|
|
|
|
# for item in self.description:
|
|
|
|
|
# self.html += item + ','
|
2019-01-15 19:47:48 -08:00
|
|
|
self.html += '-->'
|
2019-02-07 06:33:39 -08:00
|
|
|
# Add vlsida logo
|
2018-12-06 10:13:28 -08:00
|
|
|
vlsi_logo = 0
|
2019-01-15 19:47:48 -08:00
|
|
|
with open(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/datasheet/assets/vlsi_logo.png', "rb") as image_file:
|
2018-12-06 10:13:28 -08:00
|
|
|
vlsi_logo = base64.b64encode(image_file.read())
|
2018-10-17 19:27:09 -07:00
|
|
|
|
2019-02-07 06:33:39 -08:00
|
|
|
# Add openram logo
|
2018-12-06 10:13:28 -08:00
|
|
|
openram_logo = 0
|
2019-02-25 07:46:34 -08:00
|
|
|
with open(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/datasheet/assets/OpenRAM_logo.png', "rb") as image_file:
|
2018-12-06 10:13:28 -08:00
|
|
|
openram_logo = base64.b64encode(image_file.read())
|
|
|
|
|
|
2019-03-06 20:59:52 -08:00
|
|
|
#comment table rows which we may want to enable after compile time
|
|
|
|
|
comments = ['.db']
|
|
|
|
|
|
2019-02-25 07:46:34 -08:00
|
|
|
self.html += '<a href="https://vlsida.soe.ucsc.edu/"><img src="data:image/png;base64,{0}" alt="VLSIDA"></a><a href ="https://github.com/VLSIDA/OpenRAM"><img src ="data:image/png;base64,{1}" alt = "OpenRAM"></a>'.format(str(vlsi_logo)[2:-1], str(openram_logo)[2:-1])
|
2018-12-06 10:13:28 -08:00
|
|
|
|
2019-01-15 19:47:48 -08:00
|
|
|
self.html += '<p style="font-size: 18px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">' + \
|
|
|
|
|
self.name + '.html' + '</p>'
|
|
|
|
|
self.html += '<p style="font-size: 18px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Compiled at: ' + self.time + '</p>'
|
|
|
|
|
self.html += '<p style="font-size: 18px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">' + \
|
|
|
|
|
'DRC errors: ' + str(self.DRC) + '</p>'
|
|
|
|
|
self.html += '<p style="font-size: 18px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">' + \
|
|
|
|
|
'LVS errors: ' + str(self.LVS) + '</p>'
|
|
|
|
|
self.html += '<p style="font-size: 18px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">' + \
|
|
|
|
|
'Git commit id: ' + str(self.git_id) + '</p>'
|
2019-02-07 06:33:39 -08:00
|
|
|
# print port table
|
2019-01-15 19:47:48 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Ports and Configuration</p>'
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.io_table.to_html(comments)
|
2019-02-25 07:46:34 -08:00
|
|
|
|
2019-02-07 06:33:39 -08:00
|
|
|
# print operating condidition information
|
2019-01-15 19:47:48 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Operating Conditions</p>'
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.operating_table.to_html(comments)
|
2018-10-17 19:27:09 -07:00
|
|
|
|
2019-02-07 06:33:39 -08:00
|
|
|
# check if analytical model is being used
|
2019-02-06 20:31:22 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Timing Data</p>'
|
2019-01-31 08:28:51 -08:00
|
|
|
model = ''
|
2019-02-22 08:19:54 -08:00
|
|
|
if self.ANALYTICAL_MODEL == 'True':
|
2019-02-22 06:46:28 -08:00
|
|
|
model = "analytical model: results may not be precise"
|
2019-01-31 08:28:51 -08:00
|
|
|
else:
|
|
|
|
|
model = "spice characterizer"
|
2019-02-07 06:33:39 -08:00
|
|
|
# display timing data
|
2019-01-31 08:28:51 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Using '+model+'</p>'
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.timing_table.to_html(comments)
|
2019-02-07 06:33:39 -08:00
|
|
|
# display power data
|
2019-02-06 20:31:22 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Power Data</p>'
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.power_table.to_html(comments)
|
2019-02-07 06:33:39 -08:00
|
|
|
# display corner information
|
2018-11-11 09:27:07 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Characterization Corners</p>'
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.corners_table.to_html(comments)
|
2019-02-07 06:33:39 -08:00
|
|
|
# display deliverables table
|
2019-01-15 19:47:48 -08:00
|
|
|
self.html += '<p style="font-size: 26px;font-family: Trebuchet MS, Arial, Helvetica, sans-serif;">Deliverables</p>'
|
2019-03-06 21:12:21 -08:00
|
|
|
self.dlv_table.sort()
|
2019-03-06 20:59:52 -08:00
|
|
|
self.html += self.dlv_table.to_html(comments)
|