From 813a551691fd6e98f09e3f38184ca7b0c528b2e4 Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Tue, 15 Jan 2019 20:48:20 -0800 Subject: [PATCH] comment parsing 1/2 complete; page gen setup complete --- compiler/datasheet/datasheet.py | 12 ++- compiler/datasheet/library_page/library.py | 2 +- .../datasheet/library_page/library_gen.py | 87 ++++++++++++++++--- 3 files changed, 83 insertions(+), 18 deletions(-) diff --git a/compiler/datasheet/datasheet.py b/compiler/datasheet/datasheet.py index 566dfc80..22a50cb9 100644 --- a/compiler/datasheet/datasheet.py +++ b/compiler/datasheet/datasheet.py @@ -1,6 +1,5 @@ from table_gen import * import os -import csv import base64 from globals import OPTS @@ -22,13 +21,12 @@ class datasheet(): # css styling is kept in a seperate file 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 += '' diff --git a/compiler/datasheet/library_page/library.py b/compiler/datasheet/library_page/library.py index d23d4a75..3477164c 100644 --- a/compiler/datasheet/library_page/library.py +++ b/compiler/datasheet/library_page/library.py @@ -7,7 +7,7 @@ class library(): def __init__(self): self.html = '' - def generate_html(self): + def generate_html(self,book): vlsi_logo = 0 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()) diff --git a/compiler/datasheet/library_page/library_gen.py b/compiler/datasheet/library_page/library_gen.py index ca7f631d..ca5942f7 100644 --- a/compiler/datasheet/library_page/library_gen.py +++ b/compiler/datasheet/library_page/library_gen.py @@ -1,9 +1,10 @@ import library -import csv +from pathlib import Path class library_item(): def __init__(self): + self.name = '' self.comment = '' self.word_size = '' self.num_words = '' @@ -13,14 +14,15 @@ class library_item(): self.num_w_ports = '' self.Area = '' self.git_id = '' - self.technology = '' - self.min_op = '' + self.tech_name = '' + self.min_period = '' + self.datetime = '' class library_gen(): - def library_write(name): + def library_write(name, book): with open(name, 'w+') as f: - library_page.generate_html() + library_page.generate_html(book) f.write(library_page.html) def search_file(file, name): @@ -37,6 +39,66 @@ class library_gen(): i += 1 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): item = library_item() start_tag = '