]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/timepic
games/galaxy: new mouse behavior
[plan9front.git] / sys / man / 1 / timepic
1 .TH TIMEPIC 1
2 .SH NAME
3 timepic \- troff preprocessor for drawing timing diagrams
4 .SH SYNOPSYS
5 .B timepic
6 [
7 .I files
8 ]
9 .SH DESCRIPTION
10 .I Timepic
11 is a 
12 .IR pic (1)
13 and
14 .IR troff (1)
15 preprocessor for drawing timing diagrams.
16 .I Timepic
17 code is contained between
18 .B .TPS
19 and
20 .B .TPE
21 lines:
22 .IP
23 .EX
24 \&.TPS \f2width\fP \f2row-height\fP
25 \f2statement-list\fP
26 \&.TPE
27 .EE
28 .PP
29 There are two types of
30 .I timepic
31 statements: variable definitions and signal definitions.
32 Variables are defined with the syntax
33 .IP
34 .EX
35 \f2var\fP = \f2expr\fP;
36 .EE
37 .PP
38 where 
39 .I expr
40 is an arithmetic expression involving floating-point constants and previously defined variables.
41 Currently only basic arithmetic (\fB+\fR, \fB-\fR, \fB*\fR and \fB/\fR) is supported.
42 Signals are defined with the syntax
43 .IP
44 .EX
45 \f2name\fP \f2events\fP ;
46 .EE
47 .PP
48 where
49 .I name
50 is a name that must be quoted unless it's a valid symbol.
51 \f2Events\fR is a list consisting of the following things:
52 .TP
53 \(bu
54 The current time can be set using an arithmetic expression, that may be followed by a symbol interpreted as a unit.
55 For instance if you defined 
56 .B "μs = 1000;"
57 then 
58 .B 1μs
59 and
60 .B "(x+2)*3μs"
61 are both valid time expressions.
62 Note that
63 .B x+2μs
64 is interpreted as 
65 .B (x+2)μs
66 which may or may not be intended behaviour.
67 .IP
68 A time expression can be preceded by \fP+\fR to mark it as relative to the previous time.
69 The first time is zero.
70 .IP
71 A time expression can be followed by a symbol name in square brackets.
72 The symbol is then defined with the time.
73 .TP
74 \(bu
75 An expression of the form \fP:\fIname\fR creates an `event' at the current time, changing the value of the signal to \fIname\fR.
76 \fIname\fR can be a symbol (which is not evaluated), a numerical constant or a string in single quotes.
77 The values
78 .BR 0 ,
79 .BR 1 ,
80 .BR x
81 and
82 .B z
83 have special meaning, unless they are quoted.
84 .TP
85 \(bu
86 A pipe symbol
87 .B |
88 draws a vertical dashed line at the next event.
89 .TP
90 \(bu
91 An expression of the form
92 .IB expr { events }
93 evaluates the expression, rounded to the nearest integer, and then repeats the events the specified number of times.
94 It is illegal if the expression evaluates to a negative number.
95 It is also illegal to use absolute times in the events list.
96 It is however legal to nest this construct.
97 .SH EXAMPLES
98 .IP
99 .EX
100 \&.TPS 6 0.4
101 c=5;
102 clk +5{:1 +.5c:0 +.5c};
103 data :x 2.3c:DQ 4c|:x;
104 valid :0 2.3c:1 4c:0;
105 ready :0 3.6c:1 4c:0;
106 \&.TPE
107 .EE
108 .SH FILES
109 .B /sys/src/cmd/timepic.c
110 .SH "SEE ALSO"
111 .IR troff (1),
112 .IR pic (1)
113 .SH BUGS
114 Yes.