Copy over the CSV read function to fake_sram

This commit is contained in:
Bugra Onal 2022-08-10 12:59:54 -07:00
parent f8c80999bd
commit 3f941d2fff
1 changed files with 75 additions and 0 deletions

View File

@ -57,3 +57,78 @@ class fake_sram(sram_config.sram_config):
self.read_ports.append(port_number) self.read_ports.append(port_number)
self.readonly_ports.append(port_number) self.readonly_ports.append(port_number)
port_number += 1 port_number += 1
def parse_characterizer_csv(f, pages):
"""
Parses output data of the Liberty file generator in order to construct the timing and
current table
"""
#TODO: Func taken from datasheet_gen.py. Read datasheet.info and extract sram members
with open(f) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
for row in csv_reader:
found = 0
col = 0
# defines layout of csv file
NAME = row[col]
col += 1
NUM_WORDS = row[col]
col += 1
NUM_BANKS = row[col]
col += 1
NUM_RW_PORTS = row[col]
col += 1
NUM_W_PORTS = row[col]
col += 1
NUM_R_PORTS = row[col]
col += 1
TECH_NAME = row[col]
col += 1
TEMP = row[col]
col += 1
VOLT = row[col]
col += 1
PROC = row[col]
col += 1
MIN_PERIOD = row[col]
col += 1
OUT_DIR = row[col]
col += 1
LIB_NAME = row[col]
col += 1
WORD_SIZE = row[col]
col += 1
ORIGIN_ID = row[col]
col += 1
DATETIME = row[col]
col += 1
ANALYTICAL_MODEL = row[col]
col += 1
DRC = row[col]
col += 1
LVS = row[col]
col += 1
AREA = row[col]
col += 1