ses eda pb
authoryu.dongliang <18588496441@163.com>
Sun, 9 Jul 2023 12:46:47 +0000 (20:46 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 9 Jul 2023 12:46:47 +0000 (20:46 +0800)
scf_eda.pb-c.c
scf_eda.pb-c.h
scf_eda.proto
ses_layout.c
ses_layout.h

index 5008b01f8099ff3c08ade784e2684cef21dc9e08..bc7b0c10ae61b5c6bf4b66405d737bf4321721b3 100644 (file)
@@ -732,7 +732,7 @@ const ProtobufCMessageDescriptor scf_ecomponent__descriptor =
   (ProtobufCMessageInit) scf_ecomponent__init,
   NULL,NULL,NULL    /* reserved[123] */
 };
-static const ProtobufCFieldDescriptor scf_efunction__field_descriptors[3] =
+static const ProtobufCFieldDescriptor scf_efunction__field_descriptors[7] =
 {
   {
     "name",
@@ -770,16 +770,68 @@ static const ProtobufCFieldDescriptor scf_efunction__field_descriptors[3] =
     0,             /* flags */
     0,NULL,NULL    /* reserved1,reserved2, etc */
   },
+  {
+    "x",
+    4,
+    PROTOBUF_C_LABEL_REQUIRED,
+    PROTOBUF_C_TYPE_UINT32,
+    0,   /* quantifier_offset */
+    offsetof(ScfEfunction, x),
+    NULL,
+    NULL,
+    0,             /* flags */
+    0,NULL,NULL    /* reserved1,reserved2, etc */
+  },
+  {
+    "y",
+    5,
+    PROTOBUF_C_LABEL_REQUIRED,
+    PROTOBUF_C_TYPE_UINT32,
+    0,   /* quantifier_offset */
+    offsetof(ScfEfunction, y),
+    NULL,
+    NULL,
+    0,             /* flags */
+    0,NULL,NULL    /* reserved1,reserved2, etc */
+  },
+  {
+    "w",
+    6,
+    PROTOBUF_C_LABEL_REQUIRED,
+    PROTOBUF_C_TYPE_UINT32,
+    0,   /* quantifier_offset */
+    offsetof(ScfEfunction, w),
+    NULL,
+    NULL,
+    0,             /* flags */
+    0,NULL,NULL    /* reserved1,reserved2, etc */
+  },
+  {
+    "h",
+    7,
+    PROTOBUF_C_LABEL_REQUIRED,
+    PROTOBUF_C_TYPE_UINT32,
+    0,   /* quantifier_offset */
+    offsetof(ScfEfunction, h),
+    NULL,
+    NULL,
+    0,             /* flags */
+    0,NULL,NULL    /* reserved1,reserved2, etc */
+  },
 };
 static const unsigned scf_efunction__field_indices_by_name[] = {
   1,   /* field[1] = components */
   2,   /* field[2] = elines */
+  6,   /* field[6] = h */
   0,   /* field[0] = name */
+  5,   /* field[5] = w */
+  3,   /* field[3] = x */
+  4,   /* field[4] = y */
 };
 static const ProtobufCIntRange scf_efunction__number_ranges[1 + 1] =
 {
   { 1, 0 },
-  { 0, 3 }
+  { 0, 7 }
 };
 const ProtobufCMessageDescriptor scf_efunction__descriptor =
 {
@@ -789,7 +841,7 @@ const ProtobufCMessageDescriptor scf_efunction__descriptor =
   "ScfEfunction",
   "",
   sizeof(ScfEfunction),
-  3,
+  7,
   scf_efunction__field_descriptors,
   scf_efunction__field_indices_by_name,
   1,  scf_efunction__number_ranges,
index fc07cdea622d974a5d6989db151150dce1c31471..8a31fb664ac778f0d3e1d9139b8eb69a91d8862a 100644 (file)
@@ -111,10 +111,14 @@ struct  _ScfEfunction
   ScfEcomponent **components;
   size_t n_elines;
   ScfEline **elines;
+  uint32_t x;
+  uint32_t y;
+  uint32_t w;
+  uint32_t h;
 };
 #define SCF_EFUNCTION__INIT \
  { PROTOBUF_C_MESSAGE_INIT (&scf_efunction__descriptor) \
-    , NULL, 0,NULL, 0,NULL }
+    , NULL, 0,NULL, 0,NULL, 0, 0, 0, 0 }
 
 
 struct  _ScfEboard
index 6d7b80322996ef22f83bf775f1423f2ce9b9bf3b..bb701889918f97a2c39a80494c7116f55c3c87a9 100644 (file)
@@ -50,6 +50,11 @@ message scf_efunction
        required string         name       = 1;
        repeated scf_ecomponent components = 2;
        repeated scf_eline      elines     = 3;
+
+       required uint32    x    = 4;
+       required uint32    y    = 5;
+       required uint32    w    = 6;
+       required uint32    h    = 7;
 }
 
 message scf_eboard
index 1170d20534af7c7a855f3dcaf1d3dce7229396d7..0cbdc4567e13a7ebcfd412cb5457dc88260d2442 100644 (file)
@@ -25,16 +25,16 @@ int eline_cmp(const void* v0, const void* v1)
        const ScfEline* el0 = *(const ScfEline**)v0;
        const ScfEline* el1 = *(const ScfEline**)v1;
 
-       if (el0->n_conns < el1->n_conns)
+       if (el0->n_pins < el1->n_pins)
                return 1;
 
-       if (el0->n_conns > el1->n_conns)
+       if (el0->n_pins > el1->n_pins)
                return -1;
 
-       if (el0->n_pins < el1->n_pins)
+       if (el0->n_conns < el1->n_conns)
                return 1;
 
-       if (el0->n_pins > el1->n_pins)
+       if (el0->n_conns > el1->n_conns)
                return -1;
 
        return 0;
@@ -216,6 +216,22 @@ int ses_lines_same_components(ScfEfunction* f)
        return 0;
 }
 
+int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, uint32_t bw, uint32_t bh)
+{
+       ScfEline* el;
+       ScfEconn* ec;
+
+       size_t i;
+       size_t j;
+
+       for (i = 0; i < f->n_elines; i++) {
+               el =        f->elines[i];
+
+       }
+
+       return 0;
+}
+
 int ses_layout_draw()
 {
        cairo_surface_t *surface;
@@ -240,7 +256,7 @@ int ses_layout_draw()
        return 0;
 }
 
-int ses_layout_board(ScfEboard* b, int x, int y, int w, int h)
+int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
 {
        ScfEcomponent* c;
        ScfEfunction*  f;
index 28602bf81235a8970f71ea7ff9070c9e8aa9100c..a53b7578e3f9ebeca14fbf7f466063c6e9c62ddf 100644 (file)
@@ -5,6 +5,6 @@
 #include"scf_eda_pb.h"
 #include"scf_vector.h"
 
-int ses_layout_board(ScfEboard* b, int x, int y, int w, int h);
+int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t h);
 
 #endif