Changed create_test_cycles to have targeted ports for characterization rather than all ports always.

This commit is contained in:
Hunter Nichols 2018-08-29 17:16:11 -07:00
parent 775fe7b57c
commit 4b515fe1ac
2 changed files with 18 additions and 12 deletions

View File

@ -859,27 +859,27 @@ class delay():
#for i in range(self.addr_size): #for i in range(self.addr_size):
# self.addr_values.append([]) # self.addr_values.append([])
#Temporary logic. Loop through all readwrite ports with characterize logic. #Temporary logic. Loop through all target readwrite ports with characterize logic.
cur_write_port = None cur_write_port = None
for readwrite_port in self.readwrite_ports: for readwrite_port in self.targ_readwrite_ports:
self.gen_test_cycles_one_port(readwrite_port, readwrite_port) self.gen_test_cycles_one_port(readwrite_port, readwrite_port)
cur_write_port = readwrite_port cur_write_port = readwrite_port
cur_read_port = cur_write_port cur_read_port = cur_write_port
#This is added only for testing purposes. Should be change later. Characterizing the remaining ports. #Characterizing the remaining target ports. Not the final design.
write_pos = 0 write_pos = 0
read_pos = 0 read_pos = 0
while True: while True:
#Exit when all ports have been characterized #Exit when all ports have been characterized
if write_pos >= len(self.write_ports) and read_pos >= len(self.read_ports): if write_pos >= len(self.targ_write_ports) and read_pos >= len(self.targ_read_ports):
break break
#Select new write and/or read ports for the next cycle #Select new write and/or read ports for the next cycle. Use previous port if none remaining.
if write_pos < len(self.write_ports): if write_pos < len(self.targ_write_ports):
cur_write_port = self.write_ports[write_pos] cur_write_port = self.targ_write_ports[write_pos]
write_pos+=1 write_pos+=1
if read_pos < len(self.read_ports): if read_pos < len(self.targ_read_ports):
cur_read_port = self.read_ports[read_pos] cur_read_port = self.targ_read_ports[read_pos]
read_pos+=1 read_pos+=1
#Add test cycle of read/write port pair. One port could have been used already, but the other has not. #Add test cycle of read/write port pair. One port could have been used already, but the other has not.
@ -966,13 +966,19 @@ class delay():
def gen_port_names(self): def gen_port_names(self):
"""Generates the port names to be used in characterization""" """Generates the port names to be used in characterization and sets default simulation target ports"""
self.readwrite_ports = [] self.readwrite_ports = []
self.write_ports = [] self.write_ports = []
self.read_ports = [] self.read_ports = []
#Generate the port names
for readwrite_port in range(OPTS.rw_ports): for readwrite_port in range(OPTS.rw_ports):
self.readwrite_ports.append("RWP{0}".format(readwrite_port)) self.readwrite_ports.append("RWP{0}".format(readwrite_port))
for write_port in range(OPTS.w_ports): for write_port in range(OPTS.w_ports):
self.write_ports.append("WP{0}".format(write_port)) self.write_ports.append("WP{0}".format(write_port))
for read_port in range(OPTS.r_ports): for read_port in range(OPTS.r_ports):
self.read_ports.append("RP{0}".format(read_port)) self.read_ports.append("RP{0}".format(read_port))
#Set the default target ports for simulation. Default is all the ports.
self.targ_readwrite_ports = self.readwrite_ports
self.targ_read_ports = self.read_ports
self.targ_write_ports = self.write_ports

View File

@ -452,7 +452,7 @@ class lib:
self.char_results = self.d.analytical_delay(self.sram,self.slews,self.loads) self.char_results = self.d.analytical_delay(self.sram,self.slews,self.loads)
else: else:
#Temporary Workaround to here to set # of ports. Crashes if set in config file. #Temporary Workaround to here to set # of ports. Crashes if set in config file.
#OPTS.rw_ports = 1 #OPTS.rw_ports = 2
#OPTS.r_ports = 1 #OPTS.r_ports = 1
#OPTS.w_ports = 1 #OPTS.w_ports = 1