2009-08-03 19:12:47 +03:00
|
|
|
%{
|
|
|
|
/*
|
|
|
|
* fpd.y - FootPrint Definition language
|
|
|
|
*
|
2011-01-18 02:30:57 +02:00
|
|
|
* Written 2009-2011 by Werner Almesberger
|
|
|
|
* Copyright 2009-2011 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2009-08-27 12:45:57 +03:00
|
|
|
#include <string.h>
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
#include "error.h"
|
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
|
|
|
#include "coord.h"
|
2009-08-03 19:12:47 +03:00
|
|
|
#include "expr.h"
|
|
|
|
#include "obj.h"
|
2009-08-07 16:37:51 +03:00
|
|
|
#include "meas.h"
|
2009-08-22 18:58:58 +03:00
|
|
|
#include "gui_status.h"
|
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
|
|
|
#include "gui_inst.h" /* for %meas */
|
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
|
|
|
#include "dump.h"
|
2010-04-26 18:18:01 +03:00
|
|
|
#include "tsort.h"
|
2009-08-16 07:12:37 +03:00
|
|
|
#include "fpd.h"
|
2009-08-03 19:12:47 +03:00
|
|
|
|
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
|
|
|
#include "y.tab.h"
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
|
2009-08-16 07:12:37 +03:00
|
|
|
struct expr *expr_result;
|
|
|
|
const char *var_id;
|
|
|
|
struct value *var_value_list;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
static struct frame *curr_frame;
|
|
|
|
static struct table *curr_table;
|
|
|
|
static struct row *curr_row;
|
|
|
|
|
|
|
|
static struct vec *last_vec = NULL;
|
|
|
|
|
|
|
|
static struct table **next_table;
|
|
|
|
static struct loop **next_loop;
|
|
|
|
static struct vec **next_vec;
|
|
|
|
static struct obj **next_obj;
|
|
|
|
|
|
|
|
static int n_vars, n_values;
|
|
|
|
|
2009-12-01 14:43:59 +02:00
|
|
|
static const char *id_sin, *id_cos, *id_sqrt;
|
|
|
|
|
2010-04-26 18:18:01 +03:00
|
|
|
static struct tsort *tsort;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
|
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
|
|
|
/* ----- lookup functions -------------------------------------------------- */
|
|
|
|
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
static struct frame *find_frame(const char *name)
|
|
|
|
{
|
|
|
|
struct frame *f;
|
|
|
|
|
2010-04-28 03:34:32 +03:00
|
|
|
for (f = frames->next; f; f = f->next)
|
2009-08-03 19:12:47 +03:00
|
|
|
if (f->name == name)
|
|
|
|
return f;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
static struct vec *find_vec(const struct frame *frame, const char *name)
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
|
|
|
struct vec *v;
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
for (v = frame->vecs; v; v = v->next)
|
2009-08-03 19:12:47 +03:00
|
|
|
if (v->name == name)
|
|
|
|
return v;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
static struct obj *find_obj(const struct frame *frame, const char *name)
|
|
|
|
{
|
|
|
|
struct obj *obj;
|
|
|
|
|
|
|
|
for (obj = frame->objs; obj; obj = obj->next)
|
|
|
|
if (obj->name == name)
|
|
|
|
return obj;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int find_label(const struct frame *frame, const char *name)
|
|
|
|
{
|
|
|
|
if (find_vec(frame, name))
|
|
|
|
return 1;
|
|
|
|
if (find_obj(frame, name))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-31 18:24:23 +02:00
|
|
|
static struct var *find_var(const struct frame *frame, const char *name)
|
|
|
|
{
|
|
|
|
const struct table *table;
|
|
|
|
struct var *var;
|
|
|
|
struct loop *loop;
|
|
|
|
|
|
|
|
for (table = frame->tables; table; table = table->next)
|
|
|
|
for (var = table->vars; var; var = var->next)
|
|
|
|
if (var->name == name)
|
|
|
|
return var;
|
|
|
|
for (loop = frame->loops; loop; loop = loop->next)
|
|
|
|
if (loop->var.name == name)
|
|
|
|
return &loop->var;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
/* ----- item creation ----------------------------------------------------- */
|
|
|
|
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
static void set_frame(struct frame *frame)
|
|
|
|
{
|
|
|
|
curr_frame = frame;
|
|
|
|
next_table = &frame->tables;
|
|
|
|
next_loop = &frame->loops;
|
|
|
|
next_vec = &frame->vecs;
|
|
|
|
next_obj = &frame->objs;
|
|
|
|
last_vec = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void make_var(const char *id, struct expr *expr)
|
|
|
|
{
|
|
|
|
struct table *table;
|
|
|
|
|
|
|
|
table = zalloc_type(struct table);
|
|
|
|
table->vars = zalloc_type(struct var);
|
|
|
|
table->vars->name = id;
|
|
|
|
table->vars->frame = curr_frame;
|
2009-08-06 23:19:00 +03:00
|
|
|
table->vars->table = table;
|
2009-08-03 19:12:47 +03:00
|
|
|
table->rows = zalloc_type(struct row);
|
2009-08-04 00:10:49 +03:00
|
|
|
table->rows->table = table;
|
2009-08-03 19:12:47 +03:00
|
|
|
table->rows->values = zalloc_type(struct value);
|
|
|
|
table->rows->values->expr = expr;
|
|
|
|
table->rows->values->row = table->rows;
|
2009-08-04 00:10:49 +03:00
|
|
|
table->active_row = table->rows;
|
2009-08-03 19:12:47 +03:00
|
|
|
*next_table = table;
|
|
|
|
next_table = &table->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void make_loop(const char *id, struct expr *from, struct expr *to)
|
|
|
|
{
|
|
|
|
struct loop *loop;
|
|
|
|
|
|
|
|
loop = alloc_type(struct loop);
|
|
|
|
loop->var.name = id;
|
|
|
|
loop->var.next = NULL;
|
|
|
|
loop->var.frame = curr_frame;
|
2009-08-06 23:19:00 +03:00
|
|
|
loop->var.table = NULL;
|
2009-08-03 19:12:47 +03:00
|
|
|
loop->from.expr = from;
|
|
|
|
loop->from.row = NULL;
|
|
|
|
loop->from.next = NULL;
|
|
|
|
loop->to.expr = to;
|
|
|
|
loop->to.row = NULL;
|
|
|
|
loop->to.next = NULL;
|
|
|
|
loop->next = NULL;
|
|
|
|
loop->active = 0;
|
|
|
|
loop->initialized = 0;
|
|
|
|
*next_loop = loop;
|
|
|
|
next_loop = &loop->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct obj *new_obj(enum obj_type type)
|
|
|
|
{
|
|
|
|
struct obj *obj;
|
|
|
|
|
|
|
|
obj = alloc_type(struct obj);
|
|
|
|
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
|
|
|
obj->name = NULL;
|
2009-08-05 03:32:38 +03:00
|
|
|
obj->frame = curr_frame;
|
2009-08-03 19:12:47 +03:00
|
|
|
obj->next = NULL;
|
2009-09-13 14:11:03 +03:00
|
|
|
obj->lineno = lineno;
|
2009-08-03 19:12:47 +03:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
/* ---- frame qualifiers --------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
|
|
static int duplicate_qualifier(const struct frame_qual *a,
|
|
|
|
const struct frame_qual *b)
|
|
|
|
{
|
|
|
|
if (!b)
|
|
|
|
return 0;
|
|
|
|
if (a != b && a->frame == b->frame) {
|
|
|
|
yyerrorf("duplicate qualifier \"%s\"", a->frame->name);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (b && duplicate_qualifier(a, b->next))
|
|
|
|
return 1;
|
|
|
|
return duplicate_qualifier(a->next, a->next);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int can_reach(const struct frame *curr, const struct frame_qual *qual,
|
|
|
|
const struct frame *end)
|
|
|
|
{
|
|
|
|
const struct obj *obj;
|
|
|
|
|
|
|
|
if (curr == end)
|
|
|
|
return !qual;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Don't recurse for removing the qualifier alone. We require a frame
|
|
|
|
* reference step as well, so that things like foo.foo.foo.bar.vec
|
|
|
|
* aren't allowed.
|
|
|
|
*
|
|
|
|
* Since a duplicate qualifier can never work, we test for this error
|
|
|
|
* explicitly in "duplicate_qualifier".
|
|
|
|
*/
|
|
|
|
if (qual && curr == qual->frame)
|
|
|
|
qual = qual->next;
|
|
|
|
|
|
|
|
for (obj = curr->objs; obj; obj = obj->next)
|
|
|
|
if (obj->type == ot_frame)
|
|
|
|
if (can_reach(obj->u.frame.ref, qual, end))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int check_qbase(struct qbase *qbase)
|
|
|
|
{
|
|
|
|
if (duplicate_qualifier(qbase->qualifiers, qbase->qualifiers))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (!can_reach(frames, qbase->qualifiers, qbase->vec->frame))
|
|
|
|
yywarn("not all qualifiers can be reached");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ----- debugging directives ---------------------------------------------- */
|
|
|
|
|
|
|
|
|
2010-04-28 01:36:46 +03:00
|
|
|
static int dbg_delete(const char *frame_name, const char *name)
|
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
|
|
|
{
|
|
|
|
struct vec *vec;
|
|
|
|
struct obj *obj;
|
2010-04-28 01:36:46 +03:00
|
|
|
struct frame *frame;
|
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
|
|
|
|
2010-04-28 01:36:46 +03:00
|
|
|
if (!frame_name)
|
|
|
|
frame = curr_frame;
|
|
|
|
else {
|
|
|
|
frame = find_frame(frame_name);
|
|
|
|
if (!frame) {
|
|
|
|
yyerrorf("unknown frame \"%s\"", frame_name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vec = find_vec(frame, name);
|
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
|
|
|
if (vec) {
|
|
|
|
delete_vec(vec);
|
|
|
|
return 1;
|
|
|
|
}
|
2010-04-28 01:36:46 +03:00
|
|
|
obj = find_obj(frame, name);
|
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
|
|
|
if (obj) {
|
|
|
|
delete_obj(obj);
|
|
|
|
return 1;
|
|
|
|
}
|
2010-04-28 01:36:46 +03:00
|
|
|
if (!frame_name) {
|
|
|
|
frame = find_frame(name);
|
|
|
|
if (frame) {
|
|
|
|
if (curr_frame == frame) {
|
|
|
|
yyerrorf("a frame can't delete itself");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
delete_frame(frame);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (frame_name)
|
|
|
|
yyerrorf("unknown item \"%s.%s\"", frame_name, name);
|
|
|
|
else
|
|
|
|
yyerrorf("unknown item \"%s\"", name);
|
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
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dbg_move(const char *name, int anchor, const char *dest)
|
|
|
|
{
|
|
|
|
struct vec *to, *vec;
|
|
|
|
struct obj *obj;
|
|
|
|
struct vec **anchors[3];
|
|
|
|
int n_anchors;
|
|
|
|
|
|
|
|
to = find_vec(curr_frame, dest);
|
|
|
|
if (!to) {
|
|
|
|
yyerrorf("unknown vector \"%s\"", dest);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
vec = find_vec(curr_frame, name);
|
|
|
|
if (vec) {
|
|
|
|
if (anchor) {
|
|
|
|
yyerrorf("invalid anchor (%d > 0)", anchor);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
vec->base = to;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
obj = find_obj(curr_frame, name);
|
|
|
|
if (!obj) {
|
|
|
|
yyerrorf("unknown item \"%s\"", name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
n_anchors = obj_anchors(obj, anchors);
|
|
|
|
if (anchor >= n_anchors) {
|
|
|
|
yyerrorf("invalid anchor (%d > %d)", anchor, n_anchors-1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*anchors[anchor] = to;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-27 04:02:24 +03:00
|
|
|
/*
|
|
|
|
* @@@ This is very similar to what we do in rule "obj". Consider merging.
|
|
|
|
*/
|
|
|
|
|
2010-04-28 01:36:46 +03:00
|
|
|
/*
|
|
|
|
* We need to pass base_frame and base_vec, not just the vector (with the
|
|
|
|
* frame implied) since we can also reference the frame's origin, whose
|
|
|
|
* "vector" is NULL.
|
|
|
|
*/
|
|
|
|
|
2010-04-27 04:02:24 +03:00
|
|
|
static int dbg_link_frame(const char *frame_name,
|
|
|
|
struct frame *base_frame, struct vec *base_vec)
|
|
|
|
{
|
|
|
|
struct frame *frame;
|
|
|
|
struct obj *obj;
|
|
|
|
|
2010-04-28 01:36:46 +03:00
|
|
|
assert(!base_vec || base_vec->frame == base_frame);
|
2010-04-27 04:02:24 +03:00
|
|
|
frame = find_frame(frame_name);
|
|
|
|
if (!frame) {
|
|
|
|
yyerrorf("unknown frame \"%s\"", frame_name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* this can only fail in %frame */
|
|
|
|
if (is_parent_of(frame, base_frame)) {
|
|
|
|
yyerrorf("frame \"%s\" is a parent of \"%s\"",
|
|
|
|
frame->name, base_frame->name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
obj = new_obj(ot_frame);
|
|
|
|
obj->base = base_vec;
|
|
|
|
obj->frame = base_frame;
|
|
|
|
obj->u.frame.ref = frame;
|
|
|
|
connect_obj(base_frame, obj);
|
|
|
|
if (!frame->active_ref)
|
|
|
|
frame->active_ref = obj;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
static int dbg_print(const struct expr *expr)
|
|
|
|
{
|
|
|
|
const char *s;
|
|
|
|
struct num num;
|
|
|
|
|
|
|
|
s = eval_str(expr, curr_frame);
|
|
|
|
if (s) {
|
|
|
|
printf("%s\n", s);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
num = eval_num(expr, curr_frame);
|
|
|
|
if (is_undef(num))
|
|
|
|
return 0;
|
|
|
|
printf("%lg%s\n", num.n, str_unit(num));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
static int dbg_meas(const char *name)
|
|
|
|
{
|
|
|
|
const struct obj *obj;
|
|
|
|
const struct inst *inst;
|
|
|
|
struct coord a1, b1;
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
obj = find_obj(frames, name);
|
|
|
|
if (!obj) {
|
|
|
|
yyerrorf("unknown object \"%s\"", name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* from fped.c:main */
|
|
|
|
|
|
|
|
if (!pkg_name)
|
|
|
|
pkg_name = stralloc("_");
|
|
|
|
reporter = report_to_stderr;
|
|
|
|
if (!instantiate())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
inst = find_meas_hint(obj);
|
|
|
|
if (!inst) {
|
|
|
|
yyerrorf("measurement \"%s\" was not instantiated", name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
project_meas(inst, &a1, &b1);
|
|
|
|
s = format_len(obj->u.meas.label ? obj->u.meas.label : "",
|
|
|
|
dist_point(a1, b1), curr_unit);
|
|
|
|
printf("%s\n", s);
|
|
|
|
free(s);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
%union {
|
|
|
|
struct num num;
|
|
|
|
char *str;
|
|
|
|
const char *id;
|
|
|
|
struct expr *expr;
|
|
|
|
struct frame *frame;
|
|
|
|
struct table *table;
|
|
|
|
struct var *var;
|
|
|
|
struct row *row;
|
|
|
|
struct value *value;
|
|
|
|
struct vec *vec;
|
|
|
|
struct obj *obj;
|
2009-08-27 12:45:57 +03:00
|
|
|
enum pad_type pt;
|
2009-08-07 16:37:51 +03:00
|
|
|
enum meas_type mt;
|
|
|
|
struct {
|
|
|
|
int inverted;
|
|
|
|
int max;
|
|
|
|
} mo;
|
2010-04-27 04:02:24 +03:00
|
|
|
struct {
|
|
|
|
struct frame *frame;
|
|
|
|
struct vec *vec;
|
|
|
|
} qvec;
|
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
|
|
|
struct qbase {
|
|
|
|
struct vec *vec;
|
|
|
|
struct frame_qual *qualifiers;
|
|
|
|
} qbase;
|
2009-08-03 19:12:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-08-16 08:05:12 +03:00
|
|
|
%token START_FPD START_EXPR START_VAR START_VALUES
|
2009-08-17 23:42:51 +03:00
|
|
|
%token TOK_SET TOK_LOOP TOK_PACKAGE TOK_FRAME TOK_TABLE TOK_VEC
|
2010-04-25 13:58:07 +03:00
|
|
|
%token TOK_PAD TOK_RPAD TOK_HOLE TOK_RECT TOK_LINE TOK_CIRC TOK_ARC
|
2009-08-22 18:58:58 +03:00
|
|
|
%token TOK_MEAS TOK_MEASX TOK_MEASY TOK_UNIT
|
2009-08-07 16:37:51 +03:00
|
|
|
%token TOK_NEXT TOK_NEXT_INVERTED TOK_MAX TOK_MAX_INVERTED
|
2010-04-27 04:02:24 +03:00
|
|
|
%token TOK_DBG_DEL TOK_DBG_MOVE TOK_DBG_FRAME TOK_DBG_PRINT
|
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
|
|
|
%token TOK_DBG_DUMP TOK_DBG_EXIT TOK_DBG_TSORT TOK_DBG_MEAS
|
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
|
|
|
%token TOK_ALLOW_OVERLAP TOK_ALLOW_TOUCH
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
%token <num> NUMBER
|
|
|
|
%token <str> STRING
|
|
|
|
%token <id> ID LABEL
|
|
|
|
|
|
|
|
%type <table> table
|
|
|
|
%type <var> vars var
|
|
|
|
%type <row> rows
|
2009-08-16 07:12:37 +03:00
|
|
|
%type <value> row value opt_value_list
|
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
|
|
|
%type <vec> vec base
|
|
|
|
%type <obj> object obj meas unlabeled_meas
|
2009-08-03 19:12:47 +03:00
|
|
|
%type <expr> expr opt_expr add_expr mult_expr unary_expr primary_expr
|
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
|
|
|
%type <num> opt_num
|
2010-04-27 04:02:24 +03:00
|
|
|
%type <frame> frame_qualifier
|
2009-08-07 16:37:51 +03:00
|
|
|
%type <str> opt_string
|
2009-08-27 12:45:57 +03:00
|
|
|
%type <pt> pad_type
|
2009-08-07 16:37:51 +03:00
|
|
|
%type <mt> meas_type
|
|
|
|
%type <mo> meas_op
|
2010-04-27 04:02:24 +03:00
|
|
|
%type <qvec> qualified_base
|
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
|
|
|
%type <qbase> qbase qbase_unchecked
|
2009-08-03 19:12:47 +03:00
|
|
|
|
|
|
|
%%
|
|
|
|
|
|
|
|
all:
|
2009-08-07 03:48:06 +03:00
|
|
|
START_FPD
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
2010-04-28 03:34:32 +03:00
|
|
|
frames = zalloc_type(struct frame);
|
|
|
|
set_frame(frames);
|
2009-12-01 14:43:59 +02:00
|
|
|
id_sin = unique("sin");
|
|
|
|
id_cos = unique("cos");
|
|
|
|
id_sqrt = unique("sqrt");
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
2009-08-07 03:48:06 +03:00
|
|
|
fpd
|
|
|
|
| START_EXPR expr
|
|
|
|
{
|
|
|
|
expr_result = $2;
|
|
|
|
}
|
2009-08-16 07:12:37 +03:00
|
|
|
| START_VAR ID opt_value_list
|
|
|
|
{
|
|
|
|
var_id = $2;
|
|
|
|
var_value_list = $3;
|
|
|
|
}
|
2009-08-16 08:05:12 +03:00
|
|
|
| START_VALUES row
|
|
|
|
{
|
|
|
|
var_value_list = $2;
|
|
|
|
}
|
2009-08-07 03:48:06 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
fpd:
|
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
|
|
|
frame_defs part_name opt_setup opt_frame_items opt_measurements
|
|
|
|
| frame_defs setup opt_frame_items opt_measurements
|
2010-04-27 02:11:22 +03:00
|
|
|
| frame_defs frame_items opt_measurements
|
|
|
|
| frame_defs opt_measurements
|
2009-08-03 19:12:47 +03:00
|
|
|
;
|
|
|
|
|
2009-08-06 09:54:41 +03:00
|
|
|
part_name:
|
2009-08-17 23:42:51 +03:00
|
|
|
TOK_PACKAGE STRING
|
2009-08-06 09:54:41 +03:00
|
|
|
{
|
|
|
|
const char *p;
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
if (!*$2) {
|
2009-08-17 23:42:51 +03:00
|
|
|
yyerrorf("invalid package name");
|
2009-08-06 09:54:41 +03:00
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
for (p = $2; *p; *p++)
|
2009-08-15 01:12:16 +03:00
|
|
|
if (*p < 32 || *p > 126) {
|
2009-08-17 23:42:51 +03:00
|
|
|
yyerrorf("invalid package name");
|
2009-08-06 09:54:41 +03:00
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-17 23:42:51 +03:00
|
|
|
pkg_name = $2;
|
2009-08-06 09:54:41 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
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
|
|
|
opt_setup:
|
|
|
|
| setup
|
|
|
|
;
|
|
|
|
|
|
|
|
setup:
|
|
|
|
unit
|
|
|
|
| allow
|
|
|
|
| unit allow
|
|
|
|
| allow unit
|
2010-04-27 02:11:22 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
unit:
|
|
|
|
TOK_UNIT ID
|
2009-08-22 18:58:58 +03:00
|
|
|
{
|
|
|
|
if (!strcmp($2, "mm"))
|
|
|
|
curr_unit = curr_unit_mm;
|
|
|
|
else if (!strcmp($2, "mil"))
|
|
|
|
curr_unit = curr_unit_mil;
|
|
|
|
else if (!strcmp($2, "auto"))
|
|
|
|
curr_unit = curr_unit_auto;
|
|
|
|
else {
|
|
|
|
yyerrorf("unrecognized unit \"%s\"", $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
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
|
|
|
allow:
|
|
|
|
TOK_ALLOW_TOUCH
|
|
|
|
{
|
|
|
|
allow_overlap = ao_touch;
|
|
|
|
}
|
|
|
|
| TOK_ALLOW_OVERLAP
|
|
|
|
{
|
|
|
|
allow_overlap = ao_any;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
frame_defs:
|
|
|
|
| frame_defs frame_def
|
|
|
|
;
|
|
|
|
|
|
|
|
frame_def:
|
|
|
|
TOK_FRAME ID '{'
|
|
|
|
{
|
|
|
|
if (find_frame($2)) {
|
|
|
|
yyerrorf("duplicate frame \"%s\"", $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
curr_frame = zalloc_type(struct frame);
|
|
|
|
curr_frame->name = $2;
|
|
|
|
set_frame(curr_frame);
|
2010-04-28 03:34:32 +03:00
|
|
|
curr_frame->next = frames->next;
|
|
|
|
frames->next = curr_frame;
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
2010-04-27 02:11:22 +03:00
|
|
|
opt_frame_items '}'
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
2010-04-28 03:34:32 +03:00
|
|
|
set_frame(frames);
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2010-04-27 02:11:22 +03:00
|
|
|
opt_frame_items:
|
|
|
|
| frame_items
|
|
|
|
;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
frame_items:
|
2010-04-27 02:11:22 +03:00
|
|
|
frame_item
|
2009-08-03 19:12:47 +03:00
|
|
|
| frame_item frame_items
|
|
|
|
;
|
|
|
|
|
|
|
|
frame_item:
|
|
|
|
table
|
|
|
|
| TOK_SET ID '=' expr
|
|
|
|
{
|
2009-12-31 18:24:23 +02:00
|
|
|
if (find_var(curr_frame, $2)) {
|
|
|
|
yyerrorf("duplicate variable \"%s\"", $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
make_var($2, $4);
|
|
|
|
}
|
|
|
|
| TOK_LOOP ID '=' expr ',' expr
|
|
|
|
{
|
2009-12-31 18:24:23 +02:00
|
|
|
if (find_var(curr_frame, $2)) {
|
|
|
|
yyerrorf("duplicate variable \"%s\"", $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
make_loop($2, $4, $6);
|
|
|
|
}
|
|
|
|
| vec
|
|
|
|
| LABEL vec
|
|
|
|
{
|
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
|
|
|
if (find_label(curr_frame, $1)) {
|
|
|
|
yyerrorf("duplicate label \"%s\"", $1);
|
2009-08-03 19:12:47 +03:00
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
$2->name = $1;
|
|
|
|
}
|
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
|
|
|
| object
|
|
|
|
| LABEL object
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
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
|
|
|
if (find_label(curr_frame, $1)) {
|
|
|
|
yyerrorf("duplicate label \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
$2->name = $1;
|
|
|
|
}
|
2010-04-28 01:36:46 +03:00
|
|
|
| debug_item
|
|
|
|
;
|
|
|
|
|
|
|
|
debug_item:
|
|
|
|
TOK_DBG_DEL ID
|
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
|
|
|
{
|
2010-04-28 01:36:46 +03:00
|
|
|
if (!dbg_delete(NULL, $2))
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
| TOK_DBG_DEL ID '.' ID
|
|
|
|
{
|
|
|
|
if (!dbg_delete($2, $4))
|
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
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
| TOK_DBG_MOVE ID opt_num ID
|
|
|
|
{
|
|
|
|
if (!dbg_move($2, $3.n, $4))
|
|
|
|
YYABORT;
|
|
|
|
}
|
2010-04-27 04:02:24 +03:00
|
|
|
| TOK_DBG_FRAME ID qualified_base
|
|
|
|
{
|
|
|
|
if (!dbg_link_frame($2, $3.frame, $3.vec))
|
|
|
|
YYABORT;
|
|
|
|
}
|
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
|
|
|
| TOK_DBG_PRINT expr
|
|
|
|
{
|
|
|
|
if (!dbg_print($2))
|
|
|
|
YYABORT;
|
|
|
|
}
|
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
|
|
|
| TOK_DBG_MEAS ID
|
|
|
|
{
|
|
|
|
if (!dbg_meas($2))
|
|
|
|
YYABORT;
|
|
|
|
}
|
2010-04-28 01:36:46 +03:00
|
|
|
| TOK_DBG_DUMP
|
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
|
|
|
{
|
2011-03-23 10:25:22 +02:00
|
|
|
if (!dump(stdout, NULL)) {
|
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
|
|
|
perror("stdout");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
| TOK_DBG_EXIT
|
|
|
|
{
|
|
|
|
exit(0);
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
2010-04-26 18:18:01 +03:00
|
|
|
| TOK_DBG_TSORT '{'
|
|
|
|
{
|
|
|
|
tsort = begin_tsort();
|
|
|
|
}
|
|
|
|
sort_items '}'
|
|
|
|
{
|
|
|
|
void **sort, **walk;
|
|
|
|
|
|
|
|
sort = end_tsort(tsort);
|
|
|
|
for (walk = sort; *walk; walk++)
|
|
|
|
printf("%s\n", (char *) *walk);
|
|
|
|
free(sort);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
sort_items:
|
|
|
|
| sort_items '+' ID
|
|
|
|
{
|
|
|
|
add_node(tsort, (void *) $3, 0);
|
|
|
|
}
|
|
|
|
| sort_items '-' ID
|
|
|
|
{
|
|
|
|
add_node(tsort, (void *) $3, 1);
|
|
|
|
}
|
|
|
|
| sort_items ID ID opt_num
|
|
|
|
{
|
|
|
|
struct node *a, *b;
|
|
|
|
|
|
|
|
/* order is important here ! */
|
|
|
|
a = add_node(tsort, (void *) $2, 0);
|
|
|
|
b = add_node(tsort, (void *) $3, 0);
|
|
|
|
add_edge(a, b, $4.n);
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
table:
|
|
|
|
TOK_TABLE
|
|
|
|
{
|
|
|
|
$<table>$ = zalloc_type(struct table);
|
|
|
|
*next_table = $<table>$;
|
|
|
|
curr_table = $<table>$;
|
|
|
|
n_vars = 0;
|
|
|
|
}
|
|
|
|
'{' vars '}' rows
|
|
|
|
{
|
|
|
|
$$ = $<table>2;
|
|
|
|
$$->vars = $4;
|
|
|
|
$$->rows = $6;
|
2009-08-03 20:58:32 +03:00
|
|
|
$$->active_row = $6;
|
2009-08-03 19:12:47 +03:00
|
|
|
next_table = &$$->next;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
vars:
|
|
|
|
var
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| vars ',' var
|
|
|
|
{
|
|
|
|
struct var **walk;
|
|
|
|
|
|
|
|
$$ = $1;
|
|
|
|
for (walk = &$$; *walk; walk = &(*walk)->next);
|
|
|
|
*walk = $3;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
var:
|
|
|
|
ID
|
|
|
|
{
|
2009-12-31 18:24:23 +02:00
|
|
|
if (find_var(curr_frame, $1)) {
|
|
|
|
yyerrorf("duplicate variable \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-03 20:58:32 +03:00
|
|
|
$$ = zalloc_type(struct var);
|
2009-08-03 19:12:47 +03:00
|
|
|
$$->name = $1;
|
|
|
|
$$->frame = curr_frame;
|
2009-08-06 23:19:00 +03:00
|
|
|
$$->table = curr_table;
|
2009-08-03 19:12:47 +03:00
|
|
|
$$->next = NULL;
|
|
|
|
n_vars++;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
rows:
|
|
|
|
{
|
|
|
|
$$ = NULL;
|
|
|
|
}
|
|
|
|
| '{'
|
|
|
|
{
|
|
|
|
$<row>$ = alloc_type(struct row);
|
|
|
|
$<row>$->table = curr_table;
|
|
|
|
curr_row = $<row>$;;
|
|
|
|
n_values = 0;
|
|
|
|
}
|
|
|
|
row '}'
|
|
|
|
{
|
|
|
|
if (n_vars != n_values) {
|
|
|
|
yyerrorf("table has %d variables but row has "
|
|
|
|
"%d values", n_vars, n_values);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
$<row>2->values = $3;
|
|
|
|
}
|
|
|
|
rows
|
|
|
|
{
|
|
|
|
$$ = $<row>2;
|
|
|
|
$$->next = $6;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
row:
|
|
|
|
value
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| row ',' value
|
|
|
|
{
|
|
|
|
struct value **walk;
|
|
|
|
|
|
|
|
$$ = $1;
|
|
|
|
for (walk = &$$; *walk; walk = &(*walk)->next);
|
|
|
|
*walk = $3;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
value:
|
|
|
|
expr
|
|
|
|
{
|
|
|
|
$$ = alloc_type(struct value);
|
|
|
|
$$->expr = $1;
|
|
|
|
$$->row = curr_row;
|
|
|
|
$$->next = NULL;
|
|
|
|
n_values++;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
vec:
|
|
|
|
TOK_VEC base '(' expr ',' expr ')'
|
|
|
|
{
|
|
|
|
$$ = alloc_type(struct vec);
|
|
|
|
$$->name = NULL;
|
|
|
|
$$->base = $2;
|
|
|
|
$$->x = $4;
|
|
|
|
$$->y = $6;
|
|
|
|
$$->frame = curr_frame;
|
|
|
|
$$->next = NULL;
|
|
|
|
last_vec = $$;
|
|
|
|
*next_vec = $$;
|
|
|
|
next_vec = &$$->next;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
base:
|
|
|
|
'@'
|
|
|
|
{
|
|
|
|
$$ = NULL;
|
|
|
|
}
|
|
|
|
| '.'
|
|
|
|
{
|
|
|
|
$$ = last_vec;
|
|
|
|
if (!$$) {
|
|
|
|
yyerrorf(". without predecessor");
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
| ID
|
|
|
|
{
|
2009-08-07 16:37:51 +03:00
|
|
|
$$ = find_vec(curr_frame, $1);
|
2009-08-03 19:12:47 +03:00
|
|
|
if (!$$) {
|
|
|
|
yyerrorf("unknown vector \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2010-04-27 04:02:24 +03:00
|
|
|
qualified_base:
|
|
|
|
base
|
|
|
|
{
|
|
|
|
$$.frame = curr_frame;
|
|
|
|
$$.vec = $1;
|
|
|
|
}
|
|
|
|
| frame_qualifier '@'
|
|
|
|
{
|
|
|
|
$$.frame = $1;
|
|
|
|
$$.vec = NULL;
|
|
|
|
}
|
|
|
|
| frame_qualifier ID
|
|
|
|
{
|
|
|
|
$$.frame = $1;
|
|
|
|
$$.vec = find_vec($1, $2);
|
|
|
|
if (!$$.vec) {
|
|
|
|
yyerrorf("unknown vector \"%s.%s\"",
|
|
|
|
$1->name, $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
frame_qualifier:
|
|
|
|
ID '.'
|
|
|
|
{
|
|
|
|
$$ = find_frame($1);
|
|
|
|
if (!$$) {
|
|
|
|
yyerrorf("unknown frame \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
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
|
|
|
object:
|
|
|
|
obj
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
*next_obj = $1;
|
|
|
|
next_obj = &$1->next;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
obj:
|
2009-08-27 12:45:57 +03:00
|
|
|
TOK_PAD STRING base base pad_type
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
|
|
|
$$ = new_obj(ot_pad);
|
|
|
|
$$->base = $3;
|
|
|
|
$$->u.pad.name = $2;
|
|
|
|
$$->u.pad.other = $4;
|
2009-08-14 13:18:40 +03:00
|
|
|
$$->u.pad.rounded = 0;
|
2009-08-27 12:45:57 +03:00
|
|
|
$$->u.pad.type = $5;
|
2009-08-14 13:18:40 +03:00
|
|
|
}
|
2009-08-27 12:45:57 +03:00
|
|
|
| TOK_RPAD STRING base base pad_type
|
2009-08-14 13:18:40 +03:00
|
|
|
{
|
|
|
|
$$ = new_obj(ot_pad);
|
|
|
|
$$->base = $3;
|
|
|
|
$$->u.pad.name = $2;
|
|
|
|
$$->u.pad.other = $4;
|
|
|
|
$$->u.pad.rounded = 1;
|
2009-08-27 12:45:57 +03:00
|
|
|
$$->u.pad.type = $5;
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
2010-04-25 13:58:07 +03:00
|
|
|
| TOK_HOLE base base
|
|
|
|
{
|
|
|
|
$$ = new_obj(ot_hole);
|
|
|
|
$$->base = $2;
|
|
|
|
$$->u.hole.other = $3;
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
| TOK_RECT base base opt_expr
|
|
|
|
{
|
|
|
|
$$ = new_obj(ot_rect);
|
|
|
|
$$->base = $2;
|
|
|
|
$$->u.rect.other = $3;
|
|
|
|
$$->u.rect.width = $4;
|
|
|
|
}
|
|
|
|
| TOK_LINE base base opt_expr
|
|
|
|
{
|
|
|
|
$$ = new_obj(ot_line);
|
|
|
|
$$->base = $2;
|
|
|
|
$$->u.line.other = $3;
|
|
|
|
$$->u.line.width = $4;
|
|
|
|
}
|
|
|
|
| TOK_CIRC base base opt_expr
|
|
|
|
{
|
|
|
|
$$ = new_obj(ot_arc);
|
|
|
|
$$->base = $2;
|
|
|
|
$$->u.arc.start = $3;
|
2009-08-06 07:33:49 +03:00
|
|
|
$$->u.arc.end = $3;
|
2009-08-03 19:12:47 +03:00
|
|
|
$$->u.arc.width = $4;
|
|
|
|
}
|
|
|
|
| TOK_ARC base base base opt_expr
|
|
|
|
{
|
|
|
|
$$ = new_obj(ot_arc);
|
|
|
|
$$->base = $2;
|
|
|
|
$$->u.arc.start = $3;
|
|
|
|
$$->u.arc.end = $4;
|
|
|
|
$$->u.arc.width = $5;
|
|
|
|
}
|
2009-08-04 00:10:49 +03:00
|
|
|
| TOK_FRAME ID
|
|
|
|
{
|
|
|
|
$<num>$.n = lineno;
|
|
|
|
}
|
|
|
|
base
|
2009-08-03 19:12:47 +03:00
|
|
|
{
|
|
|
|
$$ = new_obj(ot_frame);
|
2009-08-04 00:10:49 +03:00
|
|
|
$$->base = $4;
|
|
|
|
$$->u.frame.ref = find_frame($2);
|
|
|
|
if (!$$->u.frame.ref) {
|
2009-08-03 19:12:47 +03:00
|
|
|
yyerrorf("unknown frame \"%s\"", $2);
|
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-04 00:10:49 +03:00
|
|
|
if (!$$->u.frame.ref->active_ref)
|
|
|
|
$$->u.frame.ref->active_ref = $$;
|
|
|
|
$$->u.frame.lineno = $<num>3.n;
|
2009-08-03 19:12:47 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2009-08-27 12:45:57 +03:00
|
|
|
pad_type:
|
2009-08-27 17:24:54 +03:00
|
|
|
{
|
|
|
|
$$ = pt_normal;
|
|
|
|
}
|
|
|
|
| ID
|
2009-08-27 12:45:57 +03:00
|
|
|
{
|
|
|
|
if (!strcmp($1, "bare"))
|
|
|
|
$$ = pt_bare;
|
2011-01-18 02:30:57 +02:00
|
|
|
else if (!strcmp($1, "trace"))
|
|
|
|
$$ = pt_trace;
|
2009-08-27 12:45:57 +03:00
|
|
|
else if (!strcmp($1, "paste"))
|
|
|
|
$$ = pt_paste;
|
2009-09-11 21:34:51 +03:00
|
|
|
else if (!strcmp($1, "mask"))
|
|
|
|
$$ = pt_mask;
|
2009-08-27 17:24:54 +03:00
|
|
|
else {
|
|
|
|
yyerrorf("unknown pad type \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
2009-08-27 12:45:57 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2010-04-27 02:11:22 +03:00
|
|
|
opt_measurements:
|
|
|
|
| measurements
|
|
|
|
;
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
measurements:
|
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
|
|
|
unlabeled_meas /* @@@ hack */
|
2010-04-21 00:01:16 +03:00
|
|
|
{
|
|
|
|
*next_obj = $1;
|
|
|
|
next_obj = &$1->next;
|
|
|
|
}
|
2009-08-09 03:06:54 +03:00
|
|
|
| measurements meas
|
2009-08-07 16:37:51 +03:00
|
|
|
{
|
2009-08-09 03:06:54 +03:00
|
|
|
*next_obj = $2;
|
|
|
|
next_obj = &$2->next;
|
2009-08-07 16:37:51 +03:00
|
|
|
}
|
2010-04-21 00:01:16 +03:00
|
|
|
| measurements debug_item
|
2009-08-07 16:37:51 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
meas:
|
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
|
|
|
unlabeled_meas
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| LABEL unlabeled_meas
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
if (find_label(curr_frame, $1)) {
|
|
|
|
yyerrorf("duplicate label \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
$$->name = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
unlabeled_meas:
|
2009-08-08 21:50:17 +03:00
|
|
|
meas_type opt_string qbase meas_op qbase opt_expr
|
2009-08-07 16:37:51 +03:00
|
|
|
{
|
2009-08-09 03:06:54 +03:00
|
|
|
struct meas *meas;
|
|
|
|
|
|
|
|
$$ = new_obj(ot_meas);
|
|
|
|
meas = &$$->u.meas;
|
|
|
|
meas->type = $4.max ? $1+3 : $1;
|
|
|
|
meas->label = $2;
|
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
|
|
|
$$->base = $3.vec;
|
|
|
|
meas->low_qual = $3.qualifiers;
|
2009-08-09 03:06:54 +03:00
|
|
|
meas->inverted = $4.inverted;
|
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
|
|
|
meas->high = $5.vec;
|
|
|
|
meas->high_qual = $5.qualifiers;
|
2009-08-09 03:06:54 +03:00
|
|
|
meas->offset = $6;
|
2009-08-07 16:37:51 +03:00
|
|
|
$$->next = NULL;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
qbase:
|
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
|
|
|
qbase_unchecked
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
if (!check_qbase(&$$))
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
qbase_unchecked:
|
2009-08-07 16:37:51 +03:00
|
|
|
ID
|
|
|
|
{
|
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
|
|
|
$$.vec = find_vec(frames, $1);
|
|
|
|
if (!$$.vec) {
|
2009-08-07 16:37:51 +03:00
|
|
|
yyerrorf("unknown vector \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
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
|
|
|
$$.qualifiers = NULL;
|
2009-08-07 16:37:51 +03:00
|
|
|
}
|
|
|
|
| ID '.' ID
|
|
|
|
{
|
|
|
|
const struct frame *frame;
|
|
|
|
|
|
|
|
frame = find_frame($1);
|
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
|
|
|
$$.vec = frame ? find_vec(frame, $3) : NULL;
|
|
|
|
if (!$$.vec) {
|
2009-08-07 16:37:51 +03:00
|
|
|
yyerrorf("unknown vector \"%s.%s\"", $1, $3);
|
|
|
|
YYABORT;
|
|
|
|
}
|
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
|
|
|
$$.qualifiers = NULL;
|
|
|
|
}
|
|
|
|
| ID '/' qbase
|
|
|
|
{
|
|
|
|
const struct frame *frame;
|
|
|
|
struct frame_qual *qual;
|
|
|
|
|
|
|
|
$$ = $3;
|
|
|
|
frame = find_frame($1);
|
|
|
|
if (!frame) {
|
|
|
|
yyerrorf("unknown frame \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
} else {
|
|
|
|
qual = alloc_type(struct frame_qual);
|
|
|
|
qual->frame = frame;
|
|
|
|
qual->next = $$.qualifiers;
|
|
|
|
$$.qualifiers = qual;
|
|
|
|
}
|
2009-08-07 16:37:51 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
meas_type:
|
2009-08-09 03:06:54 +03:00
|
|
|
TOK_MEAS
|
2009-08-07 16:37:51 +03:00
|
|
|
{
|
|
|
|
$$ = mt_xy_next;
|
|
|
|
}
|
|
|
|
| TOK_MEASX
|
|
|
|
{
|
|
|
|
$$ = mt_x_next;
|
|
|
|
}
|
|
|
|
| TOK_MEASY
|
|
|
|
{
|
|
|
|
$$ = mt_y_next;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
meas_op:
|
|
|
|
TOK_NEXT
|
|
|
|
{
|
|
|
|
$$.max = 0;
|
|
|
|
$$.inverted = 0;
|
|
|
|
}
|
|
|
|
| TOK_NEXT_INVERTED
|
|
|
|
{
|
|
|
|
$$.max = 0;
|
|
|
|
$$.inverted = 1;
|
|
|
|
}
|
|
|
|
| TOK_MAX
|
|
|
|
{
|
|
|
|
$$.max = 1;
|
|
|
|
$$.inverted = 0;
|
|
|
|
}
|
|
|
|
| TOK_MAX_INVERTED
|
|
|
|
{
|
|
|
|
$$.max = 1;
|
|
|
|
$$.inverted = 1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
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
|
|
|
opt_num:
|
|
|
|
{
|
|
|
|
$$.n = 0;
|
|
|
|
}
|
|
|
|
| NUMBER
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2009-08-07 16:37:51 +03:00
|
|
|
opt_string:
|
|
|
|
{
|
|
|
|
$$ = NULL;
|
|
|
|
}
|
|
|
|
| STRING
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2009-08-03 19:12:47 +03:00
|
|
|
opt_expr:
|
|
|
|
{
|
|
|
|
$$ = NULL;
|
|
|
|
}
|
|
|
|
| expr
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
expr:
|
|
|
|
add_expr
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
add_expr:
|
|
|
|
mult_expr
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| add_expr '+' mult_expr
|
|
|
|
{
|
|
|
|
$$ = binary_op(op_add, $1, $3);
|
|
|
|
}
|
|
|
|
| add_expr '-' mult_expr
|
|
|
|
{
|
|
|
|
$$ = binary_op(op_sub, $1, $3);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
mult_expr:
|
|
|
|
unary_expr
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| mult_expr '*' unary_expr
|
|
|
|
{
|
|
|
|
$$ = binary_op(op_mult, $1, $3);
|
|
|
|
}
|
|
|
|
| mult_expr '/' unary_expr
|
|
|
|
{
|
|
|
|
$$ = binary_op(op_div, $1, $3);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
unary_expr:
|
|
|
|
primary_expr
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| '-' primary_expr
|
|
|
|
{
|
|
|
|
$$ = binary_op(op_minus, $2, NULL);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
primary_expr:
|
|
|
|
NUMBER
|
|
|
|
{
|
|
|
|
$$ = new_op(op_num);
|
|
|
|
$$->u.num = $1;
|
|
|
|
}
|
|
|
|
| ID
|
|
|
|
{
|
|
|
|
$$ = new_op(op_var);
|
|
|
|
$$->u.var = $1;
|
|
|
|
}
|
2009-08-07 00:57:18 +03:00
|
|
|
| STRING
|
|
|
|
{
|
|
|
|
$$ = new_op(op_string);
|
|
|
|
$$->u.str = $1;
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
| '(' expr ')'
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2009-12-01 14:43:59 +02:00
|
|
|
| ID '(' expr ')'
|
|
|
|
{
|
|
|
|
if ($1 == id_sin)
|
|
|
|
$$ = binary_op(op_sin, $3, NULL);
|
|
|
|
else if ($1 == id_cos)
|
|
|
|
$$ = binary_op(op_cos, $3, NULL);
|
|
|
|
else if ($1 == id_sqrt)
|
|
|
|
$$ = binary_op(op_sqrt, $3, NULL);
|
|
|
|
else {
|
|
|
|
yyerrorf("unknown function \"%s\"", $1);
|
|
|
|
YYABORT;
|
|
|
|
}
|
|
|
|
}
|
2009-08-03 19:12:47 +03:00
|
|
|
;
|
2009-08-16 07:12:37 +03:00
|
|
|
|
|
|
|
/* special sub-grammar */
|
|
|
|
|
|
|
|
opt_value_list:
|
|
|
|
{
|
|
|
|
$$ = NULL;
|
|
|
|
}
|
|
|
|
| '=' row
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
;
|