pig2vcd - Online Linux Manual PageSection : 1
Updated : 2012-2020
Source : Linux
Note : pigpio archive

NAMEpig2vd - A utility to convert pigpio notifications to VCD.

SYNOPSISpig2vcd </dev/pigpioXX >file.VCD

DESCRIPTIONpig2vcd is a utility which reads notifications on stdin and writes the output as a Value Change Dump (VCD) file on stdout.

The VCD file can be viewed using GTKWave.


Notifications

Notifications consist of 12 bytes with the following binary format.

typedef struct
{
uint16_t seqno;
uint16_t flags;
uint32_t tick;
uint32_t level;
} gpioReport_t;


seqno: starts at 0 each time the handle is opened and then increments by one for each report.

flags: two flags are defined, PI_NTFY_FLAGS_WDOG and PI_NTFY_FLAGS_ALIVE. If bit 5 is set (PI_NTFY_FLAGS_WDOG) then bits 0-4 of the flags indicate a gpio which has had a watchdog timeout; if bit 6 is set (PI_NTFY_FLAGS_ALIVE) this indicates a keep alive signal on the pipe/socket and is sent once a minute in the absence of other notification activity.

tick: the number of microseconds since system boot. It wraps around after 1h12m.

level: indicates the level of each gpio. If bit 1<<x is set then gpio x is high. pig2vcd takes these notifications and outputs a text format VCD.


VCD format

The VCD starts with a header.

$date 2013-05-31 18:49:36 $end
$version pig2vcd V1 $end
$timescale 1 us $end
$scope module top $end
$var wire 1 A 0 $end
$var wire 1 B 1 $end
$var wire 1 C 2 $end
$var wire 1 D 3 $end
$var wire 1 E 4 $end
$var wire 1 F 5 $end
$var wire 1 G 6 $end
$var wire 1 H 7 $end
$var wire 1 I 8 $end
$var wire 1 J 9 $end
$var wire 1 K 10 $end
$var wire 1 L 11 $end
$var wire 1 M 12 $end
$var wire 1 N 13 $end
$var wire 1 O 14 $end
$var wire 1 P 15 $end
$var wire 1 Q 16 $end
$var wire 1 R 17 $end
$var wire 1 S 18 $end
$var wire 1 T 19 $end
$var wire 1 U 20 $end
$var wire 1 V 21 $end
$var wire 1 W 22 $end
$var wire 1 X 23 $end
$var wire 1 Y 24 $end
$var wire 1 Z 25 $end
$var wire 1 a 26 $end
$var wire 1 b 27 $end
$var wire 1 c 28 $end
$var wire 1 d 29 $end
$var wire 1 e 30 $end
$var wire 1 f 31 $end
$upscope $end
$enddefinitions $end


The header defines gpio identifiers and their name. Each gpio identifier must be unique. pig2vcd arbitrarily uses 'A' through 'Z' for gpios 0 through 25, and 'a' through 'f' for gpios 26 through 31. The corresponding names are 0 through 31.


The VCD file may be edited to give a frendlier name, e.g. 8 could be changed to ENCODER_A if an encoder switch A is connected to gpio 8.

Following the header pig2vcd takes notifications and outputs a timestamp followed by a list of one or more gpios which have changed state. The timestamp consists of a '#' followed by the microsecond tick. The state lines contain the new state followed by the gpio identifier.

#1058747
0H
0I
#1059012
1H
#1079777
1I
#1079782
0I
#1079852
1I
#1079857
0I
0H
#1165113
1H
#1165118
0H
#1165153
1H

SEE ALSOpigpiod(1), pigs(1), pigpio(3), pigpiod_if(3), pigpiod_if2(3)

AUTHORjoan@abyz.me.uk
0
Johanes Gumabo
Data Size   :   7,865 byte
man-pig2vcd.1Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 202,789
Visitor ID   :     :  
Visitor IP   :   18.119.157.241   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.