|
|
@ -95,12 +95,15 @@ class StilFile: |
|
|
|
tests = np.full((len(interface), len(self.patterns)), logic.UNASSIGNED) |
|
|
|
tests = np.full((len(interface), len(self.patterns)), logic.UNASSIGNED) |
|
|
|
for i, p in enumerate(self.patterns): |
|
|
|
for i, p in enumerate(self.patterns): |
|
|
|
for si_port in self.si_ports.keys(): |
|
|
|
for si_port in self.si_ports.keys(): |
|
|
|
pattern = logic.mv_xor(logic.mvarray(p.load[si_port]), scan_inversions[si_port]) |
|
|
|
pattern = logic.mvarray(p.load[si_port]) |
|
|
|
|
|
|
|
inversions = np.choose((pattern == logic.UNASSIGNED) | (pattern == logic.UNKNOWN), |
|
|
|
|
|
|
|
[scan_inversions[si_port], logic.ZERO]).astype(np.uint8) |
|
|
|
|
|
|
|
np.bitwise_xor(pattern, inversions, out=pattern) |
|
|
|
tests[scan_maps[si_port], i] = pattern |
|
|
|
tests[scan_maps[si_port], i] = pattern |
|
|
|
tests[pi_map, i] = logic.mvarray(p.capture['_pi']) |
|
|
|
tests[pi_map, i] = logic.mvarray(p.capture['_pi']) |
|
|
|
return tests |
|
|
|
return tests |
|
|
|
|
|
|
|
|
|
|
|
def tests_loc(self, circuit): |
|
|
|
def tests_loc(self, circuit, init_filter=None, launch_filter=None): |
|
|
|
"""Assembles and returns a LoC scan test pattern set for given circuit. |
|
|
|
"""Assembles and returns a LoC scan test pattern set for given circuit. |
|
|
|
|
|
|
|
|
|
|
|
This function assumes a launch-on-capture (LoC) delay test. |
|
|
|
This function assumes a launch-on-capture (LoC) delay test. |
|
|
@ -112,9 +115,13 @@ class StilFile: |
|
|
|
for i, p in enumerate(self.patterns): |
|
|
|
for i, p in enumerate(self.patterns): |
|
|
|
# init.set_values(i, '0' * len(interface)) |
|
|
|
# init.set_values(i, '0' * len(interface)) |
|
|
|
for si_port in self.si_ports.keys(): |
|
|
|
for si_port in self.si_ports.keys(): |
|
|
|
pattern = logic.mv_xor(logic.mvarray(p.load[si_port]), scan_inversions[si_port]) |
|
|
|
pattern = logic.mvarray(p.load[si_port]) |
|
|
|
|
|
|
|
inversions = np.choose((pattern == logic.UNASSIGNED) | (pattern == logic.UNKNOWN), |
|
|
|
|
|
|
|
[scan_inversions[si_port], logic.ZERO]).astype(np.uint8) |
|
|
|
|
|
|
|
np.bitwise_xor(pattern, inversions, out=pattern) |
|
|
|
init[scan_maps[si_port], i] = pattern |
|
|
|
init[scan_maps[si_port], i] = pattern |
|
|
|
init[pi_map, i] = logic.mvarray(p.launch['_pi'] if '_pi' in p.launch else p.capture['_pi']) |
|
|
|
init[pi_map, i] = logic.mvarray(p.launch['_pi'] if '_pi' in p.launch else p.capture['_pi']) |
|
|
|
|
|
|
|
if init_filter: init = init_filter(init) |
|
|
|
sim8v = LogicSim(circuit, init.shape[-1], m=8) |
|
|
|
sim8v = LogicSim(circuit, init.shape[-1], m=8) |
|
|
|
sim8v.s[0] = logic.mv_to_bp(init) |
|
|
|
sim8v.s[0] = logic.mv_to_bp(init) |
|
|
|
sim8v.s_to_c() |
|
|
|
sim8v.s_to_c() |
|
|
@ -130,6 +137,7 @@ class StilFile: |
|
|
|
if '_pi' in p.capture and 'P' in p.capture['_pi']: |
|
|
|
if '_pi' in p.capture and 'P' in p.capture['_pi']: |
|
|
|
launch[pi_map, i] = logic.mvarray(p.capture['_pi']) |
|
|
|
launch[pi_map, i] = logic.mvarray(p.capture['_pi']) |
|
|
|
launch[po_map, i] = logic.UNASSIGNED |
|
|
|
launch[po_map, i] = logic.UNASSIGNED |
|
|
|
|
|
|
|
if launch_filter: launch = launch_filter(launch) |
|
|
|
|
|
|
|
|
|
|
|
return logic.mv_transition(init, launch) |
|
|
|
return logic.mv_transition(init, launch) |
|
|
|
|
|
|
|
|
|
|
|