Skip to content

Interactive Path Analysis Feature Integration #2526

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 145 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
59c712c
add Interactive Path Analysis (iteration 2, with multiselection featu…
w0lek Mar 15, 2024
db4ff57
return draw_crit_path_elements to be used in IPA, change the entry po…
w0lek Mar 25, 2024
6b5ef3e
minor changes
w0lek Mar 25, 2024
ec044ec
remove timing report modification, adding report metadata string to t…
w0lek Mar 28, 2024
d7e28d4
minimize diff in tatum/TimingReporter.cpp
w0lek Mar 28, 2024
f941c6a
fix spellmistake, rename from OPTION_IS_FLOAT_ROUTING to OPTION_IS_FL…
w0lek Mar 28, 2024
b0fbefd
correct spell mistake, renaming OPTION_HIGHTLIGHT_MODE to OPTION_HIGH…
w0lek Mar 28, 2024
8dfc1ae
move gtkcomboboxhelper into draw subfolder
w0lek Mar 28, 2024
94aaf71
spell correction
w0lek Mar 28, 2024
df14178
typo in comment
w0lek Mar 28, 2024
94ddbba
few minor fixes
w0lek Mar 28, 2024
c871dd5
typo in comment
w0lek Mar 28, 2024
927bc3a
few more minor fixes in telegramoptions.h
w0lek Mar 28, 2024
9f636d6
typo in var name fix
w0lek Mar 28, 2024
5002740
few more minor fixes
w0lek Mar 28, 2024
8bb4a9d
add default constructor for TelegramBuffer, requested in PR
w0lek Mar 28, 2024
51525cf
using stream.eof() in tryConvertToInt
w0lek Apr 1, 2024
6f6c7fd
constructor TelegramBuffer(int) is explicit
w0lek Apr 1, 2024
ff4be46
TelegramOptions::isDataTypeSupported is const
w0lek Apr 1, 2024
d3c5180
tryConvertToInt uses vtr::atoi
w0lek Apr 1, 2024
6cab9c4
gtkcomboboxhelper.cpp and .h, update documentation, replace anonymous…
w0lek Apr 1, 2024
62cc12a
GateIO add deletion constructors
w0lek Apr 1, 2024
07d4fa3
add doc for public methods of gateio, improve GateIO::takeReceivedTas…
w0lek Apr 1, 2024
b5d3994
add comment to gateio.h about tasksMutex
w0lek Apr 1, 2024
ab867d3
GateIO information about usage from main thread is added
w0lek Apr 1, 2024
bed8f4b
move TelegramOptions definitions to a .cpp file
w0lek Apr 1, 2024
7d21166
replace splitString with vtr::split
w0lek Apr 1, 2024
a9a9085
replace anonymous namespaces with static functions
w0lek Apr 1, 2024
7cf6131
pathhelper.cpp formatting to make some lines shorter
w0lek Apr 1, 2024
0c42d0b
add doc to telegrambuffer.h
w0lek Apr 2, 2024
df28932
add comments for TelegramBuffer::takeTelegramFrames
w0lek Apr 2, 2024
faf9a07
add IPA unittests
w0lek Apr 2, 2024
f9ffb52
add test_server_telegramoptions_get_wrong_keys TEST_CASE
w0lek Apr 2, 2024
e02e0c5
include std::string in telegramoptions.h
w0lek Apr 5, 2024
c752064
move include gateio.h and serverupdate.h under condition #ifndef NO_G…
w0lek Apr 5, 2024
e1372bc
fix build errors with NO_GRAPHICS flag defined
w0lek Apr 5, 2024
6586c12
remove anonymous namespace from test_server_*.cpp
w0lek Apr 5, 2024
e6c136f
fix post #endif comment formatting
w0lek Apr 5, 2024
ebff401
Merge branch 'master' into ipa_it2_clean
w0lek Apr 5, 2024
abcc69a
fix warning [cast from type ‘const char*’ to type ‘Bytef*’] in zlibtu…
w0lek Apr 6, 2024
087fb13
remove thirdparty/sockpp/conanfile.py since it's not used during buil…
w0lek Apr 6, 2024
44a95ca
move sockpp to lib/EXTERNAL as a submodule
w0lek Apr 12, 2024
3b9728c
move --server and --port into separate argument group "server options…
w0lek Apr 12, 2024
50d79c3
pass argument in ServerContext::set_crit_path_elements by ref, add Se…
w0lek Apr 12, 2024
585b5ab
cleanup: remove cmake THIRDPARTY_INCLUDE_DIRS as not needed
w0lek Apr 12, 2024
f2f47b1
Some sockpp headers generate warnings, so treat them as system header…
w0lek Apr 12, 2024
08e754b
implement server functionality as a module which could be disabled du…
w0lek Apr 15, 2024
e2e9ad0
fix contour_color formatting
w0lek Apr 15, 2024
61b1b1b
fix formatting in draw_crit_path_elements
w0lek Apr 15, 2024
bbe8a9b
fix code formatting
w0lek Apr 15, 2024
a1f08c4
use reference to tatum::TimingPathElem while iterating in draw_crit_p…
w0lek Apr 15, 2024
b9b33d8
use elementCounter for element color instead of i
w0lek Apr 15, 2024
0959238
use snake_case for variables in draw_crit_path_elements
w0lek Apr 15, 2024
200dbbd
formatting fix in gtkcomboboxhelper.cpp
w0lek Apr 15, 2024
1150189
replace NULL with nullptr in gtkcomboboxhelper.cpp
w0lek Apr 15, 2024
bf67582
typo fix
w0lek Apr 15, 2024
b2bd272
move std::move semantic on top of TaskResolver interface. rename ::ad…
w0lek Apr 15, 2024
b582978
taskresolver uses VTR_LOG_ERROR instead of std::cerr
w0lek Apr 15, 2024
ab8971d
task resolver, improve the case with unhandled path details level str…
w0lek Apr 15, 2024
65d5900
taskresolver format fix
w0lek Apr 15, 2024
4d1e882
remove useless shortcut const Netlist<>&
w0lek Apr 15, 2024
a1b02c0
using VTR_LOG instead of std::cout in gateio
w0lek Apr 15, 2024
f34fa57
typo in comment
w0lek Apr 15, 2024
46d2f20
gateio, initilize receivedMessage once before loop
w0lek Apr 15, 2024
be03fc2
typo fixes
w0lek Apr 15, 2024
3e0a784
refactor GateIO::startListening by splitting it's huge body to serial…
w0lek Apr 16, 2024
f5d6d1e
remove redundant std::move inside TelegramParser::tryExtractJsonValueStr
w0lek Apr 16, 2024
49dd7ab
telegramparser: return std::optional<std::string> instead of passing…
w0lek Apr 16, 2024
968f7b6
fix unused variable warning in gateio
w0lek Apr 16, 2024
437d21d
remove CRITICAL_PATH_ITEMS_SELECTION_NONE as unused, add const for EC…
w0lek Apr 16, 2024
7a84ac6
commconstants.h uses std::string_view instead of char*
w0lek Apr 16, 2024
f7dfd50
fix warning unused variable in gateio
w0lek Apr 16, 2024
4748ac2
pathhelper uses KEY_SETUP_PATH_LIST and KEY_HOLD_PATH_LIST
w0lek Apr 16, 2024
aadee42
get ref to string instead of copy in TelegramOptions constructor
w0lek Apr 16, 2024
a3aef6d
optimize Option instance creation
w0lek Apr 16, 2024
5f1a732
remove redundant std::move in getTruncatedMiddleStr
w0lek Apr 16, 2024
236ed56
code formatting
w0lek Apr 16, 2024
81e9b2d
code formatting fix
w0lek Apr 16, 2024
f5fd142
code formatting fix
w0lek Apr 16, 2024
7395c36
add space after each comma in test_server_taskresolver.cpp
w0lek Apr 16, 2024
c53f704
typo fix
w0lek Apr 16, 2024
9f3f281
code formatting fix
w0lek Apr 16, 2024
ecf6ede
indentation in task.cpp
w0lek Apr 16, 2024
1506997
remove redundant std::move in tasks.cpp
w0lek Apr 16, 2024
6c4c873
code formatting
w0lek Apr 16, 2024
e7d6ec2
code formatting
w0lek Apr 16, 2024
a38b28a
code formatting
w0lek Apr 16, 2024
892944d
resize receivedMessage buffer outside the loop
w0lek Apr 16, 2024
e58efd0
add comment for ClientAliveTracker class
w0lek Apr 16, 2024
6cf5db3
allocate resultBuffer on the heap in zlibutils
w0lek Apr 17, 2024
5b440ec
rework commconstants to use extern std::string instead of std::string…
w0lek Apr 17, 2024
1de3eff
delete[] resultBuffer before return, which fix potential memory leak …
w0lek Apr 17, 2024
d5168df
tryCompress and tryDecompress returns std::optional<std::string> inst…
w0lek Apr 17, 2024
edb8fd4
add documentation for tryCompress and tryDecompress methods in zlibutils
w0lek Apr 17, 2024
0a7580b
add doc for TelegramHeader and TelegramFrame structures
w0lek Apr 17, 2024
c4e7357
optimization related with std::string allocation in TelegramParser::t…
w0lek Apr 17, 2024
038440e
unite generate_setup_timing_report and generate_hold_timing_report in…
w0lek Apr 17, 2024
cf3c11e
store SetupHoldTimingInfo and PostClusterDelayCalculator inside Serve…
w0lek Apr 21, 2024
6649088
snakecase for zlibutils
w0lek Apr 22, 2024
83b5fe8
snakecase in zlibutils.cpp
w0lek Apr 22, 2024
1ac572b
snakecase for telegramparser
w0lek Apr 22, 2024
ef942f5
snakecase for telegramoptions
w0lek Apr 22, 2024
3aed8fc
snakecase in telegramheader
w0lek Apr 22, 2024
c019984
snakecase for telegrambuffer
w0lek Apr 22, 2024
a59e33c
snakecase for taskresolver
w0lek Apr 22, 2024
87c4fd4
snakecase for server::Task
w0lek Apr 22, 2024
e62a990
snakecase in serverupdate
w0lek Apr 22, 2024
482f04b
snakecase for pathhelper
w0lek Apr 22, 2024
adaa43d
snakecase in gateio
w0lek Apr 22, 2024
111b698
snakecase for convertutils
w0lek Apr 22, 2024
05fdd4b
wrap more server related files with NO_SERVER macro
w0lek Apr 22, 2024
723db0b
snake case for bytearray
w0lek Apr 22, 2024
1afb1c8
minimize diff caused by formatting
w0lek Apr 22, 2024
42abe49
server specific unit tests wrapped with NO_SERVER macro
w0lek Apr 22, 2024
4ada45c
update sockpp submodule to use fork which has fixes of compilation wa…
w0lek Apr 23, 2024
ff1e438
Merge branch 'master' into ipa_it2_clean
w0lek Apr 23, 2024
761c1be
CI: add test case when graphic is enabled but server mode is disabled
w0lek May 8, 2024
0a0d009
Merge branch 'master' into ipa_it2_clean
w0lek May 8, 2024
5efd5c1
make draw_crit_path_elements more generic, now it doesn't depend on S…
w0lek May 9, 2024
974eed0
sanity checks for port number in CheckSetup() is added
w0lek May 21, 2024
5b10a33
code format
w0lek May 21, 2024
5886d61
ByteArray::find_sequence returns std::pair<bool, std::size_t> instead…
w0lek May 21, 2024
09a75de
constexpr instead of static for get_truncated_middle_str::middle_plac…
w0lek May 21, 2024
55b2aa8
constexpr instead of static for get_truncated_middle_str::minimal_str…
w0lek May 21, 2024
0803dfb
get_pretty_str_from_float replaced with get_pretty_str_from_double to…
w0lek May 21, 2024
565adea
reimplement TelegramOptions::is_data_type_supported
w0lek May 21, 2024
b620135
replace unneccessary "std::string(name)" with just "name"
w0lek May 21, 2024
563eb54
align << operator in Task::info()
w0lek May 21, 2024
333dd5c
optimization in Task::bake_response() to avoid unnecessary data coping
w0lek May 21, 2024
8d639fc
avoid TelegramFrame copy constructor in TelegramBuffer::take_telegram…
w0lek May 21, 2024
e931555
remove obsolete members from ServerContext
w0lek May 21, 2024
1193fca
fix build after cleanup
w0lek May 21, 2024
32c0730
simplify bool draw_current_element logic
w0lek May 21, 2024
a608ba1
add comment of default value for skip_draw_delays in draw_flyline_tim…
w0lek May 21, 2024
531f485
code formatting
w0lek May 21, 2024
86eeedd
cleanup subtree_config.xml from sockpp
w0lek May 21, 2024
a4c90dd
typo fix
w0lek May 21, 2024
e1b578a
constexpr instead of local static in TelegramParser::try_extract_json…
w0lek May 21, 2024
f35de4e
variable BYTES_NUM_IN_32KB for 32768
w0lek May 21, 2024
6e0a0dc
remove commconstants.cpp, use inline for declaring const std::string …
w0lek May 21, 2024
6d0b10e
fix ;;
w0lek May 21, 2024
1e4f109
ByteArray inherits std::vector<char> instead of std::vector<uint8_t>
w0lek May 22, 2024
0f6c83c
implicit conversion ByteArray to std::string_view, remove template fo…
w0lek May 22, 2024
453f417
std::move optimizations for crit paths result and report string
w0lek May 22, 2024
2b74463
Merge branch 'master' into ipa_it2_clean
w0lek May 22, 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
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ jobs:
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off',
suite: 'vtr_reg_basic'
},
{
name: 'Basic with NO_SERVER',
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=on -DVPR_USE_SERVER=off',
suite: 'vtr_reg_basic'
},
{
name: 'Basic with CAPNPROTO disabled',
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off',
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "libs/EXTERNAL/libcatch2"]
path = libs/EXTERNAL/libcatch2
url = https://github.com/catchorg/Catch2.git
[submodule "libs/EXTERNAL/sockpp"]
path = libs/EXTERNAL/sockpp
#url = git@github.com:fpagliughi/sockpp.git
url = git@github.com:w0lek/sockpp.git # fork where in branch v1.0.0_no_complication_warnings there are compilation warnings fixes for upstream tag v1.0.0 of sockpp
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics libr
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VPR." ON)

#Allow the user to decide whether to compile the server module
option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)

#Allow the user to enable/disable VPR analytic placement
#VPR option --enable_analytic_placer is also required for Analytic Placement
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
Expand Down
17 changes: 17 additions & 0 deletions libs/EXTERNAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ add_subdirectory(libtatum)
add_subdirectory(libcatch2)
#add_subdirectory(parmys)

#VPR_USE_SERVER is initialized in the root CMakeLists
#compile sockpp only if server mode is enabled
if (VPR_USE_SERVER)
set(SOCKPP_BUILD_SHARED OFF CACHE BOOL "Override default value" FORCE)
set(SOCKPP_BUILD_STATIC ON CACHE BOOL "Override default value" FORCE)
add_subdirectory(sockpp)
endif()

#VPR_USE_EZGL is initialized in the root CMakeLists.
#compile libezgl only if the user asks for or has its dependencies installed.
if (VPR_USE_EZGL STREQUAL "on")
Expand Down Expand Up @@ -132,3 +140,12 @@ target_include_directories(Catch2
$<INSTALL_INTERFACE:include>
)

# Some sockpp headers generate warnings, so treat them as system headers to suppress warnings
if (VPR_USE_SERVER)
target_include_directories(sockpp-static
SYSTEM
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sockpp/include>
$<INSTALL_INTERFACE:include>
)
endif()
18 changes: 18 additions & 0 deletions libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ void TimingReporter::report_timing_setup(std::ostream& os,
report_timing(os, paths);
}

void TimingReporter::report_timing_setup(std::vector<tatum::TimingPath>& paths,
std::ostream& os,
const SetupTimingAnalyzer& setup_analyzer,
size_t npaths) const {
paths = path_collector_.collect_worst_setup_timing_paths(timing_graph_, setup_analyzer, npaths);

report_timing(os, paths);
}

void TimingReporter::report_timing_hold(std::string filename,
const HoldTimingAnalyzer& hold_analyzer,
size_t npaths) const {
Expand All @@ -114,6 +123,15 @@ void TimingReporter::report_timing_hold(std::ostream& os,
report_timing(os, paths);
}

void TimingReporter::report_timing_hold(std::vector<tatum::TimingPath>& paths,
std::ostream& os,
const HoldTimingAnalyzer& hold_analyzer,
size_t npaths) const {
paths = path_collector_.collect_worst_hold_timing_paths(timing_graph_, hold_analyzer, npaths);

report_timing(os, paths);
}

void TimingReporter::report_skew_setup(std::string filename,
const SetupTimingAnalyzer& setup_analyzer,
size_t nworst) const {
Expand Down
2 changes: 2 additions & 0 deletions libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ class TimingReporter {
public:
void report_timing_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
void report_timing_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
void report_timing_setup(std::vector<tatum::TimingPath>& paths, std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;

void report_timing_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
void report_timing_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;
void report_timing_hold(std::vector<tatum::TimingPath>& paths, std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const;

void report_skew_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const;
void report_skew_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const;
Expand Down
1 change: 1 addition & 0 deletions libs/EXTERNAL/sockpp
Submodule sockpp added at 5388c4
28 changes: 27 additions & 1 deletion vpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ else()
message(STATUS "EZGL: graphics disabled")
endif()


#Handle server setup
set(SERVER_DEFINES "")

set(SERVER_DISABILED_REASON "")
if (VPR_USE_SERVER)
if (VPR_USE_EZGL STREQUAL "off")
set(SERVER_DISABILED_REASON ", due to EZGL being disabled")
set(VPR_USE_SERVER OFF)
endif()
endif()

if (VPR_USE_SERVER)
message(STATUS "Server mode is enabled")
else()
list(APPEND SERVER_DEFINES "-DNO_SERVER")
message(STATUS "Server mode is disabled${SERVER_DISABILED_REASON}")
endif()

#
# Build Configuration
#
Expand Down Expand Up @@ -87,6 +106,13 @@ target_link_libraries(libvpr
librrgraph
)

if(VPR_USE_SERVER)
target_link_libraries(libvpr
sockpp-static
-lz
)
endif()

#link graphics library only when graphics set to on
if (VPR_USE_EZGL STREQUAL "on")
target_link_libraries(libvpr
Expand Down Expand Up @@ -123,7 +149,7 @@ if (VPR_USE_EZGL STREQUAL "on")

endif()

target_compile_definitions(libvpr PUBLIC ${GRAPHICS_DEFINES})
target_compile_definitions(libvpr PUBLIC ${GRAPHICS_DEFINES} ${SERVER_DEFINES})

if(${VTR_ENABLE_CAPNPROTO})
target_link_libraries(libvpr libvtrcapnproto)
Expand Down
9 changes: 9 additions & 0 deletions vpr/src/base/CheckSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
void CheckSetup(const t_packer_opts& PackerOpts,
const t_placer_opts& PlacerOpts,
const t_router_opts& RouterOpts,
const t_server_opts& ServerOpts,
const t_det_routing_arch& RoutingArch,
const std::vector<t_segment_inf>& Segments,
const t_timing_inf Timing,
Expand Down Expand Up @@ -105,4 +106,12 @@ void CheckSetup(const t_packer_opts& PackerOpts,
"Place channel width must be even for unidirectional.\n");
}
}

if (ServerOpts.is_server_mode_enabled) {
if (ServerOpts.port_num < DYMANIC_PORT_RANGE_MIN || ServerOpts.port_num > DYNAMIC_PORT_RANGE_MAX) {
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
"Specified server port number `--port %d` is out of range [%d-%d]. Please specify a port number within that range.\n",
ServerOpts.port_num, DYMANIC_PORT_RANGE_MIN, DYNAMIC_PORT_RANGE_MAX);
}
}
}
4 changes: 4 additions & 0 deletions vpr/src/base/CheckSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
#define CHECKSETUP_H
#include "vpr_types.h"

const int DYMANIC_PORT_RANGE_MIN = 49152;
const int DYNAMIC_PORT_RANGE_MAX = 65535;

void CheckSetup(const t_packer_opts& PackerOpts,
const t_placer_opts& PlacerOpts,
const t_router_opts& RouterOpts,
const t_server_opts& ServerOpts,
const t_det_routing_arch& RoutingArch,
const std::vector<t_segment_inf>& Segments,
const t_timing_inf Timing,
Expand Down
9 changes: 9 additions & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static void SetupAnnealSched(const t_options& Options,
static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts);
static void SetupNocOpts(const t_options& Options,
t_noc_opts* NocOpts);
static void SetupServerOpts(const t_options& Options,
t_server_opts* ServerOpts);
static void SetupRoutingArch(const t_arch& Arch, t_det_routing_arch* RoutingArch);
static void SetupTiming(const t_options& Options, const bool TimingEnabled, t_timing_inf* Timing);
static void SetupSwitches(const t_arch& Arch,
Expand Down Expand Up @@ -99,6 +101,7 @@ void SetupVPR(const t_options* Options,
t_router_opts* RouterOpts,
t_analysis_opts* AnalysisOpts,
t_noc_opts* NocOpts,
t_server_opts* ServerOpts,
t_det_routing_arch* RoutingArch,
std::vector<t_lb_type_rr_node>** PackerRRGraphs,
std::vector<t_segment_inf>& Segments,
Expand Down Expand Up @@ -144,6 +147,7 @@ void SetupVPR(const t_options* Options,
SetupAnalysisOpts(*Options, *AnalysisOpts);
SetupPowerOpts(*Options, PowerOpts, Arch);
SetupNocOpts(*Options, NocOpts);
SetupServerOpts(*Options, ServerOpts);

if (readArchFile == true) {
vtr::ScopedStartFinishTimer t("Loading Architecture Description");
Expand Down Expand Up @@ -743,6 +747,11 @@ static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
NocOpts->noc_placement_file_name = Options.noc_placement_file_name;
}

static void SetupServerOpts(const t_options& Options, t_server_opts* ServerOpts) {
ServerOpts->is_server_mode_enabled = Options.is_server_mode_enabled;
ServerOpts->port_num = Options.server_port_num;
}

static void find_ipin_cblock_switch_index(const t_arch& Arch, int& wire_to_arch_ipin_switch, int& wire_to_arch_ipin_switch_between_dice) {
for (auto cb_switch_name_index = 0; cb_switch_name_index < (int)Arch.ipin_cblock_switch_name.size(); cb_switch_name_index++) {
int ipin_cblock_switch_index = UNDEFINED;
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void SetupVPR(const t_options* Options,
t_router_opts* RouterOpts,
t_analysis_opts* AnalysisOpts,
t_noc_opts* NocOpts,
t_server_opts* ServerOpts,
t_det_routing_arch* RoutingArch,
std::vector<t_lb_type_rr_node>** PackerRRGraphs,
std::vector<t_segment_inf>& Segments,
Expand Down
15 changes: 15 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,21 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("vpr_noc_placement_output.txt")
.show_in(argparse::ShowIn::HELP_ONLY);

#ifndef NO_SERVER
auto& server_grp = parser.add_argument_group("server options");

server_grp.add_argument<bool, ParseOnOff>(args.is_server_mode_enabled, "--server")
.help("Run in server mode."
"Accept client application connection and respond to requests." )
.action(argparse::Action::STORE_TRUE)
.default_value("off");

server_grp.add_argument<int>(args.server_port_num, "--port")
.help("Server port number.")
.default_value("60555")
.show_in(argparse::ShowIn::HELP_ONLY);
#endif /* NO_SERVER */

return parser;
}

Expand Down
4 changes: 4 additions & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ struct t_options {
argparse::ArgValue<bool> allow_dangling_combinational_nodes;
argparse::ArgValue<bool> terminate_if_timing_fails;

/* Server options */
argparse::ArgValue<bool> is_server_mode_enabled;
argparse::ArgValue<int> server_port_num;

/* Atom netlist options */
argparse::ArgValue<bool> absorb_buffer_luts;
argparse::ArgValue<e_const_gen_inference> const_gen_inference;
Expand Down
36 changes: 35 additions & 1 deletion vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
# include <tbb/global_control.h>
#endif

#ifndef NO_SERVER
#include "gateio.h"
#include "serverupdate.h"
#endif /* NO_SERVER */

/* Local subroutines */
static void free_complex_block_types();

Expand Down Expand Up @@ -291,6 +296,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a
&vpr_setup->RouterOpts,
&vpr_setup->AnalysisOpts,
&vpr_setup->NocOpts,
&vpr_setup->ServerOpts,
&vpr_setup->RoutingArch,
&vpr_setup->PackerRRGraph,
vpr_setup->Segments,
Expand All @@ -309,6 +315,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a
CheckSetup(vpr_setup->PackerOpts,
vpr_setup->PlacerOpts,
vpr_setup->RouterOpts,
vpr_setup->ServerOpts,
vpr_setup->RoutingArch, vpr_setup->Segments, vpr_setup->Timing, arch->Chans);

/* flush any messages to user still in stdout that hasn't gotten displayed */
Expand Down Expand Up @@ -387,6 +394,9 @@ bool vpr_flow(t_vpr_setup& vpr_setup, t_arch& arch) {

// TODO: Placer still assumes that cluster net list is used - graphics can not work with flat routing yet
vpr_init_graphics(vpr_setup, arch, false);

vpr_init_server(vpr_setup);

{ //Place
const auto& placement_net_list = (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
bool place_success = vpr_place_flow(placement_net_list, vpr_setup, arch);
Expand Down Expand Up @@ -806,6 +816,12 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,
auto& atom_ctx = g_vpr_ctx.atom();
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);
}
#endif /* NO_SERVER */
} else {
/* No delay calculator (segfault if the code calls into it) and wirelength driven routing */
timing_info = make_constant_timing_info(0);
Expand Down Expand Up @@ -1049,6 +1065,21 @@ void vpr_init_graphics(const t_vpr_setup& vpr_setup, const t_arch& arch, bool is
alloc_draw_structs(&arch);
}

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();
if (!gate_io.is_running()) {
gate_io.start(vpr_setup.ServerOpts.port_num);
g_timeout_add(/*interval_ms*/ 100, server::update, &application);
}
}
#else
(void)(vpr_setup);
#endif /* NO_SERVER */
}

void vpr_close_graphics(const t_vpr_setup& /*vpr_setup*/) {
/* Close down X Display */
free_draw_structs();
Expand Down Expand Up @@ -1256,6 +1287,7 @@ void vpr_setup_vpr(t_options* Options,
t_router_opts* RouterOpts,
t_analysis_opts* AnalysisOpts,
t_noc_opts* NocOpts,
t_server_opts* ServerOpts,
t_det_routing_arch* RoutingArch,
std::vector<t_lb_type_rr_node>** PackerRRGraph,
std::vector<t_segment_inf>& Segments,
Expand All @@ -1280,6 +1312,7 @@ void vpr_setup_vpr(t_options* Options,
RouterOpts,
AnalysisOpts,
NocOpts,
ServerOpts,
RoutingArch,
PackerRRGraph,
Segments,
Expand All @@ -1300,11 +1333,12 @@ void vpr_check_arch(const t_arch& Arch) {
void vpr_check_setup(const t_packer_opts& PackerOpts,
const t_placer_opts& PlacerOpts,
const t_router_opts& RouterOpts,
const t_server_opts& ServerOpts,
const t_det_routing_arch& RoutingArch,
const std::vector<t_segment_inf>& Segments,
const t_timing_inf& Timing,
const t_chan_width_dist& Chans) {
CheckSetup(PackerOpts, PlacerOpts, RouterOpts, RoutingArch,
CheckSetup(PackerOpts, PlacerOpts, RouterOpts, ServerOpts, RoutingArch,
Segments, Timing, Chans);
}

Expand Down
4 changes: 4 additions & 0 deletions vpr/src/base/vpr_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ void vpr_create_device_grid(const t_vpr_setup& vpr_setup, const t_arch& Arch);
void vpr_create_rr_graph(t_vpr_setup& vpr_setup, const t_arch& arch, int chan_width, bool is_flat);

void vpr_init_graphics(const t_vpr_setup& vpr_setup, const t_arch& arch, bool is_flat);
void vpr_init_server(const t_vpr_setup& vpr_setup);

void vpr_close_graphics(const t_vpr_setup& vpr_setup);

void vpr_setup_clock_networks(t_vpr_setup& vpr_setup, const t_arch& Arch);
Expand Down Expand Up @@ -177,6 +179,7 @@ void vpr_setup_vpr(t_options* Options,
t_router_opts* RouterOpts,
t_analysis_opts* AnalysisOpts,
t_noc_opts* NocOpts,
t_server_opts* ServerOpts,
t_det_routing_arch* RoutingArch,
std::vector<t_lb_type_rr_node>** PackerRRGraph,
std::vector<t_segment_inf>& Segments,
Expand All @@ -195,6 +198,7 @@ void vpr_check_arch(const t_arch& Arch);
void vpr_check_setup(const t_packer_opts& PackerOpts,
const t_placer_opts& PlacerOpts,
const t_router_opts& RouterOpts,
const t_server_opts& ServerOpts,
const t_det_routing_arch& RoutingArch,
const std::vector<t_segment_inf>& Segments,
const t_timing_inf& Timing,
Expand Down
Loading
Loading