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

@ -63,11 +63,12 @@ class functional(simulation):
self.addr_spare_index = self.addr_size
# If trim is set, specify the valid addresses
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:
for i in range(self.words_per_row):
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.set_corner(corner)
self.set_spice_constants()
@ -128,11 +129,12 @@ class functional(simulation):
name))
def create_random_memory_sequence(self):
# Select randomly, but have 3x more reads to increase probability
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"]
else:
rw_ops = ["noop", "write", "read"]
rw_ops = ["noop", "write", "read", "read", "read"]
w_ops = ["noop", "write"]
r_ops = ["noop", "read"]
@ -483,5 +485,3 @@ class functional(simulation):
qbar_name = cell_name + OPTS.hier_seperator + str(storage_names[1])
return (q_name, qbar_name)