fix fault injection
This commit is contained in:
1 parent
de79393dfc
commit
d2a2484efa
1 file changed
+3
-2
@@ -105,7 +105,7 @@ class LogicSim(sim.SimOps):
|
|||||||
elif op == sim.OAI211:self.c[o0] = ~((self.c[i0] | self.c[i1]) & self.c[i2] & self.c[i3])
|
elif op == sim.OAI211:self.c[o0] = ~((self.c[i0] | self.c[i1]) & self.c[i2] & self.c[i3])
|
||||||
elif op == sim.MUX21: self.c[o0] = (self.c[i0] & ~self.c[i2]) | (self.c[i1] & self.c[i2])
|
elif op == sim.MUX21: self.c[o0] = (self.c[i0] & ~self.c[i2]) | (self.c[i1] & self.c[i2])
|
||||||
else: print(f'unknown op {op}')
|
else: print(f'unknown op {op}')
|
||||||
inject_cb(o0, self.s[o0])
|
inject_cb(o0, self.c[o0])
|
||||||
elif self.m == 4:
|
elif self.m == 4:
|
||||||
for op, o0, i0, i1, i2, i3 in self.ops[:,:6]:
|
for op, o0, i0, i1, i2, i3 in self.ops[:,:6]:
|
||||||
o0, i0, i1, i2, i3 = [self.c_locs[x] for x in (o0, i0, i1, i2, i3)]
|
o0, i0, i1, i2, i3 = [self.c_locs[x] for x in (o0, i0, i1, i2, i3)]
|
||||||
@@ -181,6 +181,7 @@ class LogicSim(sim.SimOps):
|
|||||||
logic.bp4v_and(self.c[t1], self.c[i1], self.c[i2])
|
logic.bp4v_and(self.c[t1], self.c[i1], self.c[i2])
|
||||||
logic.bp4v_or(self.c[o0], self.c[t0], self.c[t1])
|
logic.bp4v_or(self.c[o0], self.c[t0], self.c[t1])
|
||||||
else: print(f'unknown op {op}')
|
else: print(f'unknown op {op}')
|
||||||
|
if inject_cb is not None: inject_cb(o0, self.c[o0])
|
||||||
else:
|
else:
|
||||||
for op, o0, i0, i1, i2, i3 in self.ops[:,:6]:
|
for op, o0, i0, i1, i2, i3 in self.ops[:,:6]:
|
||||||
o0, i0, i1, i2, i3 = [self.c_locs[x] for x in (o0, i0, i1, i2, i3)]
|
o0, i0, i1, i2, i3 = [self.c_locs[x] for x in (o0, i0, i1, i2, i3)]
|
||||||
@@ -256,7 +257,7 @@ class LogicSim(sim.SimOps):
|
|||||||
logic.bp8v_and(self.c[t1], self.c[i1], self.c[i2])
|
logic.bp8v_and(self.c[t1], self.c[i1], self.c[i2])
|
||||||
logic.bp8v_or(self.c[o0], self.c[t0], self.c[t1])
|
logic.bp8v_or(self.c[o0], self.c[t0], self.c[t1])
|
||||||
else: print(f'unknown op {op}')
|
else: print(f'unknown op {op}')
|
||||||
if inject_cb is not None: inject_cb(o0, self.s[o0])
|
if inject_cb is not None: inject_cb(o0, self.c[o0])
|
||||||
|
|
||||||
def c_to_s(self):
|
def c_to_s(self):
|
||||||
"""Copies (captures) the results of the combinational portion to ``s[1]``.
|
"""Copies (captures) the results of the combinational portion to ``s[1]``.
|
||||||
|
|||||||
Reference in new issue
Block a user