Functional fixes.

Off by one error of max address with redundant rows.
Select reads 3x more during functional sim.
This commit is contained in:
mrg 2021-06-29 09:33:44 -07:00
parent c599d8f62c
commit c4aec6af8c
2 changed files with 9 additions and 9 deletions

View File

@ -32,13 +32,13 @@ class functional(simulation):
if not spfile: if not spfile:
# self.sp_file is assigned in base class # self.sp_file is assigned in base class
sram.sp_write(self.sp_file, trim=OPTS.trim_netlist) sram.sp_write(self.sp_file, trim=OPTS.trim_netlist)
if not corner: if not corner:
corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0]) corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0])
if period: if period:
self.period = period self.period = period
if not output_path: if not output_path:
self.output_path = OPTS.openram_temp self.output_path = OPTS.openram_temp
else: else:
@ -63,11 +63,12 @@ class functional(simulation):
self.addr_spare_index = self.addr_size self.addr_spare_index = self.addr_size
# If trim is set, specify the valid addresses # If trim is set, specify the valid addresses
self.valid_addresses = set() self.valid_addresses = set()
self.max_address = 2**self.addr_size - 1 + (self.num_spare_rows * self.words_per_row) # Don't base off address with since we may have a couple spare columns
self.max_address = self.num_rows * self.words_per_row
if OPTS.trim_netlist: if OPTS.trim_netlist:
for i in range(self.words_per_row): for i in range(self.words_per_row):
self.valid_addresses.add(i) self.valid_addresses.add(i)
self.valid_addresses.add(self.max_address - i) self.valid_addresses.add(self.max_address - i - 1)
self.probe_address, self.probe_data = '0' * self.addr_size, 0 self.probe_address, self.probe_data = '0' * self.addr_size, 0
self.set_corner(corner) self.set_corner(corner)
self.set_spice_constants() self.set_spice_constants()
@ -87,7 +88,7 @@ class functional(simulation):
self.num_cycles = cycles self.num_cycles = cycles
# This is to have ordered keys for random selection # This is to have ordered keys for random selection
self.stored_words = collections.OrderedDict() self.stored_words = collections.OrderedDict()
self.stored_spares = collections.OrderedDict() self.stored_spares = collections.OrderedDict()
self.read_check = [] self.read_check = []
self.read_results = [] self.read_results = []
@ -128,11 +129,12 @@ class functional(simulation):
name)) name))
def create_random_memory_sequence(self): def create_random_memory_sequence(self):
# Select randomly, but have 3x more reads to increase probability
if self.write_size: if self.write_size:
rw_ops = ["noop", "write", "partial_write", "read"] rw_ops = ["noop", "write", "partial_write", "read", "read", "read"]
w_ops = ["noop", "write", "partial_write"] w_ops = ["noop", "write", "partial_write"]
else: else:
rw_ops = ["noop", "write", "read"] rw_ops = ["noop", "write", "read", "read", "read"]
w_ops = ["noop", "write"] w_ops = ["noop", "write"]
r_ops = ["noop", "read"] r_ops = ["noop", "read"]
@ -483,5 +485,3 @@ class functional(simulation):
qbar_name = cell_name + OPTS.hier_seperator + str(storage_names[1]) qbar_name = cell_name + OPTS.hier_seperator + str(storage_names[1])
return (q_name, qbar_name) return (q_name, qbar_name)