Skip to content

Commit ef4b778

Browse files
authored
Merge pull request #2560 from w0lek/ipa_end_user_doc
End user documentation for Interactive Path Analysis Tool (VPR server mode)
2 parents dfdf3c9 + 46fb5ea commit ef4b778

35 files changed

+1866
-202
lines changed

doc/src/api/vpr/contexts.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ Structures
4343
.. doxygenstruct:: TimingContext
4444
:project: vpr
4545
:members:
46+
47+
.. doxygenstruct:: ServerContext
48+
:project: vpr
49+
:members:

doc/src/api/vpr/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ VPR API
1111
netlist
1212
route_tree
1313
rr_graph
14+
server

doc/src/api/vpr/server.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
========
2+
Server
3+
========
4+
5+
server::update
6+
--------------
7+
8+
.. doxygenfunction:: server::update
9+
:project: vpr
10+
11+
server::GateIO
12+
--------------
13+
14+
.. doxygenclass:: server::GateIO
15+
:project: vpr
16+
:members:
17+
18+
server::Task
19+
------------
20+
21+
.. doxygenfile:: commcmd.h
22+
:project: vpr
23+
24+
.. doxygenclass:: server::Task
25+
:project: vpr
26+
:members:
27+
28+
server::TaskResolver
29+
--------------------
30+
31+
.. doxygenclass:: server::TaskResolver
32+
:project: vpr
33+
:members:
34+
35+
.. doxygenstruct:: server::CritPathsResult
36+
:project: vpr
37+
:members:
38+
39+
.. doxygenfunction:: server::calc_critical_path
40+
:project: vpr
41+
42+
.. doxygenenum:: e_timing_report_detail
43+
:project: vpr
44+
45+
comm::Telegram
46+
--------------
47+
48+
.. doxygenclass:: comm::TelegramHeader
49+
:project: vpr
50+
:members:
51+
52+
.. doxygenstruct:: comm::TelegramFrame
53+
:project: vpr
54+
:members:
55+
56+
.. doxygenclass:: comm::TelegramBuffer
57+
:project: vpr
58+
:members:
59+
60+
.. doxygenclass:: comm::ByteArray
61+
:project: vpr
62+
:members:
63+
64+
Parsers
65+
-------
66+
67+
.. doxygenclass:: server::TelegramOptions
68+
:project: vpr
69+
:members:
70+
71+
.. doxygenclass:: comm::TelegramParser
72+
:project: vpr
73+
:members:
74+
75+
76+
Compression utils
77+
-----------------
78+
79+
.. doxygenfunction:: try_compress
80+
:project: vpr
81+
82+
.. doxygenfunction:: try_decompress
83+
:project: vpr

doc/src/vpr/command_line_usage.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,27 @@ The following options are used to enable power estimation in VPR.
18241824

18251825
Instructions on generating this file are provided in :ref:`power_estimation`.
18261826

1827+
Server Mode Options
1828+
^^^^^^^^^^^^^^^^^^^^^^^^
1829+
1830+
If VPR is in server mode, it listens on a socket for commands from a client. Currently, this is used to enable interactive timing analysis and visualization of timing paths in the VPR UI under the control of a separate client.
1831+
1832+
The following options are used to enable server mode in VPR.
1833+
1834+
.. seealso:: :ref:`server_mode` for more details.
1835+
1836+
.. option:: --server
1837+
1838+
Run in server mode. Accept single client application connection and respond to client requests
1839+
1840+
**Default:** ``off``
1841+
1842+
.. option:: --port PORT
1843+
1844+
Server port number.
1845+
1846+
**Default:** ``60555``
1847+
18271848
Command-line Auto Completion
18281849
----------------------------
18291850

doc/src/vtr/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ VTR also includes a set of benchmark designs known to work with the design flow.
4343
running_vtr
4444
benchmarks
4545
power_estimation/index.rst
46+
server_mode/index.rst
4647
tasks
4748
run_vtr_flow
4849
run_vtr_task
Binary file not shown.

doc/src/vtr/server_mode/comm_telegram_body_structure.svg

Lines changed: 293 additions & 0 deletions
Loading
Binary file not shown.

doc/src/vtr/server_mode/comm_telegram_structure.svg

Lines changed: 584 additions & 0 deletions
Loading

doc/src/vtr/server_mode/index.rst

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
.. _server_mode:
2+
3+
Server Mode
4+
================
5+
6+
If VPR is in server mode, it listens on a socket for commands from a client. Currently, this is used to enable interactive timing analysis and visualization of timing paths in the VPR UI under the control of a separate client.
7+
VPR provides the ability to run in server mode using the following command-line arguments.
8+
9+
.. code-block:: none
10+
11+
--server --port_num 60555
12+
13+
Server mode may only accept a single client application connection and respond to two types of requests: **get critical path report** and **highlight selected critical path elements**.
14+
15+
Communication telegram
16+
-------------------------
17+
18+
Telegram consists of two parts: a fixed-size **telegram header** and a variable-size **telegram body**.
19+
The telegram header contains helper information required to properly extract the telegram body sequence from the data flow.
20+
21+
.. _fig_comm_telegram_structure:
22+
23+
.. figure:: comm_telegram_structure.*
24+
25+
Communication telegram structure.
26+
27+
.. note:: The telegram body itself could be compressed with zlib to minimize the amount of data transferred over the socket.
28+
This compression is applied to the response of the 'get critical path report' request. The compressor ID byte in the telegram header signals whether the telegram body is compressed.
29+
When the compressor ID is null, the telegram body is not compressed. If the compressor ID is 'z', it means the body is compressed with zlib.
30+
31+
.. note:: The checksum field contains the telegram body checksum. This checksum is used to validate the consistency of the telegram body during the dispatching phase.
32+
If checksums are mismatched, the telegram is considered invalid and is skipped in processing.
33+
34+
35+
.. _fig_comm_telegram_body_structure:
36+
37+
.. figure:: comm_telegram_body_structure.*
38+
39+
Communication telegram body structure.
40+
41+
**telegram body** is a flat **JSON** structure.
42+
43+
**CMD** could have following integer values:
44+
45+
- 0 - command id for **get critical path**
46+
- 1 - command id for **highlight selected path elements**
47+
48+
JOB_ID is a unique ID for a task. It is used to associate the request with the response by matching the same JOB_ID. Each new client request should increment the JOB_ID value; otherwise, it will not be clear which request the current response belongs to.
49+
50+
51+
Get critical path timing report example
52+
---------------------------------------
53+
54+
Let's take a look at an example of a request timing report telegram body with the following options:
55+
56+
- path_num = 1
57+
- path_type = "setup"
58+
- details_level = "netlist"
59+
- is_flat_routing = false
60+
61+
.. code-block:: json
62+
:caption: telegram body **REQUEST** example
63+
:linenos:
64+
65+
{
66+
"JOB_ID": "1",
67+
"CMD": "0",
68+
"OPTIONS": "int:path_num:1;string:path_type:setup;string:details_level:netlist;bool:is_flat_routing:0"
69+
}
70+
71+
**path_type** could have following string values:
72+
73+
- "setup"
74+
- "hold"
75+
76+
**details_level** could have following string values:
77+
78+
- "netlist"
79+
- "aggregated"
80+
- "detailed"
81+
- "debug"
82+
83+
Response will look like:
84+
85+
.. code-block:: json
86+
:caption: telegram body **RESPONSE** example
87+
:linenos:
88+
89+
{
90+
"JOB_ID": "1",
91+
"CMD": "0",
92+
"OPTIONS": "int:path_num:1;string:path_type:setup;string:details_level:netlist;bool:is_flat_routing:0",
93+
"DATA": "
94+
#Timing report of worst 1 path(s)
95+
# Unit scale: 1e-09 seconds
96+
# Output precision: 3
97+
98+
#Path 1
99+
Startpoint: count[1].Q[0] (dffsre clocked by clk)
100+
Endpoint : count[13].D[0] (dffsre clocked by clk)
101+
Path Type : setup
102+
103+
Point Incr Path
104+
------------------------------------------------------------------------------------------
105+
clock clk (rise edge) 0.000 0.000
106+
clock source latency 0.000 0.000
107+
clk.inpad[0] (.input) 0.000 0.000
108+
count[1].C[0] (dffsre) 0.715 0.715
109+
count[1].Q[0] (dffsre) [clock-to-output] 0.286 1.001
110+
count_adder_carry_p_cout[2].p[0] (adder_carry) 0.573 1.574
111+
count_adder_carry_p_cout[2].cout[0] (adder_carry) 0.068 1.642
112+
count_adder_carry_p_cout[3].cin[0] (adder_carry) 0.043 1.685
113+
count_adder_carry_p_cout[3].cout[0] (adder_carry) 0.070 1.755
114+
count_adder_carry_p_cout[4].cin[0] (adder_carry) 0.053 1.808
115+
count_adder_carry_p_cout[4].cout[0] (adder_carry) 0.070 1.877
116+
count_adder_carry_p_cout[5].cin[0] (adder_carry) 0.043 1.921
117+
count_adder_carry_p_cout[5].cout[0] (adder_carry) 0.070 1.990
118+
count_adder_carry_p_cout[6].cin[0] (adder_carry) 0.053 2.043
119+
count_adder_carry_p_cout[6].cout[0] (adder_carry) 0.070 2.113
120+
count_adder_carry_p_cout[7].cin[0] (adder_carry) 0.043 2.156
121+
count_adder_carry_p_cout[7].cout[0] (adder_carry) 0.070 2.226
122+
count_adder_carry_p_cout[8].cin[0] (adder_carry) 0.053 2.279
123+
count_adder_carry_p_cout[8].cout[0] (adder_carry) 0.070 2.348
124+
count_adder_carry_p_cout[9].cin[0] (adder_carry) 0.043 2.391
125+
count_adder_carry_p_cout[9].cout[0] (adder_carry) 0.070 2.461
126+
count_adder_carry_p_cout[10].cin[0] (adder_carry) 0.053 2.514
127+
count_adder_carry_p_cout[10].cout[0] (adder_carry) 0.070 2.584
128+
count_adder_carry_p_cout[11].cin[0] (adder_carry) 0.043 2.627
129+
count_adder_carry_p_cout[11].cout[0] (adder_carry) 0.070 2.696
130+
count_adder_carry_p_cout[12].cin[0] (adder_carry) 0.053 2.749
131+
count_adder_carry_p_cout[12].cout[0] (adder_carry) 0.070 2.819
132+
count_adder_carry_p_cout[13].cin[0] (adder_carry) 0.043 2.862
133+
count_adder_carry_p_cout[13].cout[0] (adder_carry) 0.070 2.932
134+
count_adder_carry_p_cout[14].cin[0] (adder_carry) 0.053 2.985
135+
count_adder_carry_p_cout[14].sumout[0] (adder_carry) 0.040 3.025
136+
count_dffsre_Q_D[13].in[0] (.names) 0.564 3.589
137+
count_dffsre_Q_D[13].out[0] (.names) 0.228 3.818
138+
count[13].D[0] (dffsre) 0.000 3.818
139+
data arrival time 3.818
140+
141+
clock clk (rise edge) 0.000 0.000
142+
clock source latency 0.000 0.000
143+
clk.inpad[0] (.input) 0.000 0.000
144+
count[13].C[0] (dffsre) 0.715 0.715
145+
clock uncertainty 0.000 0.715
146+
cell setup time -0.057 0.659
147+
data required time 0.659
148+
------------------------------------------------------------------------------------------
149+
data required time 0.659
150+
data arrival time -3.818
151+
------------------------------------------------------------------------------------------
152+
slack (VIOLATED) -3.159
153+
154+
155+
#End of timing report
156+
#RPT METADATA:
157+
path_index/clock_launch_path_elements_num/arrival_path_elements_num
158+
0/2/30
159+
",
160+
"STATUS": "1"
161+
}
162+
163+
Draw selected critical path elements example
164+
--------------------------------------------
165+
166+
Let's take a look at an example of a request timing report telegram body with the following options:
167+
168+
- path_elements = path 0 and it's sub-elements 10,11,12,13,14,15,20,21,22,23,24,25
169+
- high_light_mode = "crit path flylines delays"
170+
- draw_path_contour = 1
171+
172+
.. code-block:: json
173+
:caption: telegram body **REQUEST** example
174+
:linenos:
175+
176+
{
177+
"JOB_ID": "2",
178+
"CMD": "1",
179+
"OPTIONS": "string:path_elements:0#10,11,12,13,14,15,20,21,22,23,24,25;string:high_light_mode:crit path flylines delays;bool:draw_path_contour:1"
180+
}
181+
182+
**high_light_mode** could have following string values:
183+
184+
- "crit path flylines"
185+
- "crit path flylines delays"
186+
- "crit path routing"
187+
- "crit path routing delays"
188+
189+
Response will look like:
190+
191+
.. code-block:: json
192+
:caption: telegram body **RESPONSE** example
193+
:linenos:
194+
195+
{
196+
"JOB_ID": "2",
197+
"CMD": "1",
198+
"OPTIONS": "string:path_elements:0#10,11,12,13,14,15,20,21,22,23,24,25;string:high_light_mode:crit path flylines delays;bool:draw_path_contour:1",
199+
"DATA": "",
200+
"STATUS": "1"
201+
}
202+
203+
.. note:: If status is not 1, the field ***DATA*** contains error string.
204+
205+
206+
207+
208+

vpr/src/base/vpr_api.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,9 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,
828828
routing_delay_calc = std::make_shared<RoutingDelayCalculator>(atom_ctx.nlist, atom_ctx.lookup, net_delay, is_flat);
829829
timing_info = make_setup_hold_timing_info(routing_delay_calc, router_opts.timing_update_type);
830830
#ifndef NO_SERVER
831-
if (g_vpr_ctx.server().gateIO().is_running()) {
832-
g_vpr_ctx.mutable_server().set_timing_info(timing_info);
833-
g_vpr_ctx.mutable_server().set_routing_delay_calc(routing_delay_calc);
831+
if (g_vpr_ctx.server().gate_io.is_running()) {
832+
g_vpr_ctx.mutable_server().timing_info = timing_info;
833+
g_vpr_ctx.mutable_server().routing_delay_calc = routing_delay_calc;
834834
}
835835
#endif /* NO_SERVER */
836836
} else {
@@ -1080,7 +1080,7 @@ void vpr_init_server(const t_vpr_setup& vpr_setup) {
10801080
#ifndef NO_SERVER
10811081
if (vpr_setup.ServerOpts.is_server_mode_enabled) {
10821082
/* Set up a server and its callback to be triggered at 100ms intervals by the timer's timeout event. */
1083-
server::GateIO& gate_io = g_vpr_ctx.mutable_server().mutable_gateIO();
1083+
server::GateIO& gate_io = g_vpr_ctx.mutable_server().gate_io;
10841084
if (!gate_io.is_running()) {
10851085
gate_io.start(vpr_setup.ServerOpts.port_num);
10861086
g_timeout_add(/*interval_ms*/ 100, server::update, &application);

0 commit comments

Comments
 (0)