1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-18 09:25:20 +02:00
fped/test/del_frame
werner c9af8cd0fe 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-29 21:13:48 +00:00

94 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
fped_fail "delete frame: can't self-destruct" <<EOF
frame f {
%del f
}
EOF
expect <<EOF
3: a frame can't delete itself near "}"
EOF
#------------------------------------------------------------------------------
fped_dump "delete frame: content disappears" <<EOF
frame f {
vec @(0mm, 0mm)
}
%del f
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "delete frame: references disappear" <<EOF
frame f {
vec @(0mm, 0mm)
}
frame f @
%del f
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "delete frame: measurements disappear" <<EOF
frame f {
v: vec @(0mm, 0mm)
}
frame f @
meas f.v -> f.v
%del f
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "delete frame: measurements with qualifiers disappear" <<EOF
frame f {
v: vec @(0mm, 0mm)
}
frame g { frame f @ }
frame g @
meas g/f.v -> f.v
%del g
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
frame f {
v: vec @(0mm, 0mm)
}
package "_"
unit mm
EOF
###############################################################################