Skip to content

End user documentation for Interactive Path Analysis Tool (VPR server mode) #2560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d3a5866
add ipa user end documentation
w0lek May 7, 2024
3ff45b2
adjust svg sizes for ipa end user doc
w0lek May 7, 2024
4abbf4d
refactor ServerCOntext to be a structl, in order to use it's member i…
w0lek May 7, 2024
55139ed
correct and add comments to telegramparser.h
w0lek May 8, 2024
cbe3ead
minor changes for server mode code commenting
w0lek May 8, 2024
df9ef42
add doc for bytearray.h
w0lek May 8, 2024
81b34e5
add more comments for server mode
w0lek May 8, 2024
1e58803
cover server/task.h with comments
w0lek May 8, 2024
af2f597
add comments to server/telegramoptions.h
w0lek May 8, 2024
84881e6
add comments for server/telegramheader.h
w0lek May 8, 2024
9c08e51
correct .. doxygenfunction:: server::calc_critical_path
w0lek May 8, 2024
5fd9029
add few more comments for server mode code
w0lek May 8, 2024
a977ca4
update doc for draw_crit_path_elements
w0lek May 8, 2024
c0fe33e
fix telegramframe doc
w0lek May 8, 2024
7418fa4
work on server_mode/index.rst
w0lek May 8, 2024
b5f3049
server mode doc corrections
w0lek May 8, 2024
3ecdfa8
adjustments for server/index.rst
w0lek May 8, 2024
07f68c9
Merge branch 'ipa_it2_clean' into ipa_end_user_doc
w0lek May 24, 2024
034ef1b
fix post-merge build error
w0lek May 24, 2024
edd1e49
correct comment for void draw_crit_path
w0lek May 24, 2024
c738215
update doc for std::pair<bool, std::size_t> ByteArray::find_sequence …
w0lek May 24, 2024
6ad25c6
update doc for ByteArray for method for a implicit conversion to std:…
w0lek May 24, 2024
e3cea63
update doc for CritPathsResultPtr calc_critical_path(const std::strin…
w0lek May 24, 2024
ec0e3ef
update task doc
w0lek May 24, 2024
60c5426
unite telegrambuffer constructors
w0lek May 24, 2024
c0ddd92
rename member 'data' to 'body' in TelegramFrame
w0lek May 24, 2024
475f0a9
rename comm::TelegramHeader::construct_from_data to comm::TelegramHea…
w0lek May 24, 2024
71f11b6
fix TelegramHeader doc
w0lek May 24, 2024
86eca51
minor arg rename in TelegramHeader constructor
w0lek May 27, 2024
3eb220f
Merge branch 'master' into ipa_end_user_doc
w0lek May 27, 2024
6875ba5
minimize diff
w0lek May 27, 2024
e6a18ec
code comment formatting
w0lek May 28, 2024
7c7cc98
correct doxygen doc
w0lek May 28, 2024
0157aa8
fix doxygen formatting
w0lek May 28, 2024
c40f578
Merge branch 'master' into ipa_end_user_doc
w0lek Jun 6, 2024
73fc03c
fix typo
w0lek Jun 6, 2024
c634775
add note for explaining data structure std::map<std::size_t, std::set…
w0lek Jun 7, 2024
b454ee9
fix typo
w0lek Jun 7, 2024
69e734e
extend telegramheader doc with adding nore for DATA_CHECKSUM and COMP…
w0lek Jun 7, 2024
af9541e
enhance telegramheader field [ 1 byte ]: COMPRESSOR_ID description
w0lek Jun 7, 2024
c445d93
add doc for TelegramBuffer::check_telegram_header_presence
w0lek Jun 7, 2024
138f8b7
remove std::vector<TelegramFramePtr> TelegramBuffer::take_telegram_fr…
w0lek Jun 7, 2024
56d8abc
enhance Telegram Buffer doc
w0lek Jun 7, 2024
86d31a3
rename Task::success to ::set_success, Task::fail to ::set_fail
w0lek Jun 7, 2024
e3cff27
Task::cmd now is comm::CMD enum, add doc reference to such enum to li…
w0lek Jun 7, 2024
3b2eb6a
add enum comm::CMD to server.rst to make reference work in the doc
w0lek Jun 7, 2024
7f8d0c6
update calc_critical_path doc
w0lek Jun 10, 2024
b552192
make GateIO::is_running doc shorter
w0lek Jun 10, 2024
adaa276
typo fix
w0lek Jun 10, 2024
c92e52c
simplify GateIO description a bit, typo fix
w0lek Jun 10, 2024
eccfeda
enhance ByteArray doc a bit
w0lek Jun 10, 2024
95948f5
update void draw_crit_path_elements doc
w0lek Jun 10, 2024
f4d6824
update doc for draw_crit_path_contour
w0lek Jun 10, 2024
ecd7377
typo fix
w0lek Jun 10, 2024
5d18602
add more doc for JOB_ID
w0lek Jun 10, 2024
05ecf74
sync JOB_ID and CMD json keys order in server_mode/index.rst
w0lek Jun 10, 2024
c27edfb
update comm_telegram_body_structure.svg and .odg by changing order of…
w0lek Jun 10, 2024
4f28a00
server_mode/index.rst, describe more about COMPRESSOR_ID and CHECKSUM…
w0lek Jun 10, 2024
6eb326e
add high-level context of explanation for server mode into command_l…
w0lek Jun 10, 2024
97ad7f7
add high-level context of explanation for server mode into server_mo…
w0lek Jun 10, 2024
bdf1391
Merge pull request #11 from w0lek/ipa_end_user_doc_develop
w0lek Jun 10, 2024
46fb5ea
Merge branch 'master' into ipa_end_user_doc
w0lek Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/src/api/vpr/contexts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ Structures
.. doxygenstruct:: TimingContext
:project: vpr
:members:

.. doxygenstruct:: ServerContext
:project: vpr
:members:
1 change: 1 addition & 0 deletions doc/src/api/vpr/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ VPR API
netlist
route_tree
rr_graph
server
83 changes: 83 additions & 0 deletions doc/src/api/vpr/server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
========
Server
========

server::update
--------------

.. doxygenfunction:: server::update
:project: vpr

server::GateIO
--------------

.. doxygenclass:: server::GateIO
:project: vpr
:members:

server::Task
------------

.. doxygenfile:: commcmd.h
:project: vpr

.. doxygenclass:: server::Task
:project: vpr
:members:

server::TaskResolver
--------------------

.. doxygenclass:: server::TaskResolver
:project: vpr
:members:

.. doxygenstruct:: server::CritPathsResult
:project: vpr
:members:

.. doxygenfunction:: server::calc_critical_path
:project: vpr

.. doxygenenum:: e_timing_report_detail
:project: vpr

comm::Telegram
--------------

.. doxygenclass:: comm::TelegramHeader
:project: vpr
:members:

.. doxygenstruct:: comm::TelegramFrame
:project: vpr
:members:

.. doxygenclass:: comm::TelegramBuffer
:project: vpr
:members:

.. doxygenclass:: comm::ByteArray
:project: vpr
:members:

Parsers
-------

.. doxygenclass:: server::TelegramOptions
:project: vpr
:members:

.. doxygenclass:: comm::TelegramParser
:project: vpr
:members:


Compression utils
-----------------

.. doxygenfunction:: try_compress
:project: vpr

.. doxygenfunction:: try_decompress
:project: vpr
21 changes: 21 additions & 0 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,27 @@ The following options are used to enable power estimation in VPR.

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

Server Mode Options
^^^^^^^^^^^^^^^^^^^^^^^^

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.

The following options are used to enable server mode in VPR.

.. seealso:: :ref:`server_mode` for more details.

.. option:: --server

Run in server mode. Accept single client application connection and respond to client requests

**Default:** ``off``

.. option:: --port PORT

Server port number.

**Default:** ``60555``

Command-line Auto Completion
----------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/src/vtr/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ VTR also includes a set of benchmark designs known to work with the design flow.
running_vtr
benchmarks
power_estimation/index.rst
server_mode/index.rst
tasks
run_vtr_flow
run_vtr_task
Expand Down
Binary file not shown.
293 changes: 293 additions & 0 deletions doc/src/vtr/server_mode/comm_telegram_body_structure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
584 changes: 584 additions & 0 deletions doc/src/vtr/server_mode/comm_telegram_structure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
208 changes: 208 additions & 0 deletions doc/src/vtr/server_mode/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
.. _server_mode:

Server Mode
================

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.
VPR provides the ability to run in server mode using the following command-line arguments.

.. code-block:: none

--server --port_num 60555

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**.

Communication telegram
-------------------------

Telegram consists of two parts: a fixed-size **telegram header** and a variable-size **telegram body**.
The telegram header contains helper information required to properly extract the telegram body sequence from the data flow.

.. _fig_comm_telegram_structure:

.. figure:: comm_telegram_structure.*

Communication telegram structure.

.. note:: The telegram body itself could be compressed with zlib to minimize the amount of data transferred over the socket.
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.
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.

.. 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.
If checksums are mismatched, the telegram is considered invalid and is skipped in processing.


.. _fig_comm_telegram_body_structure:

.. figure:: comm_telegram_body_structure.*

Communication telegram body structure.

**telegram body** is a flat **JSON** structure.

**CMD** could have following integer values:

- 0 - command id for **get critical path**
- 1 - command id for **highlight selected path elements**

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.


Get critical path timing report example
---------------------------------------

Let's take a look at an example of a request timing report telegram body with the following options:

- path_num = 1
- path_type = "setup"
- details_level = "netlist"
- is_flat_routing = false

.. code-block:: json
:caption: telegram body **REQUEST** example
:linenos:

{
"JOB_ID": "1",
"CMD": "0",
"OPTIONS": "int:path_num:1;string:path_type:setup;string:details_level:netlist;bool:is_flat_routing:0"
}

**path_type** could have following string values:

- "setup"
- "hold"

**details_level** could have following string values:

- "netlist"
- "aggregated"
- "detailed"
- "debug"

Response will look like:

.. code-block:: json
:caption: telegram body **RESPONSE** example
:linenos:

{
"JOB_ID": "1",
"CMD": "0",
"OPTIONS": "int:path_num:1;string:path_type:setup;string:details_level:netlist;bool:is_flat_routing:0",
"DATA": "
#Timing report of worst 1 path(s)
# Unit scale: 1e-09 seconds
# Output precision: 3

#Path 1
Startpoint: count[1].Q[0] (dffsre clocked by clk)
Endpoint : count[13].D[0] (dffsre clocked by clk)
Path Type : setup

Point Incr Path
------------------------------------------------------------------------------------------
clock clk (rise edge) 0.000 0.000
clock source latency 0.000 0.000
clk.inpad[0] (.input) 0.000 0.000
count[1].C[0] (dffsre) 0.715 0.715
count[1].Q[0] (dffsre) [clock-to-output] 0.286 1.001
count_adder_carry_p_cout[2].p[0] (adder_carry) 0.573 1.574
count_adder_carry_p_cout[2].cout[0] (adder_carry) 0.068 1.642
count_adder_carry_p_cout[3].cin[0] (adder_carry) 0.043 1.685
count_adder_carry_p_cout[3].cout[0] (adder_carry) 0.070 1.755
count_adder_carry_p_cout[4].cin[0] (adder_carry) 0.053 1.808
count_adder_carry_p_cout[4].cout[0] (adder_carry) 0.070 1.877
count_adder_carry_p_cout[5].cin[0] (adder_carry) 0.043 1.921
count_adder_carry_p_cout[5].cout[0] (adder_carry) 0.070 1.990
count_adder_carry_p_cout[6].cin[0] (adder_carry) 0.053 2.043
count_adder_carry_p_cout[6].cout[0] (adder_carry) 0.070 2.113
count_adder_carry_p_cout[7].cin[0] (adder_carry) 0.043 2.156
count_adder_carry_p_cout[7].cout[0] (adder_carry) 0.070 2.226
count_adder_carry_p_cout[8].cin[0] (adder_carry) 0.053 2.279
count_adder_carry_p_cout[8].cout[0] (adder_carry) 0.070 2.348
count_adder_carry_p_cout[9].cin[0] (adder_carry) 0.043 2.391
count_adder_carry_p_cout[9].cout[0] (adder_carry) 0.070 2.461
count_adder_carry_p_cout[10].cin[0] (adder_carry) 0.053 2.514
count_adder_carry_p_cout[10].cout[0] (adder_carry) 0.070 2.584
count_adder_carry_p_cout[11].cin[0] (adder_carry) 0.043 2.627
count_adder_carry_p_cout[11].cout[0] (adder_carry) 0.070 2.696
count_adder_carry_p_cout[12].cin[0] (adder_carry) 0.053 2.749
count_adder_carry_p_cout[12].cout[0] (adder_carry) 0.070 2.819
count_adder_carry_p_cout[13].cin[0] (adder_carry) 0.043 2.862
count_adder_carry_p_cout[13].cout[0] (adder_carry) 0.070 2.932
count_adder_carry_p_cout[14].cin[0] (adder_carry) 0.053 2.985
count_adder_carry_p_cout[14].sumout[0] (adder_carry) 0.040 3.025
count_dffsre_Q_D[13].in[0] (.names) 0.564 3.589
count_dffsre_Q_D[13].out[0] (.names) 0.228 3.818
count[13].D[0] (dffsre) 0.000 3.818
data arrival time 3.818

clock clk (rise edge) 0.000 0.000
clock source latency 0.000 0.000
clk.inpad[0] (.input) 0.000 0.000
count[13].C[0] (dffsre) 0.715 0.715
clock uncertainty 0.000 0.715
cell setup time -0.057 0.659
data required time 0.659
------------------------------------------------------------------------------------------
data required time 0.659
data arrival time -3.818
------------------------------------------------------------------------------------------
slack (VIOLATED) -3.159


#End of timing report
#RPT METADATA:
path_index/clock_launch_path_elements_num/arrival_path_elements_num
0/2/30
",
"STATUS": "1"
}

Draw selected critical path elements example
--------------------------------------------

Let's take a look at an example of a request timing report telegram body with the following options:

- path_elements = path 0 and it's sub-elements 10,11,12,13,14,15,20,21,22,23,24,25
- high_light_mode = "crit path flylines delays"
- draw_path_contour = 1

.. code-block:: json
:caption: telegram body **REQUEST** example
:linenos:

{
"JOB_ID": "2",
"CMD": "1",
"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"
}

**high_light_mode** could have following string values:

- "crit path flylines"
- "crit path flylines delays"
- "crit path routing"
- "crit path routing delays"

Response will look like:

.. code-block:: json
:caption: telegram body **RESPONSE** example
:linenos:

{
"JOB_ID": "2",
"CMD": "1",
"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",
"DATA": "",
"STATUS": "1"
}

.. note:: If status is not 1, the field ***DATA*** contains error string.





8 changes: 4 additions & 4 deletions vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,9 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,
routing_delay_calc = std::make_shared<RoutingDelayCalculator>(atom_ctx.nlist, atom_ctx.lookup, net_delay, is_flat);
timing_info = make_setup_hold_timing_info(routing_delay_calc, router_opts.timing_update_type);
#ifndef NO_SERVER
if (g_vpr_ctx.server().gateIO().is_running()) {
g_vpr_ctx.mutable_server().set_timing_info(timing_info);
g_vpr_ctx.mutable_server().set_routing_delay_calc(routing_delay_calc);
if (g_vpr_ctx.server().gate_io.is_running()) {
g_vpr_ctx.mutable_server().timing_info = timing_info;
g_vpr_ctx.mutable_server().routing_delay_calc = routing_delay_calc;
}
#endif /* NO_SERVER */
} else {
Expand Down Expand Up @@ -1080,7 +1080,7 @@ void vpr_init_server(const t_vpr_setup& vpr_setup) {
#ifndef NO_SERVER
if (vpr_setup.ServerOpts.is_server_mode_enabled) {
/* Set up a server and its callback to be triggered at 100ms intervals by the timer's timeout event. */
server::GateIO& gate_io = g_vpr_ctx.mutable_server().mutable_gateIO();
server::GateIO& gate_io = g_vpr_ctx.mutable_server().gate_io;
if (!gate_io.is_running()) {
gate_io.start(vpr_setup.ServerOpts.port_num);
g_timeout_add(/*interval_ms*/ 100, server::update, &application);
Expand Down
Loading
Loading