Browse Source

adding aoi to logic sim

devel
Stefan Holst 2 years ago
parent
commit
afb7e745a1
  1. 44
      src/kyupy/logic_sim.py

44
src/kyupy/logic_sim.py

@ -164,65 +164,57 @@ class LogicSim: @@ -164,65 +164,57 @@ class LogicSim:
self.propagate(inject_cb)
return self.capture(state)
@staticmethod
def fork_fct(inputs, outputs):
def fork_fct(self, inputs, outputs):
for o in outputs: o[...] = inputs[0]
@staticmethod
def const0_fct(_, outputs):
def const0_fct(self, _, outputs):
for o in outputs: o[...] = 0
@staticmethod
def const1_fct(_, outputs):
def const1_fct(self, _, outputs):
for o in outputs:
o[...] = 0
logic.bp_not(o, o)
@staticmethod
def not_fct(inputs, outputs):
def not_fct(self, inputs, outputs):
logic.bp_not(outputs[0], inputs[0])
@staticmethod
def and_fct(inputs, outputs):
def and_fct(self, inputs, outputs):
logic.bp_and(outputs[0], *inputs)
@staticmethod
def or_fct(inputs, outputs):
def or_fct(self, inputs, outputs):
logic.bp_or(outputs[0], *inputs)
@staticmethod
def xor_fct(inputs, outputs):
def xor_fct(self, inputs, outputs):
logic.bp_xor(outputs[0], *inputs)
@staticmethod
def sdff_fct(inputs, outputs):
def sdff_fct(self, inputs, outputs):
logic.bp_buf(outputs[0], inputs[0])
if len(outputs) > 1:
logic.bp_not(outputs[1], inputs[0])
@staticmethod
def dff_fct(inputs, outputs):
def dff_fct(self, inputs, outputs):
logic.bp_buf(outputs[0], inputs[0])
if len(outputs) > 1:
logic.bp_not(outputs[1], inputs[0])
@staticmethod
def latch_fct(inputs, outputs):
def latch_fct(self, inputs, outputs):
logic.bp_latch(outputs[0], inputs[0], inputs[1], inputs[2])
if len(outputs) > 1:
logic.bp_not(outputs[1], inputs[0])
@staticmethod
def nand_fct(inputs, outputs):
def nand_fct(self, inputs, outputs):
logic.bp_and(outputs[0], *inputs)
logic.bp_not(outputs[0], outputs[0])
@staticmethod
def nor_fct(inputs, outputs):
def nor_fct(self, inputs, outputs):
logic.bp_or(outputs[0], *inputs)
logic.bp_not(outputs[0], outputs[0])
@staticmethod
def xnor_fct(inputs, outputs):
def xnor_fct(self, inputs, outputs):
logic.bp_xor(outputs[0], *inputs)
logic.bp_not(outputs[0], outputs[0])
def aoi21_fct(self, inputs, outputs):
logic.bp_and(self.tmp[0], inputs[0], inputs[1])
logic.bp_or(outputs[0], self.tmp[0], inputs[2])
logic.bp_not(outputs[0], outputs[0])
Loading…
Cancel
Save