From: yu.dongliang <18588496441@163.com> Date: Wed, 21 Aug 2024 07:36:33 +0000 (+0800) Subject: add some test *.cpk X-Git-Url: http://baseworks.info/?a=commitdiff_plain;ds=inline;p=ses.git add some test *.cpk --- diff --git a/cpk/Makefile b/cpk/Makefile index 2f54c61..30e65c5 100644 --- a/cpk/Makefile +++ b/cpk/Makefile @@ -1,8 +1,8 @@ -CFILES += nand.c +#CFILES += nand.c #CFILES += nor.c #CFILES += not.c #CFILES += and_gate.c -#CFILES += or_gate.c +CFILES += or_gate.c #CFILES += add_gate.c CFILES += ../scf_eda_pack.c CFILES += ../pack/scf_pack.c diff --git a/cpk/or_gate.c b/cpk/or_gate.c index 854c884..36b42e3 100644 --- a/cpk/or_gate.c +++ b/cpk/or_gate.c @@ -9,6 +9,8 @@ int main(int argc, char* argv[]) ScfEcomponent* NOR0; ScfEcomponent* NOT0; + ScfEcomponent* R0; + ScfEcomponent* R1; ScfEfunction* f; ScfEboard* b; @@ -17,6 +19,8 @@ int main(int argc, char* argv[]) f = scf_efunction__alloc("or_gate"); EDA_INST_ADD_COMPONENT(f, B, SCF_EDA_Battery); + EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor); + EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor); B->pins[SCF_EDA_Battery_NEG]->flags = SCF_EDA_PIN_NEG; B->pins[SCF_EDA_Battery_POS]->flags = SCF_EDA_PIN_POS; @@ -24,16 +28,19 @@ int main(int argc, char* argv[]) EDA_INST_ADD_COMPONENT(f, NOR0, SCF_EDA_NOR); EDA_INST_ADD_COMPONENT(f, NOT0, SCF_EDA_NOT); - EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, NOR0, SCF_EDA_NAND_POS); - EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_NEG, NOR0, SCF_EDA_NAND_NEG); + EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, NOR0, SCF_EDA_NOR_POS); + EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_NEG, NOR0, SCF_EDA_NOR_NEG); EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, NOT0, SCF_EDA_NOT_POS); EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_NEG, NOT0, SCF_EDA_NOT_NEG); EDA_PIN_ADD_PIN(NOR0, SCF_EDA_NOR_OUT, NOT0, SCF_EDA_NOT_IN); - NOR0->pins[SCF_EDA_NOR_IN0]->flags = SCF_EDA_PIN_IN | SCF_EDA_PIN_IN0; - NOR0->pins[SCF_EDA_NOR_IN1]->flags = SCF_EDA_PIN_IN; + EDA_PIN_ADD_PIN(R0, 0, NOR0, SCF_EDA_NOR_IN0); + EDA_PIN_ADD_PIN(R1, 0, NOR0, SCF_EDA_NOR_IN1); + + R0->pins[1]->flags = SCF_EDA_PIN_IN | SCF_EDA_PIN_IN0; + R1->pins[1]->flags = SCF_EDA_PIN_IN; NOT0->pins[SCF_EDA_NOT_OUT]->flags = SCF_EDA_PIN_OUT; diff --git a/examples/add.cpk b/examples/add.cpk new file mode 100644 index 0000000..12d89f4 Binary files /dev/null and b/examples/add.cpk differ diff --git a/examples/and.cpk b/examples/and.cpk new file mode 100644 index 0000000..3fa8216 Binary files /dev/null and b/examples/and.cpk differ diff --git a/examples/or.cpk b/examples/or.cpk new file mode 100644 index 0000000..870e194 Binary files /dev/null and b/examples/or.cpk differ diff --git a/examples/or_gate.cpk b/examples/or_gate.cpk new file mode 100644 index 0000000..488ccf8 Binary files /dev/null and b/examples/or_gate.cpk differ