eda proto
authoryu.dongliang <18588496441@163.com>
Tue, 11 Jul 2023 06:47:34 +0000 (14:47 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 11 Jul 2023 06:47:34 +0000 (14:47 +0800)
scf_eda.pb-c.c
scf_eda.pb-c.h
scf_eda.proto
scf_eda_pb.h
ses_layout.c

index e54fe68a9afe8aec80b3a0222628020d45893115..288e80f3e7d95201f33931f575c3ee7dbef24e66 100644 (file)
@@ -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,
index e88556b2710514639540635175376bbcb5311fd4..08879775c24126a8bb73132e6bc8275937880dcd 100644 (file)
@@ -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
index 8df55a4770fa58ce67abb07954a25bd7e5de332b..4cb53997667897df84e37709feb34791c1602d5b 100644 (file)
@@ -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
index 44de155d4b44e2638be146a3bf09aa4a11f623f7..5414eea43889ad29467b51a431e542dd7554d465 100644 (file)
@@ -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,
index dc3aa18bb5184da49b03f7d0a05e00ce60032298..8282334dc493c7e968ea0c328d4c3135dfdfdb26 100644 (file)
@@ -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];