Skip to content

Commit 2dfb58d

Browse files
committed
dont count transition boundaries
1 parent c5bcb4e commit 2dfb58d

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

power/VcdReader.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ void
110110
VcdCount::incrCounts(VcdTime time, char value)
111111
{
112112
// Determine if this time point is within the filter window
113-
bool in_window = (filter_start_ < 0 || time >= filter_start_)
114-
&& (filter_end_ < 0 || time <= filter_end_);
115-
113+
// NOTE: Does not count transitions right at the window boundaries.
114+
bool in_window = (filter_start_ < 0 || time > filter_start_)
115+
&& (filter_end_ < 0 || time < filter_end_);
116+
116117
// Initial value does not contribute to transitions or high time.
117118
if (prev_time_ != -1 && in_window) {
118119
if (prev_value_ == '1') {

test/vcd_timestamp.ok

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ u_inv/A 0.05 0.500
77
Annotated 2 pin activities.
88
Pin Name Activity Duty Cycle
99
--------------------------------------------------------
10-
u_inv/Y 0.1 1.000
11-
u_inv/A 0.1 0.000
10+
u_inv/Y 0.0 1.000
11+
u_inv/A 0.0 0.000
1212

1313
Annotated 2 pin activities.
1414
Pin Name Activity Duty Cycle
1515
--------------------------------------------------------
16-
u_inv/Y 0.1 0.000
17-
u_inv/A 0.1 1.000
16+
u_inv/Y 0.0 0.000
17+
u_inv/A 0.0 1.000
1818

1919
Annotated 2 pin activities.
2020
Pin Name Activity Duty Cycle

0 commit comments

Comments
 (0)