mirror of https://github.com/VLSIDA/OpenRAM.git
comment parsing 1/2 complete; page gen setup complete
This commit is contained in:
parent
903cafb336
commit
813a551691
|
|
@ -1,6 +1,5 @@
|
||||||
from table_gen import *
|
from table_gen import *
|
||||||
import os
|
import os
|
||||||
import csv
|
|
||||||
import base64
|
import base64
|
||||||
from globals import OPTS
|
from globals import OPTS
|
||||||
|
|
||||||
|
|
@ -22,13 +21,12 @@ class datasheet():
|
||||||
# css styling is kept in a seperate file
|
# css styling is kept in a seperate file
|
||||||
self.html += datasheet_css.read()
|
self.html += datasheet_css.read()
|
||||||
|
|
||||||
|
with open(OPTS.openram_temp + "/datasheet.info") as info:
|
||||||
# with open(OPTS.openram_temp + "/datasheet.info") as info:
|
|
||||||
self.html += '<!--'
|
self.html += '<!--'
|
||||||
# for row in info:
|
for row in info:
|
||||||
# self.html += row
|
self.html += row
|
||||||
for item in self.description:
|
# for item in self.description:
|
||||||
self.html += item + ','
|
# self.html += item + ','
|
||||||
self.html += 'EOL'
|
self.html += 'EOL'
|
||||||
self.html += '-->'
|
self.html += '-->'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class library():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.html = ''
|
self.html = ''
|
||||||
|
|
||||||
def generate_html(self):
|
def generate_html(self,book):
|
||||||
vlsi_logo = 0
|
vlsi_logo = 0
|
||||||
with open(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/datasheet/assets/vlsi_logo.png', "rb") as image_file:
|
with open(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/datasheet/assets/vlsi_logo.png', "rb") as image_file:
|
||||||
vlsi_logo = base64.b64encode(image_file.read())
|
vlsi_logo = base64.b64encode(image_file.read())
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import library
|
import library
|
||||||
import csv
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class library_item():
|
class library_item():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
self.name = ''
|
||||||
self.comment = ''
|
self.comment = ''
|
||||||
self.word_size = ''
|
self.word_size = ''
|
||||||
self.num_words = ''
|
self.num_words = ''
|
||||||
|
|
@ -13,14 +14,15 @@ class library_item():
|
||||||
self.num_w_ports = ''
|
self.num_w_ports = ''
|
||||||
self.Area = ''
|
self.Area = ''
|
||||||
self.git_id = ''
|
self.git_id = ''
|
||||||
self.technology = ''
|
self.tech_name = ''
|
||||||
self.min_op = ''
|
self.min_period = ''
|
||||||
|
self.datetime = ''
|
||||||
|
|
||||||
|
|
||||||
class library_gen():
|
class library_gen():
|
||||||
def library_write(name):
|
def library_write(name, book):
|
||||||
with open(name, 'w+') as f:
|
with open(name, 'w+') as f:
|
||||||
library_page.generate_html()
|
library_page.generate_html(book)
|
||||||
f.write(library_page.html)
|
f.write(library_page.html)
|
||||||
|
|
||||||
def search_file(file, name):
|
def search_file(file, name):
|
||||||
|
|
@ -37,6 +39,66 @@ class library_gen():
|
||||||
i += 1
|
i += 1
|
||||||
return i
|
return i
|
||||||
|
|
||||||
|
def parse_comment(item):
|
||||||
|
row = item.comment.split(',')
|
||||||
|
print(row)
|
||||||
|
found = 0
|
||||||
|
col = 0
|
||||||
|
|
||||||
|
item.name = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.num_words = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.num_banks = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.num_rw_ports = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.num_w_port = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.num_r_ports = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.tech_name = row[col]
|
||||||
|
col += 1
|
||||||
|
print(item.tech_name)
|
||||||
|
# TEMP = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
# VOLT = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
# PROC = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.min_period = row[col]
|
||||||
|
col += 1
|
||||||
|
print(item.min_period)
|
||||||
|
# OUT_DIR = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
# LIB_NAME = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.word_size = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.git_id = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
item.datetime = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
# DRC = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
|
# LVS = row[col]
|
||||||
|
col += 1
|
||||||
|
|
||||||
def parse_html(file):
|
def parse_html(file):
|
||||||
item = library_item()
|
item = library_item()
|
||||||
start_tag = '<!--'
|
start_tag = '<!--'
|
||||||
|
|
@ -48,13 +110,18 @@ class library_gen():
|
||||||
|
|
||||||
f.seek(start_byte)
|
f.seek(start_byte)
|
||||||
item.comment = f.read(end_byte - start_byte)
|
item.comment = f.read(end_byte - start_byte)
|
||||||
print(item.comment)
|
library_gen.parse_comment(item)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
def parse_comment(comment, item):
|
def get_file_tree(path):
|
||||||
|
return list(Path(path).rglob("*.html"))
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
datasheet_list = library_gen.get_file_tree('./deliverables')
|
||||||
|
print(datasheet_list)
|
||||||
library_page = library.library()
|
library_page = library.library()
|
||||||
library_gen.parse_html('../../temp/sram_2_16_scn4m_subm.html')
|
book = []
|
||||||
|
for datasheet in datasheet_list:
|
||||||
|
book.append(library_gen.parse_html(datasheet))
|
||||||
|
library_gen.library_write('index.html', book)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue