From b82ea2c2418dc7e6d494baad22ea3f806fa3c816 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 5 Sep 2023 14:04:30 +0800 Subject: [PATCH] scf_eda.proto --- scf_eda.pb-c.c | 216 +++++++++++++++++++++++++++++++++---------------- scf_eda.pb-c.h | 12 ++- scf_eda.proto | 68 +++++++++------- ses_step_va.c | 120 +++++++++++++++++++++++++-- 4 files changed, 306 insertions(+), 110 deletions(-) diff --git a/scf_eda.pb-c.c b/scf_eda.pb-c.c index 55150a6..482c4cc 100644 --- a/scf_eda.pb-c.c +++ b/scf_eda.pb-c.c @@ -385,7 +385,7 @@ const ProtobufCMessageDescriptor scf_line__descriptor = (ProtobufCMessageInit) scf_line__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = +static const ProtobufCFieldDescriptor scf_epin__field_descriptors[20] = { { "id", @@ -460,7 +460,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 7, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -472,35 +472,59 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "A", + "jv", 8, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ - offsetof(ScfEpin, a), + offsetof(ScfEpin, jv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "R", + "a", 9, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ - offsetof(ScfEpin, r), + offsetof(ScfEpin, a), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "jR", + "ja", 10, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ + offsetof(ScfEpin, ja), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "r", + 11, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(ScfEpin, r), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "jr", + 12, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ offsetof(ScfEpin, jr), NULL, NULL, @@ -509,7 +533,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "uF", - 11, + 13, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -521,7 +545,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "uH", - 12, + 14, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -533,7 +557,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "tr", - 13, + 15, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -545,7 +569,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "jtr", - 14, + 16, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -557,7 +581,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "x", - 15, + 17, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -569,7 +593,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "y", - 16, + 18, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -581,7 +605,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "vflag", - 17, + 19, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -593,7 +617,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "pflag", - 18, + 20, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -605,29 +629,31 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, }; static const unsigned scf_epin__field_indices_by_name[] = { - 7, /* field[7] = A */ - 8, /* field[8] = R */ - 6, /* field[6] = V */ + 8, /* field[8] = a */ 5, /* field[5] = c_lid */ 1, /* field[1] = cid */ 3, /* field[3] = flags */ 0, /* field[0] = id */ - 9, /* field[9] = jR */ - 13, /* field[13] = jtr */ + 9, /* field[9] = ja */ + 11, /* field[11] = jr */ + 15, /* field[15] = jtr */ + 7, /* field[7] = jv */ 2, /* field[2] = lid */ - 17, /* field[17] = pflag */ + 19, /* field[19] = pflag */ + 10, /* field[10] = r */ 4, /* field[4] = tos */ - 12, /* field[12] = tr */ - 10, /* field[10] = uF */ - 11, /* field[11] = uH */ - 16, /* field[16] = vflag */ - 14, /* field[14] = x */ - 15, /* field[15] = y */ + 14, /* field[14] = tr */ + 12, /* field[12] = uF */ + 13, /* field[13] = uH */ + 6, /* field[6] = v */ + 18, /* field[18] = vflag */ + 16, /* field[16] = x */ + 17, /* field[17] = y */ }; static const ProtobufCIntRange scf_epin__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 18 } + { 0, 20 } }; const ProtobufCMessageDescriptor scf_epin__descriptor = { @@ -637,7 +663,7 @@ const ProtobufCMessageDescriptor scf_epin__descriptor = "ScfEpin", "", sizeof(ScfEpin), - 18, + 20, scf_epin__field_descriptors, scf_epin__field_indices_by_name, 1, scf_epin__number_ranges, @@ -695,7 +721,7 @@ const ProtobufCMessageDescriptor scf_econn__descriptor = (ProtobufCMessageInit) scf_econn__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = +static const ProtobufCFieldDescriptor scf_eline__field_descriptors[12] = { { "id", @@ -782,7 +808,7 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 8, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -794,20 +820,44 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "A", + "jv", 9, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ + offsetof(ScfEline, jv), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "a", + 10, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ offsetof(ScfEline, a), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "ja", + 11, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(ScfEline, ja), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, { "vflag", - 10, + 12, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -819,21 +869,23 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = }, }; static const unsigned scf_eline__field_indices_by_name[] = { - 8, /* field[8] = A */ - 7, /* field[7] = V */ + 9, /* field[9] = a */ 2, /* field[2] = c_pins */ 5, /* field[5] = conns */ 4, /* field[4] = dfo */ 3, /* field[3] = flags */ 0, /* field[0] = id */ + 10, /* field[10] = ja */ + 8, /* field[8] = jv */ 6, /* field[6] = lines */ 1, /* field[1] = pins */ - 9, /* field[9] = vflag */ + 7, /* field[7] = v */ + 11, /* field[11] = vflag */ }; static const ProtobufCIntRange scf_eline__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 10 } + { 0, 12 } }; const ProtobufCMessageDescriptor scf_eline__descriptor = { @@ -843,14 +895,14 @@ const ProtobufCMessageDescriptor scf_eline__descriptor = "ScfEline", "", sizeof(ScfEline), - 10, + 12, scf_eline__field_descriptors, scf_eline__field_indices_by_name, 1, scf_eline__number_ranges, (ProtobufCMessageInit) scf_eline__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = +static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[19] = { { "id", @@ -901,7 +953,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 5, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -913,35 +965,59 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "A", + "jv", 6, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ - offsetof(ScfEcomponent, a), + offsetof(ScfEcomponent, jv), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "R", + "a", 7, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ - offsetof(ScfEcomponent, r), + offsetof(ScfEcomponent, a), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "jR", + "ja", 8, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ + offsetof(ScfEcomponent, ja), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "r", + 9, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(ScfEcomponent, r), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "jr", + 10, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ offsetof(ScfEcomponent, jr), NULL, NULL, @@ -950,7 +1026,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "uF", - 9, + 11, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -962,7 +1038,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "uH", - 10, + 12, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -974,7 +1050,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "dfo", - 11, + 13, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT64, 0, /* quantifier_offset */ @@ -986,7 +1062,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "status", - 12, + 14, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -998,7 +1074,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "x", - 13, + 15, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1010,7 +1086,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "y", - 14, + 16, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1022,7 +1098,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "w", - 15, + 17, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1034,7 +1110,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "h", - 16, + 18, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1046,7 +1122,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "vflag", - 17, + 19, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -1058,28 +1134,30 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, }; static const unsigned scf_ecomponent__field_indices_by_name[] = { - 5, /* field[5] = A */ - 6, /* field[6] = R */ - 4, /* field[4] = V */ - 10, /* field[10] = dfo */ - 15, /* field[15] = h */ + 6, /* field[6] = a */ + 12, /* field[12] = dfo */ + 17, /* field[17] = h */ 0, /* field[0] = id */ - 7, /* field[7] = jR */ + 7, /* field[7] = ja */ + 9, /* field[9] = jr */ + 5, /* field[5] = jv */ 2, /* field[2] = model */ 3, /* field[3] = pins */ - 11, /* field[11] = status */ + 8, /* field[8] = r */ + 13, /* field[13] = status */ 1, /* field[1] = type */ - 8, /* field[8] = uF */ - 9, /* field[9] = uH */ - 16, /* field[16] = vflag */ - 14, /* field[14] = w */ - 12, /* field[12] = x */ - 13, /* field[13] = y */ + 10, /* field[10] = uF */ + 11, /* field[11] = uH */ + 4, /* field[4] = v */ + 18, /* field[18] = vflag */ + 16, /* field[16] = w */ + 14, /* field[14] = x */ + 15, /* field[15] = y */ }; static const ProtobufCIntRange scf_ecomponent__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 17 } + { 0, 19 } }; const ProtobufCMessageDescriptor scf_ecomponent__descriptor = { @@ -1089,7 +1167,7 @@ const ProtobufCMessageDescriptor scf_ecomponent__descriptor = "ScfEcomponent", "", sizeof(ScfEcomponent), - 17, + 19, scf_ecomponent__field_descriptors, scf_ecomponent__field_indices_by_name, 1, scf_ecomponent__number_ranges, diff --git a/scf_eda.pb-c.h b/scf_eda.pb-c.h index 6bd25ac..8c58f90 100644 --- a/scf_eda.pb-c.h +++ b/scf_eda.pb-c.h @@ -53,7 +53,9 @@ struct _ScfEpin uint64_t *tos; uint64_t c_lid; double v; + double jv; double a; + double ja; double r; double jr; double uf; @@ -67,7 +69,7 @@ struct _ScfEpin }; #define SCF_EPIN__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_epin__descriptor) \ - , 0, 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } struct _ScfEconn @@ -96,12 +98,14 @@ struct _ScfEline size_t n_lines; ScfLine **lines; double v; + double jv; double a; + double ja; protobuf_c_boolean vflag; }; #define SCF_ELINE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_eline__descriptor) \ - , 0, 0,NULL, 0, 0, 0, 0,NULL, 0,NULL, 0, 0, 0 } + , 0, 0,NULL, 0, 0, 0, 0,NULL, 0,NULL, 0, 0, 0, 0, 0 } struct _ScfEcomponent @@ -113,7 +117,9 @@ struct _ScfEcomponent size_t n_pins; ScfEpin **pins; double v; + double jv; double a; + double ja; double r; double jr; double uf; @@ -128,7 +134,7 @@ struct _ScfEcomponent }; #define SCF_ECOMPONENT__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_ecomponent__descriptor) \ - , 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } struct _ScfEfunction diff --git a/scf_eda.proto b/scf_eda.proto index c68bc6a..94f583e 100644 --- a/scf_eda.proto +++ b/scf_eda.proto @@ -17,20 +17,23 @@ message scf_epin repeated uint64 tos = 5; required uint64 c_lid = 6; - required double V = 7; - required double A = 8; - required double R = 9; - required double jR = 10; - required double uF = 11; - required double uH = 12; - - required double tr = 13; - required double jtr = 14; - - required int32 x = 15; - required int32 y = 16; - required bool vflag = 17; - required bool pflag = 18; + required double v = 7; + required double jv = 8; + required double a = 9; + required double ja = 10; + + required double r = 11; + required double jr = 12; + required double uF = 13; + required double uH = 14; + + required double tr = 15; + required double jtr = 16; + + required int32 x = 17; + required int32 y = 18; + required bool vflag = 19; + required bool pflag = 20; } message scf_econn @@ -50,10 +53,12 @@ message scf_eline repeated scf_econn conns = 6; repeated scf_line lines = 7; - required double V = 8; - required double A = 9; + required double v = 8; + required double jv = 9; + required double a = 10; + required double ja = 11; - required bool vflag = 10; + required bool vflag = 12; } message scf_ecomponent @@ -63,22 +68,25 @@ message scf_ecomponent required uint64 model = 3; repeated scf_epin pins = 4; - required double V = 5; - required double A = 6; - required double R = 7; - required double jR = 8; - required double uF = 9; - required double uH = 10; + required double v = 5; + required double jv = 6; + required double a = 7; + required double ja = 8; - required int64 dfo = 11; - required int32 status = 12; + required double r = 9; + required double jr = 10; + required double uF = 11; + required double uH = 12; - required int32 x = 13; - required int32 y = 14; - required int32 w = 15; - required int32 h = 16; + required int64 dfo = 13; + required int32 status = 14; - required bool vflag = 17; + required int32 x = 15; + required int32 y = 16; + required int32 w = 17; + required int32 h = 18; + + required bool vflag = 19; } message scf_efunction diff --git a/ses_step_va.c b/ses_step_va.c index 9b9e809..3d9860e 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -2,7 +2,7 @@ int _ses_path_cmp(const void* v0, const void* v1); -int __ses_path_jr(ScfEfunction* f, ses_path_t* path) +static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) { if (!path) return -EINVAL; @@ -140,20 +140,84 @@ int __ses_path_jr(ScfEfunction* f, ses_path_t* path) return 0; } +static int __ses_path_va(ScfEfunction* f, ses_path_t* path) +{ + if (!path) + return -EINVAL; + + if (path->pins->size < 2) { + scf_loge("\n"); + return -EINVAL; + } + + ses_path_t* child; + ScfEcomponent* c; + ScfEpin* p; + ScfEpin* p0; + ScfEpin* p1; + ScfEpin* cp0; + ScfEpin* cp1; + + double R; + double r; + double jr; + + int i; + int j; + + r = 0; + jr = 0; + + for (i = 0; i < path->pins->size; i++) { + p = path->pins->data[i]; + scf_loge("i: %d, c%ldp%ld, p->tr: %lg, p->jtr: %lg\n", i, p->cid, p->id, p->tr, p->jtr); + } + printf("\n"); + + if (path->childs) { + + scf_vector_qsort(path->childs, _ses_path_cmp); + + for (i = path->childs->size - 1; i >= 0; i--) { + child = path->childs->data[i]; + + if (child->pins->size < 2) { + scf_loge("\n"); + return -EINVAL; + } + + int ret = __ses_path_jr(f, child); + if (ret < 0) + return ret; + + } + } + + p = path->pins->data[path->pins->size - 1]; + + path->r = p->tr; + path->jr = p->jtr; + + scf_loge("path: %d, r: %lg, jr: %lg, r0: %lg, jr0: %lg\n", + path->index, path->r, path->jr, path->r0, path->jr0); + return 0; +} + static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ctx) { - ses_path_t* path; - ScfEcomponent* c; - ScfEcomponent* B; - ScfEline* el; - ScfEpin* p; + ses_path_t* path; + ScfEcomponent* c; + ScfEcomponent* B; + ScfEline* el; + ScfEpin* p0; + ScfEpin* p1; + ScfEpin* Bp; + ScfEpin* Bn; size_t i; size_t j; size_t k; - B = f->components[0]; - for (i = 0; i < ctx->paths->size; i++) { path = ctx->paths->data[i]; @@ -166,6 +230,46 @@ static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ct printf("\n"); } + B = f->components[0]; + Bp = B->pins[SCF_EDA_Battery_POS]; + Bn = B->pins[SCF_EDA_Battery_NEG]; +#if 0 + for (i = 0; i < ctx->paths->size; i++) { + path = ctx->paths->data[i]; + + scf_logi("i: %ld, path->type: %d\n", i, path->type); + + if (path->pins->size < 2) { + scf_loge("\n"); + return -EINVAL; + } + + p0 = path->pins->data[0]; + p1 = path->pins->data[path->pins->size - 1]; + + if (p0->lid != Bp->lid || p1->lid != Bn->lid) + continue; + + double v = Bp->v - Bn->v; + + double R = path->r * path->r + path->jr * path->jr; + + double a = v * path->r / R; + double ja = -v * path->jr / R; + + for (i = 0; i < path->pins->size; i++) { +// p = path->pins->data[i]; +// scf_loge("i: %d, c%ldp%ld, p->tr: %lg, p->jtr: %lg\n", i, p->cid, p->id, p->tr, p->jtr); + } + + + int ret = __ses_path_va(f, path); + if (ret < 0) + return ret; + + printf("\n"); + } +#endif return 0; } -- 2.25.1