2009-08-03 19:12:47 +03:00
|
|
|
/*
|
|
|
|
* obj.h - Object definition model
|
|
|
|
*
|
2012-05-27 20:09:40 +03:00
|
|
|
* Written 2009-2012 by Werner Almesberger
|
|
|
|
* Copyright 2009-2012 by Werner Almesberger
|
2009-08-03 19:12:47 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef OBJ_H
|
|
|
|
#define OBJ_H
|
|
|
|
|
2009-08-05 03:32:38 +03:00
|
|
|
#include <assert.h>
|
2009-08-03 19:12:47 +03:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "expr.h"
|
|
|
|
#include "coord.h"
|
2009-08-09 03:06:54 +03:00
|
|
|
#include "meas.h"
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
#include "overlap.h"
|
2009-09-13 12:58:30 +03:00
|
|
|
#include "layer.h"
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
|
When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.
With the below changes, table rows and loop iterations are adjusted such that
the instance that was clicked on becomes active. If the algorithm fails, fped
will print "__inst_select: tries exhausted" and fail safely. Please report if
this happens.
- obj.c (search_inst, find_inst, instantiate): added mechanism to search for
instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 04:18:58 +02:00
|
|
|
/*
|
|
|
|
* Objects contain various fields that help to select instances under various
|
|
|
|
* conditions. They are "current", "active", and "found":
|
|
|
|
*
|
|
|
|
* - current: the path taken while instantiating. E.g., we may make one frame
|
|
|
|
* reference the "current" reference of this frame and then recurse into it.
|
|
|
|
* "Current" is reset to a null value after instantiation is complete, to
|
|
|
|
* allow other functions (such as expression evaluation) to distinguish
|
|
|
|
* between instantiation and editing.
|
|
|
|
*
|
|
|
|
* - active: the path selected by the user, through the GUI. This allows the
|
|
|
|
* user to reach any instance, similar to how instantiation visits all
|
|
|
|
* instances. The difference to "current" is that "active" is persistent
|
|
|
|
* across instantiation while "current" iterates through all possible values
|
|
|
|
* during instantiation.
|
|
|
|
*
|
|
|
|
* - found: then clicking on an unselected instance, fped will try to activate
|
|
|
|
* this instance. In order to do so, it needs to determine which choices need
|
|
|
|
* to be activated to reach the instance. "Found" records this information.
|
|
|
|
* At the end of the search, all "found" choices become "active".
|
|
|
|
*
|
|
|
|
* If, during the search, an instance can be reached with the "found" choice
|
|
|
|
* being equal to the choice active at that time, "found" will not be set to
|
|
|
|
* any other value. This prevents searches from affecting choices that play
|
|
|
|
* no role in the selection of the instance.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
struct var {
|
|
|
|
const char *name;
|
|
|
|
struct var *next;
|
|
|
|
|
|
|
|
/* back reference */
|
|
|
|
struct frame *frame;
|
2009-08-06 23:19:00 +03:00
|
|
|
struct table *table; /* NULL if loop */
|
2009-08-03 19:12:47 +03:00
|
|
|
|
2012-05-27 22:10:59 +03:00
|
|
|
|
|
|
|
/* key: 0 if the variable is set, 1 if the variable is compared */
|
|
|
|
int key;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
/* for the GUI */
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
/* for evaluation */
|
|
|
|
int visited;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct value {
|
|
|
|
struct expr *expr;
|
|
|
|
struct value *next;
|
|
|
|
|
2009-12-31 11:34:17 +02:00
|
|
|
/* back reference, NULL if loop */
|
2009-08-03 19:12:47 +03:00
|
|
|
struct row *row;
|
|
|
|
|
|
|
|
/* for the GUI */
|
|
|
|
GtkWidget *widget;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct row {
|
|
|
|
struct value *values;
|
|
|
|
struct row *next;
|
|
|
|
|
|
|
|
/* back reference */
|
|
|
|
struct table *table;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct table {
|
|
|
|
struct var *vars;
|
|
|
|
struct row *rows;
|
|
|
|
struct table *next;
|
|
|
|
|
|
|
|
/* used during generation and when editing */
|
|
|
|
struct row *curr_row;
|
|
|
|
|
|
|
|
/* GUI use */
|
2009-08-03 20:58:32 +03:00
|
|
|
struct row *active_row;
|
When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.
With the below changes, table rows and loop iterations are adjusted such that
the instance that was clicked on becomes active. If the algorithm fails, fped
will print "__inst_select: tries exhausted" and fail safely. Please report if
this happens.
- obj.c (search_inst, find_inst, instantiate): added mechanism to search for
instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 04:18:58 +02:00
|
|
|
|
|
|
|
/* For searching */
|
|
|
|
struct row *found_row; /* NULL if not found yet */
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct loop {
|
|
|
|
struct var var;
|
|
|
|
struct value from;
|
|
|
|
struct value to;
|
|
|
|
struct loop *next;
|
|
|
|
|
|
|
|
/* used during generation */
|
|
|
|
double curr_value;
|
|
|
|
|
|
|
|
/* GUI use */
|
|
|
|
int active; /* n-th iteration is active, 0 based */
|
2009-08-23 01:55:39 +03:00
|
|
|
double n; /* start value when it was active */
|
2009-08-04 01:58:15 +03:00
|
|
|
int iterations; /* iterations when it was active */
|
2009-08-03 19:12:47 +03:00
|
|
|
|
When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.
With the below changes, table rows and loop iterations are adjusted such that
the instance that was clicked on becomes active. If the algorithm fails, fped
will print "__inst_select: tries exhausted" and fail safely. Please report if
this happens.
- obj.c (search_inst, find_inst, instantiate): added mechanism to search for
instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 04:18:58 +02:00
|
|
|
/* For searching */
|
|
|
|
int found; /* -1 if not found yet */
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
/* for evaluation */
|
|
|
|
int initialized;
|
|
|
|
};
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
struct sample;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
struct vec {
|
2011-10-25 22:46:26 +03:00
|
|
|
char nul_tag; /* tag for identifying vectors */
|
2009-08-03 19:12:47 +03:00
|
|
|
const char *name; /* NULL if anonymous */
|
|
|
|
struct expr *x;
|
|
|
|
struct expr *y;
|
|
|
|
struct vec *base; /* NULL if frame */
|
|
|
|
struct vec *next;
|
|
|
|
|
|
|
|
/* used during generation */
|
|
|
|
struct coord pos;
|
|
|
|
|
|
|
|
/* used when editing */
|
|
|
|
struct frame *frame;
|
2009-08-07 16:37:51 +03:00
|
|
|
|
2009-08-17 23:42:51 +03:00
|
|
|
/* index into table of samples */
|
|
|
|
int n;
|
2009-08-12 13:45:52 +03:00
|
|
|
|
2009-11-27 18:23:35 +02:00
|
|
|
/* for re-ordering after a move */
|
|
|
|
int mark;
|
|
|
|
|
2010-04-21 00:01:16 +03:00
|
|
|
/* for dumping */
|
|
|
|
int dumped;
|
|
|
|
|
2009-08-12 13:45:52 +03:00
|
|
|
/* for the GUI */
|
2009-08-14 13:18:40 +03:00
|
|
|
GtkWidget *list_widget; /* NULL if items aren't shown */
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct frame {
|
|
|
|
const char *name; /* NULL if top-level */
|
|
|
|
struct table *tables;
|
|
|
|
struct loop *loops;
|
|
|
|
struct vec *vecs;
|
|
|
|
struct obj *objs;
|
|
|
|
struct frame *next;
|
|
|
|
|
|
|
|
/* used during generation */
|
|
|
|
const struct frame *curr_parent;
|
|
|
|
|
2009-08-04 00:10:49 +03:00
|
|
|
/* generating and editing */
|
|
|
|
struct obj *active_ref;
|
|
|
|
|
The mechanism for selecting points for measurements reaches its limits when
using frames to encapsulate building blocks, e.g., like macros or functions in
a programming language. Since measurements only know about the frame containing
a vector but not the frames containing that frame, invocations of this frame
from different places can only be distinguished within the min/next/max scheme.
(See the example in README.)
To eliminate this limitation, one needs a way to tell fped to consider a point
only if it has been instantiated through a certain path, e.g., by requiring
some other frames to be visited in its instantiation. This increases the number
of distinct points available for measurements.
The mechanism chosen is to qualify a measurement point with frames that lead to
it. This list of outer frames does not have to include all frames. Without
qualifying, the old behaviour results.
Note that this doesn't cover all possible ways in which a point can appear in
different roles. Multiple frame references can also result from repeating the
same frame reference in the same parent frame. The current qualification
mechanism does not allow such paths to be distinguished. However, one can
always introduce intermediate frames for this purpose.
Furthermore, repetitions create multiple instances of a point, although in what
should be considered the same role.
- fpd.l: make scanner support free-format a little better by switching back to
keyword mode after frame braces. This way, one can write a simple frame in a
single line, which is useful for regression tests.
- fpd.l, fpd.y, README, test/dbg_meas: added %meas directive to print the
result of a measurement
- fpd.y, README: measurements can now be labeled. Note that, due to limitations
of the grammar, the first measurement cannot be labeled.
- error.h, error.c (yywarn): new function for non-fatal diagnostics that always
get reported to standard error
- bitset.h, bitset.c: functions to manipulate variable-size bit sets
- meas.h, fpd.y, README, test/meas_qual: added the means to specify qualifiers
for points used in measurements
- dump.c (print_meas_base, print_meas): dump qualifiers
- delete.c (delete_references, test/del_frame): delete measurements that
reference a frame being deleted in their qualifiers
- obj.h, obj.c (enumerate_frames, instantiate): enumerate all frames so that we
have an index into the bit vector of visited frames
- meas.h, meas.c (reset_samples, meas_post), obj.c (generate_vecs,
generate_frame, instantiate): record the set of frames visited for each
sample
- meas.c (meas_post): only treat two instances of a point as equivalent if the
set of frames visited of one of them is a superset of set of the other. In
this case, keep the union of the two sets.
- meas.h, meas.c (meas_find_min, meas_find_next, meas_find_max),
test/meas_qual: instantiate_meas_pkg only select points for which all frames
in the qualification have been visited
- gui_meas.c (is_min, is_next, is_max, is_a_next): updated for above change
- inst.h, inst.c (curr_frame, propagate_bbox, add_inst, inst_begin_frame,
inst_end_frame, inst_start): renamed curr_frame to frame_instantiating to
avoid clash with curr_frame in fpd.y
- inst.h, inst.c (find_meas_hint): make global
- test/structure, test/del_vec, test/del_frame: fped now warns if a measurement
is in an unlinked frame. Changed regressions tests to avoid this warning.
- test/Common: new function expect_grep to compare only part of the output
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5967 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-05-30 00:13:48 +03:00
|
|
|
/* for searching */
|
When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.
With the below changes, table rows and loop iterations are adjusted such that
the instance that was clicked on becomes active. If the algorithm fails, fped
will print "__inst_select: tries exhausted" and fail safely. Please report if
this happens.
- obj.c (search_inst, find_inst, instantiate): added mechanism to search for
instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 04:18:58 +02:00
|
|
|
struct obj *found_ref; /* NULL if not found yet */
|
|
|
|
|
The mechanism for selecting points for measurements reaches its limits when
using frames to encapsulate building blocks, e.g., like macros or functions in
a programming language. Since measurements only know about the frame containing
a vector but not the frames containing that frame, invocations of this frame
from different places can only be distinguished within the min/next/max scheme.
(See the example in README.)
To eliminate this limitation, one needs a way to tell fped to consider a point
only if it has been instantiated through a certain path, e.g., by requiring
some other frames to be visited in its instantiation. This increases the number
of distinct points available for measurements.
The mechanism chosen is to qualify a measurement point with frames that lead to
it. This list of outer frames does not have to include all frames. Without
qualifying, the old behaviour results.
Note that this doesn't cover all possible ways in which a point can appear in
different roles. Multiple frame references can also result from repeating the
same frame reference in the same parent frame. The current qualification
mechanism does not allow such paths to be distinguished. However, one can
always introduce intermediate frames for this purpose.
Furthermore, repetitions create multiple instances of a point, although in what
should be considered the same role.
- fpd.l: make scanner support free-format a little better by switching back to
keyword mode after frame braces. This way, one can write a simple frame in a
single line, which is useful for regression tests.
- fpd.l, fpd.y, README, test/dbg_meas: added %meas directive to print the
result of a measurement
- fpd.y, README: measurements can now be labeled. Note that, due to limitations
of the grammar, the first measurement cannot be labeled.
- error.h, error.c (yywarn): new function for non-fatal diagnostics that always
get reported to standard error
- bitset.h, bitset.c: functions to manipulate variable-size bit sets
- meas.h, fpd.y, README, test/meas_qual: added the means to specify qualifiers
for points used in measurements
- dump.c (print_meas_base, print_meas): dump qualifiers
- delete.c (delete_references, test/del_frame): delete measurements that
reference a frame being deleted in their qualifiers
- obj.h, obj.c (enumerate_frames, instantiate): enumerate all frames so that we
have an index into the bit vector of visited frames
- meas.h, meas.c (reset_samples, meas_post), obj.c (generate_vecs,
generate_frame, instantiate): record the set of frames visited for each
sample
- meas.c (meas_post): only treat two instances of a point as equivalent if the
set of frames visited of one of them is a superset of set of the other. In
this case, keep the union of the two sets.
- meas.h, meas.c (meas_find_min, meas_find_next, meas_find_max),
test/meas_qual: instantiate_meas_pkg only select points for which all frames
in the qualification have been visited
- gui_meas.c (is_min, is_next, is_max, is_a_next): updated for above change
- inst.h, inst.c (curr_frame, propagate_bbox, add_inst, inst_begin_frame,
inst_end_frame, inst_start): renamed curr_frame to frame_instantiating to
avoid clash with curr_frame in fpd.y
- inst.h, inst.c (find_meas_hint): make global
- test/structure, test/del_vec, test/del_frame: fped now warns if a measurement
is in an unlinked frame. Changed regressions tests to avoid this warning.
- test/Common: new function expect_grep to compare only part of the output
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5967 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-05-30 00:13:48 +03:00
|
|
|
/* index into bit vector in samples */
|
|
|
|
int n;
|
|
|
|
|
2009-08-20 01:13:47 +03:00
|
|
|
/* for dumping */
|
|
|
|
int dumped;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
/* for the GUI */
|
|
|
|
GtkWidget *label;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum obj_type {
|
|
|
|
ot_frame,
|
|
|
|
ot_rect,
|
|
|
|
ot_pad,
|
2010-04-25 13:58:07 +03:00
|
|
|
ot_hole,
|
2009-08-03 19:12:47 +03:00
|
|
|
ot_line,
|
|
|
|
ot_arc,
|
|
|
|
ot_meas,
|
2012-05-27 20:09:40 +03:00
|
|
|
ot_iprint,
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
2009-08-04 00:10:49 +03:00
|
|
|
struct frame_ref {
|
|
|
|
struct frame *ref;
|
|
|
|
int lineno;
|
|
|
|
};
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
struct rect {
|
|
|
|
struct vec *other; /* NULL if frame origin */
|
|
|
|
struct expr *width;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pad {
|
|
|
|
char *name;
|
|
|
|
struct vec *other; /* NULL if frame origin */
|
2009-08-14 13:18:40 +03:00
|
|
|
int rounded;
|
2009-08-27 12:45:57 +03:00
|
|
|
enum pad_type type;
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
2010-04-25 13:58:07 +03:00
|
|
|
struct hole {
|
|
|
|
struct vec *other; /* NULL if frame origin */
|
|
|
|
};
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
struct arc {
|
|
|
|
struct vec *start; /* NULL if frame origin */
|
|
|
|
struct vec *end; /* NULL if this is a circle */
|
|
|
|
struct expr *width;
|
|
|
|
};
|
|
|
|
|
2012-05-27 20:09:40 +03:00
|
|
|
struct iprint {
|
|
|
|
struct expr *expr;
|
|
|
|
};
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
struct obj {
|
|
|
|
enum obj_type type;
|
Added debugging directives to the fped language. They're describe at the end
of README.
- fpd.l, fpd.y, README: added debugging directives %del, %move, %print, %dump,
and %exit
- obj.h, fpd.y (find_obj, find_label, new_obj): objects can now be labeled
- obj.c (obj_anchors), inst.c (inst_anchors): gathering the list of anchors is
now a per-object function, not an instance "method". inst_anchors implements
the vector vs. object switch.
- inst.h, inst.c: removed all *_op_anchors functions
- expr.c (str_unit): in the past, we returned a malloc'ed string, but these
times are long gone. Thus, don't stralloc("").
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5919 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-19 17:39:57 +03:00
|
|
|
const char *name; /* NULL if anonymous */
|
2009-08-03 19:12:47 +03:00
|
|
|
union {
|
2009-08-04 00:10:49 +03:00
|
|
|
struct frame_ref frame;
|
2009-08-03 19:12:47 +03:00
|
|
|
struct rect rect;
|
|
|
|
struct rect line;
|
|
|
|
struct pad pad;
|
2010-04-25 13:58:07 +03:00
|
|
|
struct hole hole;
|
2009-08-03 19:12:47 +03:00
|
|
|
struct arc arc;
|
2009-08-09 03:06:54 +03:00
|
|
|
struct meas meas;
|
2012-05-27 20:09:40 +03:00
|
|
|
struct iprint iprint;
|
2009-08-03 19:12:47 +03:00
|
|
|
} u;
|
2009-08-05 03:32:38 +03:00
|
|
|
struct frame *frame;
|
2009-08-03 19:12:47 +03:00
|
|
|
struct vec *base;
|
|
|
|
struct obj *next;
|
2009-08-04 00:10:49 +03:00
|
|
|
int lineno;
|
2009-08-06 07:56:47 +03:00
|
|
|
|
|
|
|
/* for dumping */
|
|
|
|
int dumped;
|
2009-08-12 13:45:52 +03:00
|
|
|
|
|
|
|
/* for the GUI */
|
2009-08-14 13:18:40 +03:00
|
|
|
GtkWidget *list_widget; /* NULL if items are not shown */
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-04-28 03:34:32 +03:00
|
|
|
extern char *pkg_name; /* anonymous common package first */
|
|
|
|
extern struct frame *frames; /* root frame first */
|
2009-08-03 19:12:47 +03:00
|
|
|
extern struct frame *active_frame;
|
2009-08-13 12:30:16 +03:00
|
|
|
extern void *instantiation_error;
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
extern enum allow_overlap allow_overlap;
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
|
When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.
With the below changes, table rows and loop iterations are adjusted such that
the instance that was clicked on becomes active. If the algorithm fails, fped
will print "__inst_select: tries exhausted" and fail safely. Please report if
this happens.
- obj.c (search_inst, find_inst, instantiate): added mechanism to search for
instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 04:18:58 +02:00
|
|
|
struct inst;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Search callback from inst, invoked after the instance has been populated.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void find_inst(const struct inst *inst);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If invoking search_inst before calling "instantiate", loop and tables are
|
|
|
|
* adjusted such that an instance matching the one passed to search_inst will
|
|
|
|
* become active. Note that this doesn't necessarily succeed, in which case no
|
|
|
|
* change is made. Also, if multiple matches are encountered, the result is
|
|
|
|
* arbitrary.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void search_inst(const struct inst *inst);
|
|
|
|
|
Added debugging directives to the fped language. They're describe at the end
of README.
- fpd.l, fpd.y, README: added debugging directives %del, %move, %print, %dump,
and %exit
- obj.h, fpd.y (find_obj, find_label, new_obj): objects can now be labeled
- obj.c (obj_anchors), inst.c (inst_anchors): gathering the list of anchors is
now a per-object function, not an instance "method". inst_anchors implements
the vector vs. object switch.
- inst.h, inst.c: removed all *_op_anchors functions
- expr.c (str_unit): in the past, we returned a malloc'ed string, but these
times are long gone. Thus, don't stralloc("").
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5919 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-19 17:39:57 +03:00
|
|
|
int obj_anchors(struct obj *obj, struct vec ***anchors);
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
int instantiate(void);
|
2009-08-21 11:34:17 +03:00
|
|
|
void obj_cleanup(void);
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
#endif /* !OBJ_H */
|