From e145b9b59b321519d88a20e301e76045bb28faae Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 14 Nov 2023 10:24:53 +0800 Subject: [PATCH] ses_graph.h --- ses_core.h | 1 - ses_layout.c | 1 + test/main.c | 26 +++++++++++++++----------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ses_core.h b/ses_core.h index 431968d..26f2d16 100644 --- a/ses_core.h +++ b/ses_core.h @@ -3,7 +3,6 @@ #include"scf_vector.h" #include"scf_eda_pb.h" -#include"ses_graph.h" typedef struct ses_step_s ses_step_t; typedef struct ses_path_s ses_path_t; diff --git a/ses_layout.c b/ses_layout.c index 570b1ff..2f18ed6 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -1,5 +1,6 @@ #include #include"ses_core.h" +#include"ses_graph.h" int epin_cmp(const void* v0, const void* v1) { diff --git a/test/main.c b/test/main.c index dfafc94..c38a20b 100644 --- a/test/main.c +++ b/test/main.c @@ -6,11 +6,12 @@ int main(int argc, char* argv[]) { ScfEcomponent* B; - ScfEcomponent* D0; ScfEcomponent* T0; ScfEcomponent* R0; ScfEcomponent* R1; ScfEcomponent* R2; + ScfEcomponent* R3; + ScfEcomponent* C0; ScfEfunction* f; ScfEboard* b; @@ -22,21 +23,24 @@ int main(int argc, char* argv[]) B->pins[SCF_EDA_Battery_NEG]->flags = SCF_EDA_PIN_NEG; B->pins[SCF_EDA_Battery_POS]->flags = SCF_EDA_PIN_POS; - EDA_INST_ADD_COMPONENT(f, D0, SCF_EDA_Diode); // 1 - EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_Transistor); // 2 - EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor); // 3 - EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor); // 4 - EDA_INST_ADD_COMPONENT(f, R2, SCF_EDA_Resistor); // 5 + EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_NPN); + EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor); + EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor); + EDA_INST_ADD_COMPONENT(f, R2, SCF_EDA_Resistor); + EDA_INST_ADD_COMPONENT(f, R3, SCF_EDA_Resistor); + EDA_INST_ADD_COMPONENT(f, C0, SCF_EDA_Inductor); - EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, D0, SCF_EDA_Diode_POS); - EDA_PIN_ADD_PIN(D0, SCF_EDA_Diode_NEG, R0, 1); + EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, R0, 1); EDA_PIN_ADD_PIN(R0, 0, R1, 1); EDA_PIN_ADD_PIN(R1, 0, B, SCF_EDA_Battery_NEG); - EDA_PIN_ADD_PIN(T0, SCF_EDA_Transistor_B, R1, 1); + EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_B, R1, 1); EDA_PIN_ADD_PIN(B, SCF_EDA_Battery_POS, R2, 1); - EDA_PIN_ADD_PIN(R2, 0, T0, SCF_EDA_Transistor_C); - EDA_PIN_ADD_PIN(T0, SCF_EDA_Transistor_E, B, SCF_EDA_Battery_NEG); + EDA_PIN_ADD_PIN(R2, 0, T0, SCF_EDA_NPN_C); + EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_E, R3, 1); + EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_E, C0, 1); + EDA_PIN_ADD_PIN(R3, 0, B, SCF_EDA_Battery_NEG); + EDA_PIN_ADD_PIN(C0, 0, B, SCF_EDA_Battery_NEG); scf_eboard__add_function(b, f); -- 2.25.1