mirror of https://github.com/VLSIDA/OpenRAM.git
Condensed some datasheet code in lib.py
This commit is contained in:
parent
bb841fc84d
commit
d8437249f7
|
|
@ -627,6 +627,78 @@ class lib:
|
||||||
|
|
||||||
def parse_info(self,corner,lib_name):
|
def parse_info(self,corner,lib_name):
|
||||||
""" Copies important characterization data to datasheet.info to be added to datasheet """
|
""" Copies important characterization data to datasheet.info to be added to datasheet """
|
||||||
|
if OPTS.output_datasheet_info:
|
||||||
|
datasheet_path = OPTS.output_path
|
||||||
|
else:
|
||||||
|
datasheet_path = OPTS.openram_temp
|
||||||
|
datasheet = open(datasheet_path +'/datasheet.info', 'a+')
|
||||||
|
|
||||||
|
self.write_inp_params_datasheet(datasheet, corner, lib_name)
|
||||||
|
self.write_signal_from_ports(datasheet,
|
||||||
|
"din{1}[{0}:0]".format(self.sram.word_size - 1, '{}'),
|
||||||
|
self.write_ports,
|
||||||
|
"setup_times_LH",
|
||||||
|
"setup_times_HL",
|
||||||
|
"hold_times_LH",
|
||||||
|
"hold_times_HL")
|
||||||
|
|
||||||
|
# self.write_signal_from_ports(datasheet,
|
||||||
|
# "dout{1}[{0}:0]".format(self.sram.word_size - 1, '{}'),
|
||||||
|
# self.read_ports,
|
||||||
|
# "delay_lh",
|
||||||
|
# "delay_hl",
|
||||||
|
# "slew_lh",
|
||||||
|
# "slew_hl")
|
||||||
|
for port in self.all_ports:
|
||||||
|
#dout timing
|
||||||
|
if port in self.read_ports:
|
||||||
|
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
||||||
|
"dout{1}[{0}:0]".format(self.sram.word_size - 1, port),
|
||||||
|
min(list(map(round_time,self.char_port_results[port]["delay_lh"]))),
|
||||||
|
max(list(map(round_time,self.char_port_results[port]["delay_lh"]))),
|
||||||
|
|
||||||
|
min(list(map(round_time,self.char_port_results[port]["delay_hl"]))),
|
||||||
|
max(list(map(round_time,self.char_port_results[port]["delay_hl"]))),
|
||||||
|
|
||||||
|
min(list(map(round_time,self.char_port_results[port]["slew_lh"]))),
|
||||||
|
max(list(map(round_time,self.char_port_results[port]["slew_lh"]))),
|
||||||
|
|
||||||
|
min(list(map(round_time,self.char_port_results[port]["slew_hl"]))),
|
||||||
|
max(list(map(round_time,self.char_port_results[port]["slew_hl"])))
|
||||||
|
))
|
||||||
|
|
||||||
|
self.write_signal_from_ports(datasheet,
|
||||||
|
"csb{}",
|
||||||
|
self.all_ports,
|
||||||
|
"setup_times_LH",
|
||||||
|
"setup_times_HL",
|
||||||
|
"hold_times_LH",
|
||||||
|
"hold_times_HL")
|
||||||
|
|
||||||
|
self.write_signal_from_ports(datasheet,
|
||||||
|
"addr{1}[{0}:0]".format(self.sram.addr_size - 1, '{}'),
|
||||||
|
self.all_ports,
|
||||||
|
"setup_times_LH",
|
||||||
|
"setup_times_HL",
|
||||||
|
"hold_times_LH",
|
||||||
|
"hold_times_HL")
|
||||||
|
|
||||||
|
self.write_signal_from_ports(datasheet,
|
||||||
|
"web{}",
|
||||||
|
self.readwrite_ports,
|
||||||
|
"setup_times_LH",
|
||||||
|
"setup_times_HL",
|
||||||
|
"hold_times_LH",
|
||||||
|
"hold_times_HL")
|
||||||
|
|
||||||
|
self.write_power_datasheet(datasheet)
|
||||||
|
|
||||||
|
datasheet.write("{0},{1},".format('words_per_row', OPTS.words_per_row))
|
||||||
|
datasheet.write("END\n")
|
||||||
|
datasheet.close()
|
||||||
|
|
||||||
|
def write_inp_params_datasheet(self, datasheet, corner, lib_name):
|
||||||
|
|
||||||
if OPTS.is_unit_test:
|
if OPTS.is_unit_test:
|
||||||
git_id = 'FFFFFFFFFFFFFFFFFFFF'
|
git_id = 'FFFFFFFFFFFFFFFFFFFF'
|
||||||
|
|
||||||
|
|
@ -644,14 +716,9 @@ class lib:
|
||||||
# check if git id is valid
|
# check if git id is valid
|
||||||
if len(git_id) != 40:
|
if len(git_id) != 40:
|
||||||
debug.warning("Failed to retrieve git id")
|
debug.warning("Failed to retrieve git id")
|
||||||
git_id = 'Failed to retruieve'
|
git_id = 'Failed to retrieve'
|
||||||
if OPTS.output_datasheet_info:
|
|
||||||
datasheet_path = OPTS.output_path
|
|
||||||
else:
|
|
||||||
datasheet_path = OPTS.openram_temp
|
|
||||||
datasheet = open(datasheet_path +'/datasheet.info', 'a+')
|
|
||||||
|
|
||||||
current_time = datetime.date.today()
|
current_time = datetime.date.today()
|
||||||
|
|
||||||
# write static information to be parser later
|
# write static information to be parser later
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},".format(
|
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},".format(
|
||||||
OPTS.output_name,
|
OPTS.output_name,
|
||||||
|
|
@ -680,103 +747,25 @@ class lib:
|
||||||
# write area
|
# write area
|
||||||
datasheet.write(str(self.sram.width * self.sram.height) + ',')
|
datasheet.write(str(self.sram.width * self.sram.height) + ',')
|
||||||
|
|
||||||
# write timing information for all ports
|
def write_signal_from_ports(self, datasheet, signal, ports, time_pos_1, time_pos_2, time_pos_3, time_pos_4):
|
||||||
for port in self.all_ports:
|
for port in ports:
|
||||||
#din timings
|
|
||||||
if port in self.write_ports:
|
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
|
||||||
"din{1}[{0}:0]".format(self.sram.word_size - 1, port),
|
|
||||||
min(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_HL"])))
|
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
for port in self.all_ports:
|
|
||||||
#dout timing
|
|
||||||
if port in self.read_ports:
|
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
|
||||||
"dout{1}[{0}:0]".format(self.sram.word_size - 1, port),
|
|
||||||
min(list(map(round_time,self.char_port_results[port]["delay_lh"]))),
|
|
||||||
max(list(map(round_time,self.char_port_results[port]["delay_lh"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.char_port_results[port]["delay_hl"]))),
|
|
||||||
max(list(map(round_time,self.char_port_results[port]["delay_hl"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.char_port_results[port]["slew_lh"]))),
|
|
||||||
max(list(map(round_time,self.char_port_results[port]["slew_lh"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.char_port_results[port]["slew_hl"]))),
|
|
||||||
max(list(map(round_time,self.char_port_results[port]["slew_hl"])))
|
|
||||||
|
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
for port in self.all_ports:
|
|
||||||
#csb timings
|
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
||||||
"csb{0}".format(port),
|
signal.format(port),
|
||||||
min(list(map(round_time,self.times["setup_times_LH"]))),
|
min(list(map(round_time,self.times[time_pos_1]))),
|
||||||
max(list(map(round_time,self.times["setup_times_LH"]))),
|
max(list(map(round_time,self.times[time_pos_1]))),
|
||||||
|
|
||||||
min(list(map(round_time,self.times["setup_times_HL"]))),
|
min(list(map(round_time,self.times[time_pos_2]))),
|
||||||
max(list(map(round_time,self.times["setup_times_HL"]))),
|
max(list(map(round_time,self.times[time_pos_2]))),
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_LH"]))),
|
min(list(map(round_time,self.times[time_pos_3]))),
|
||||||
max(list(map(round_time,self.times["hold_times_LH"]))),
|
max(list(map(round_time,self.times[time_pos_3]))),
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_HL"]))),
|
min(list(map(round_time,self.times[time_pos_4]))),
|
||||||
max(list(map(round_time,self.times["hold_times_HL"])))
|
max(list(map(round_time,self.times[time_pos_4])))
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
for port in self.all_ports:
|
def write_power_datasheet(self, datasheet):
|
||||||
#addr timings
|
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
|
||||||
"addr{1}[{0}:0]".format(self.sram.addr_size - 1, port),
|
|
||||||
min(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_HL"])))
|
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
for port in self.all_ports:
|
|
||||||
if port in self.readwrite_ports:
|
|
||||||
|
|
||||||
#web timings
|
|
||||||
datasheet.write("{0},{1},{2},{3},{4},{5},{6},{7},{8},".format(
|
|
||||||
"web{0}".format(port),
|
|
||||||
min(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["setup_times_HL"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_LH"]))),
|
|
||||||
|
|
||||||
min(list(map(round_time,self.times["hold_times_HL"]))),
|
|
||||||
max(list(map(round_time,self.times["hold_times_HL"])))
|
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
# write power information
|
# write power information
|
||||||
for port in self.all_ports:
|
for port in self.all_ports:
|
||||||
name = ''
|
name = ''
|
||||||
|
|
@ -815,7 +804,3 @@ class lib:
|
||||||
control_str += ' & csb{0}'.format(i)
|
control_str += ' & csb{0}'.format(i)
|
||||||
|
|
||||||
datasheet.write("{0},{1},{2},".format('leak', control_str, self.char_sram_results["leakage_power"]))
|
datasheet.write("{0},{1},{2},".format('leak', control_str, self.char_sram_results["leakage_power"]))
|
||||||
|
|
||||||
datasheet.write("{0},{1},".format('words_per_row', OPTS.words_per_row))
|
|
||||||
datasheet.write("END\n")
|
|
||||||
datasheet.close()
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class options(optparse.Values):
|
||||||
# Output config with all options
|
# Output config with all options
|
||||||
output_extended_config = False
|
output_extended_config = False
|
||||||
# Output temporary file used to format HTML page
|
# Output temporary file used to format HTML page
|
||||||
output_datasheet_info = True
|
output_datasheet_info = False
|
||||||
# Determines which analytical model to use.
|
# Determines which analytical model to use.
|
||||||
# Available Models: elmore, linear_regression
|
# Available Models: elmore, linear_regression
|
||||||
model_name = "elmore"
|
model_name = "elmore"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue