From 35e124277ce4a2e9bcc7c2daab416c5393addb8f Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 11 Jul 2023 14:47:34 +0800 Subject: [PATCH] eda proto --- scf_eda.pb-c.c | 27 ++++++++++++++++++++------- scf_eda.pb-c.h | 3 ++- scf_eda.proto | 5 +++-- scf_eda_pb.h | 2 ++ ses_layout.c | 18 ++++++++++++++++++ 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/scf_eda.pb-c.c b/scf_eda.pb-c.c index e54fe68..288e80f 100644 --- a/scf_eda.pb-c.c +++ b/scf_eda.pb-c.c @@ -552,7 +552,7 @@ const ProtobufCMessageDescriptor scf_econn__descriptor = (ProtobufCMessageInit) scf_econn__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor scf_eline__field_descriptors[4] = +static const ProtobufCFieldDescriptor scf_eline__field_descriptors[5] = { { "id", @@ -579,8 +579,20 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[4] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "conns", + "flags", 3, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(ScfEline, flags), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "conns", + 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(ScfEline, n_conns), @@ -592,7 +604,7 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[4] = }, { "lines", - 4, + 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(ScfEline, n_lines), @@ -604,15 +616,16 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[4] = }, }; static const unsigned scf_eline__field_indices_by_name[] = { - 2, /* field[2] = conns */ + 3, /* field[3] = conns */ + 2, /* field[2] = flags */ 0, /* field[0] = id */ - 3, /* field[3] = lines */ + 4, /* field[4] = lines */ 1, /* field[1] = pins */ }; static const ProtobufCIntRange scf_eline__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 4 } + { 0, 5 } }; const ProtobufCMessageDescriptor scf_eline__descriptor = { @@ -622,7 +635,7 @@ const ProtobufCMessageDescriptor scf_eline__descriptor = "ScfEline", "", sizeof(ScfEline), - 4, + 5, scf_eline__field_descriptors, scf_eline__field_indices_by_name, 1, scf_eline__number_ranges, diff --git a/scf_eda.pb-c.h b/scf_eda.pb-c.h index e88556b..0887977 100644 --- a/scf_eda.pb-c.h +++ b/scf_eda.pb-c.h @@ -77,6 +77,7 @@ struct _ScfEline uint64_t id; size_t n_pins; uint64_t *pins; + uint64_t flags; size_t n_conns; ScfEconn **conns; size_t n_lines; @@ -84,7 +85,7 @@ struct _ScfEline }; #define SCF_ELINE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_eline__descriptor) \ - , 0, 0,NULL, 0,NULL, 0,NULL } + , 0, 0,NULL, 0, 0,NULL, 0,NULL } struct _ScfEcomponent diff --git a/scf_eda.proto b/scf_eda.proto index 8df55a4..4cb5399 100644 --- a/scf_eda.proto +++ b/scf_eda.proto @@ -30,8 +30,9 @@ message scf_eline { required uint64 id = 1; repeated uint64 pins = 2; - repeated scf_econn conns = 3; - repeated scf_line lines = 4; + required uint64 flags = 3; + repeated scf_econn conns = 4; + repeated scf_line lines = 5; } message scf_ecomponent diff --git a/scf_eda_pb.h b/scf_eda_pb.h index 44de155..5414eea 100644 --- a/scf_eda_pb.h +++ b/scf_eda_pb.h @@ -20,6 +20,8 @@ enum { #define SCF_EDA_PIN_NONE 0 #define SCF_EDA_PIN_IN 1 #define SCF_EDA_PIN_OUT 2 +#define SCF_EDA_PIN_POS 4 +#define SCF_EDA_PIN_NEG 8 enum { SCF_EDA_Battery_NEG, diff --git a/ses_layout.c b/ses_layout.c index dc3aa18..8282334 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -402,6 +402,24 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u uint32_t cx = 0; uint32_t cy = 0; + switch (c->type) { + + case SCF_EDA_Battery: + break; + + case SCF_EDA_Resistor: + break; + + case SCF_EDA_Diode: + break; + + case SCF_EDA_Transistor: + break; + + default: + break; + }; + for (j = 0; j < c->n_pins; j++) { p = c->pins[j]; -- 2.25.1