1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-09-30 11:03:14 +03:00
fped/meas.c

327 lines
6.3 KiB
C
Raw Normal View History

/*
* meas.c - Measurements
*
* Written 2009, 2010, 2012 by Werner Almesberger
* Copyright 2009, 2010, 2012 by Werner Almesberger
*
* 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>
#include "util.h"
#include "coord.h"
#include "expr.h"
#include "obj.h"
#include "inst.h"
#include "meas.h"
int n_samples;
struct num eval_unit(const struct expr *expr, const struct frame *frame);
void reset_samples(struct sample **samples, int n)
{
struct sample *next;
int i;
for (i = 0; i != n; i++)
while (samples[i]) {
next = samples[i]->next;
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
bitset_free(samples[i]->frame_set);
free(samples[i]);
samples[i] = next;
}
}
void meas_start(void)
{
const struct frame *frame;
struct vec *vec;
n_samples = 0;
for (frame = frames; frame; frame = frame->next)
for (vec = frame->vecs; vec; vec = vec->next)
vec->n = n_samples++;
}
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
void meas_post(const struct vec *vec, struct coord pos,
const struct bitset *frame_set)
{
struct sample **walk, *new;
for (walk = &curr_pkg->samples[vec->n]; *walk; walk = &(*walk)->next) {
if (pos.y < (*walk)->pos.y)
break;
if (pos.y > (*walk)->pos.y)
continue;
if (pos.x < (*walk)->pos.x)
break;
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
if (pos.x != (*walk)->pos.x)
continue;
if (bitset_ge((*walk)->frame_set, frame_set))
return;
if (bitset_ge(frame_set, (*walk)->frame_set)) {
bitset_or((*walk)->frame_set, frame_set);
return;
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
}
}
new = alloc_type(struct sample);
new->pos = pos;
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
new->frame_set = bitset_clone(frame_set);
new->next = *walk;
*walk = new;
}
/* ----- lt operators ------------------------------------------------------ */
int lt_x(struct coord a, struct coord b)
{
return a.x < b.x;
}
int lt_y(struct coord a, struct coord b)
{
return a.y < b.y;
}
int lt_xy(struct coord a, struct coord b)
{
return a.y < b.y || (a.y == b.y && a.x < b.x);
}
/* ----- measurement type map ---------------------------------------------- */
static lt_op_type lt_op[mt_n] = {
lt_xy,
lt_x,
lt_y,
lt_xy,
lt_x,
lt_y
};
static int is_next[mt_n] = {
1, 1, 1,
0, 0, 0
};
/* ----- search functions -------------------------------------------------- */
static int closer(int da, int db)
{
int abs_a, abs_b;
abs_a = da < 0 ? -da : da;
abs_b = db < 0 ? -db : db;
if (abs_a < abs_b)
return 1;
if (abs_a > abs_b)
return 0;
/*
* Really *all* other things being equal, pick the one that protrudes
* in the positive direction.
*/
return da > db;
}
static int better_next(lt_op_type lt,
struct coord a0, struct coord b0, struct coord b)
{
/* if we don't have any suitable point A0 < B0 yet, use this one */
if (!lt(a0, b0))
return 1;
/* B must be strictly greater than A0 */
if (!lt(a0, b))
return 0;
/* if we can get closer to A0, do so */
if (lt(b, b0))
return 1;
/* reject B > B0 */
if (lt(b0, b))
return 0;
/*
* B == B0 along the coordinate we measure. Now give the other
* coordinate a chance. This gives us a stable sort order and it
* makes meas/measx/measy usually select the same point.
*/
if (lt == lt_xy)
return 0;
if (lt == lt_x)
return closer(b.y-a0.y, b0.y-a0.y);
if (lt == lt_y)
return closer(b.x-a0.x, b0.x-a0.x);
abort();
}
/*
* In order to obtain a stable order, we sort points equal on the measured
* coordinate also by xy:
*
* if (*a < a0) use *a
* else if (*a == a0 && *a <xy a0) use *a
*/
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
const struct sample *meas_find_min(lt_op_type lt, const struct sample *s,
const struct bitset *qual)
{
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
const struct sample *min = NULL;
while (s) {
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
if (!qual || bitset_ge(s->frame_set, qual))
if (!min || lt(s->pos, min->pos) ||
(!lt(min->pos, s->pos) && lt_xy(s->pos, min->pos)))
min = s;
s = s->next;
}
return min;
}
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
const struct sample *meas_find_next(lt_op_type lt, const struct sample *s,
struct coord ref, const struct bitset *qual)
{
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
const struct sample *next = NULL;
while (s) {
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
if (!qual || bitset_ge(s->frame_set, qual))
if (!next || better_next(lt, ref, next->pos, s->pos))
next = s;
s = s->next;
}
return next;
}
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
const struct sample *meas_find_max(lt_op_type lt, const struct sample *s,
const struct bitset *qual)
{
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
const struct sample *max = NULL;
while (s) {
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
if (!qual || bitset_ge(s->frame_set, qual))
if (!max || lt(max->pos, s->pos) ||
(!lt(s->pos, max->pos) && lt_xy(max->pos, s->pos)))
max = s;
s = s->next;
}
return max;
}
/* ----- instantiation ----------------------------------------------------- */
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 struct bitset *make_frame_set(struct frame_qual *qual, int n_frames)
{
struct bitset *set;
set = bitset_new(n_frames);
while (qual) {
bitset_set(set, qual->frame->n);
qual = qual->next;
}
return set;
}
static int instantiate_meas_pkg(int n_frames)
{
struct obj *obj;
const struct meas *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
struct bitset *set;
const struct sample *a0, *b0;
lt_op_type lt;
for (obj = frames->objs; obj; obj = obj->next) {
if (obj->type != ot_meas)
continue;
meas = &obj->u.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
/* optimization. not really needed anymore. */
if (!curr_pkg->samples[obj->base->n] ||
!curr_pkg->samples[meas->high->n])
continue;
lt = lt_op[meas->type];
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
set = make_frame_set(meas->low_qual, n_frames);
a0 = meas_find_min(lt, curr_pkg->samples[obj->base->n], set);
bitset_free(set);
if (!a0)
continue;
set = make_frame_set(meas->high_qual, n_frames);
if (is_next[meas->type])
b0 = meas_find_next(lt,
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
curr_pkg->samples[meas->high->n], a0->pos, set);
else
b0 = meas_find_max(lt,
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
curr_pkg->samples[meas->high->n], set);
bitset_free(set);
if (!b0)
continue;
inst_meas(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
meas->inverted ? b0->pos : a0->pos,
meas->inverted ? a0->pos : b0->pos);
}
return 1;
}
static void purge_meas(struct pkg *pkg)
{
struct inst **anchor, *inst;
anchor = pkg->insts+ip_meas;
while (*anchor)
if ((*anchor)->u.meas.valid) {
anchor = &(*anchor)->next;
} else {
inst = *anchor;
*anchor = inst->next;
free(inst);
}
}
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
int instantiate_meas(int n_frames)
{
struct pkg *pkg;
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_instantiating = pkgs->insts[ip_frame];
for (pkg = pkgs; pkg; pkg = pkg->next)
if (pkg->name) {
inst_select_pkg(pkg->name, 0);
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
if (!instantiate_meas_pkg(n_frames))
return 0;
purge_meas(pkg);
}
return 1;
}