mirror of https://github.com/VLSIDA/OpenRAM.git
Write all write ports first cycle. Don't check feedthru.
This commit is contained in:
parent
35a8dd2eec
commit
9ec663e0b1
|
|
@ -107,41 +107,18 @@ class functional(simulation):
|
||||||
comment = self.gen_cycle_comment("noop", "0"*self.word_size, "0"*self.addr_size, "0"*self.num_wmasks, 0, self.t_current)
|
comment = self.gen_cycle_comment("noop", "0"*self.word_size, "0"*self.addr_size, "0"*self.num_wmasks, 0, self.t_current)
|
||||||
self.add_noop_all_ports(comment)
|
self.add_noop_all_ports(comment)
|
||||||
|
|
||||||
# 1. Write at least once. For multiport, it ensures that
|
# 1. Write all the write ports first to seed a bunch of locations.
|
||||||
# feedthru reads also work.
|
for port in self.write_ports:
|
||||||
|
addr = self.gen_addr()
|
||||||
|
word = self.gen_data()
|
||||||
|
comment = self.gen_cycle_comment("write", word, addr, "1"*self.num_wmasks, port, self.t_current)
|
||||||
|
self.add_write_one_port(comment, addr, word, "1"*self.num_wmasks, port)
|
||||||
|
self.stored_words[addr] = word
|
||||||
|
|
||||||
# Port 0 may not be a write port, so find the first write
|
# All other read-only ports are noops.
|
||||||
# port.
|
for port in self.read_ports:
|
||||||
first_write_port = self.write_ports[0]
|
if port not in self.write_ports:
|
||||||
addr = self.gen_addr()
|
self.add_noop_one_port(port)
|
||||||
word = self.gen_data()
|
|
||||||
comment = self.gen_cycle_comment("write", word, addr, "1"*self.num_wmasks, first_write_port, self.t_current)
|
|
||||||
self.add_write_one_port(comment, addr, word, "1"*self.num_wmasks, first_write_port)
|
|
||||||
self.stored_words[addr] = word
|
|
||||||
|
|
||||||
# The read port should not be the same as the write port being written.
|
|
||||||
other_read_ports = copy.copy(self.read_ports)
|
|
||||||
try:
|
|
||||||
other_read_ports.remove(first_write_port)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
# If we have one, check the feedthru read worked.
|
|
||||||
if len(other_read_ports)>0:
|
|
||||||
first_read_port = other_read_ports[0]
|
|
||||||
comment = self.gen_cycle_comment("read (feedthru)", word, addr, "0"*self.num_wmasks, first_read_port, self.t_current)
|
|
||||||
self.add_read_one_port(comment, addr, first_read_port)
|
|
||||||
self.add_read_check(word, first_read_port)
|
|
||||||
|
|
||||||
# All other ports are noops.
|
|
||||||
other_ports = copy.copy(self.all_ports)
|
|
||||||
other_ports.remove(first_write_port)
|
|
||||||
try:
|
|
||||||
other_ports.remove(first_read_port)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
for port in other_ports:
|
|
||||||
self.add_noop_one_port(port)
|
|
||||||
self.cycle_times.append(self.t_current)
|
self.cycle_times.append(self.t_current)
|
||||||
self.t_current += self.period
|
self.t_current += self.period
|
||||||
self.check_lengths()
|
self.check_lengths()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue