Skip to content
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

Ql accu #3

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a3b329c
add server mode to be controller outside
w0lek Nov 15, 2023
716b058
cleanup Server class, make recv() operation interuptable
w0lek Nov 15, 2023
2d64d08
Server maintain connection to specific client
w0lek Nov 15, 2023
d64db1c
implement TelegramBuffer which acts like a stream, with ability to ex…
w0lek Nov 17, 2023
22bbf9c
add telegramoptions helper class and it's usage to telegramsolver
w0lek Nov 22, 2023
c0fa676
add gtkcomboboxhelper functions, some opetions were changed from int-…
w0lek Nov 29, 2023
afa5bc1
fix regression of reseting crit path index selection on new path list…
w0lek Dec 1, 2023
4decf9b
cleanup taskresolver code from unused sections
w0lek Dec 1, 2023
13c729d
update telegramparser in order to parse int wrapped as string for job…
w0lek Dec 1, 2023
3dbbf1e
get_item_index_by_text uses case-insensitive variant of string compar…
w0lek Dec 1, 2023
9923900
undo changes made tatum/TimingReporter.cpp related to assertion check
w0lek Dec 3, 2023
db7c795
pass port number via cmdline arguments, allow to run servers which li…
w0lek Dec 4, 2023
0d487b3
replace #pragma once with #ifdef, rename keys.h to serverconsts.h
w0lek Dec 5, 2023
a1cc91b
cleanup
w0lek Dec 5, 2023
2e6d780
add ServerContext as a member in vpr_context
w0lek Dec 5, 2023
630a1df
fix compilation warnings, remove commented obsolete code
w0lek Dec 5, 2023
8c1e4dc
improve crit_index set change
w0lek Dec 5, 2023
ae0dc2d
refactor top level logic of crit path calculation
w0lek Dec 5, 2023
2e6d0e7
avoid printing timeout event in Server::startListening
w0lek Dec 6, 2023
3a01f54
redraw_callback timer period is descreased from 200ms to 100ms to be …
w0lek Dec 6, 2023
b45b7ae
changes: fix path calculation + report generation for Ineractive Path…
w0lek Dec 22, 2023
b4a2c93
add comments for Interactie Path Analysis tool, code structure refact…
w0lek Jan 4, 2024
ce2edb5
reset selected crit path to render if requested to render critical pa…
w0lek Jan 11, 2024
6c2ac9d
sync changes from 474-ipa-enhancement-selectionrendering-multiple-pat…
w0lek Jan 31, 2024
156060b
update changes for libtatum/tatum/TimingReporter
w0lek Jan 31, 2024
3ecbac2
incorporate sockpp integration with fixed header telegram protocol, d…
w0lek Feb 15, 2024
afc7661
fix compilation error
w0lek Feb 15, 2024
daa4d09
rename DISABLE_ZLIB_TELEGRAM_DATA_FIELD_COMPRESSION to FORCE_DISABLE_…
w0lek Feb 15, 2024
c3c56c9
backport changes from hotfixes
w0lek Feb 15, 2024
4479c5e
return commented test_server_* test cases, add few new telegramparser…
w0lek Feb 28, 2024
687d917
sync with aurora
w0lek Feb 28, 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
33 changes: 27 additions & 6 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, bool usePathElementSeparator) const {
paths = path_collector_.collect_worst_setup_timing_paths(timing_graph_, setup_analyzer, npaths);

report_timing(os, paths, usePathElementSeparator);
}

void TimingReporter::report_timing_hold(std::string filename,
const HoldTimingAnalyzer& hold_analyzer,
size_t npaths) const {
Expand All @@ -114,6 +123,16 @@ 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,
bool usePathElementSeparator) const {
paths = path_collector_.collect_worst_hold_timing_paths(timing_graph_, hold_analyzer, npaths);

report_timing(os, paths, usePathElementSeparator);
}

void TimingReporter::report_skew_setup(std::string filename,
const SetupTimingAnalyzer& setup_analyzer,
size_t nworst) const {
Expand Down Expand Up @@ -195,7 +214,7 @@ void TimingReporter::report_unconstrained_hold(std::ostream& os,
*/

void TimingReporter::report_timing(std::ostream& os,
const std::vector<TimingPath>& paths) const {
const std::vector<TimingPath>& paths, bool usePathElementSeparator) const {
tatum::OsFormatGuard flag_guard(os);

os << "#Timing report of worst " << paths.size() << " path(s)\n";
Expand All @@ -206,14 +225,14 @@ void TimingReporter::report_timing(std::ostream& os,
size_t i = 0;
for(const auto& path : paths) {
os << "#Path " << ++i << "\n";
report_timing_path(os, path);
report_timing_path(os, path, usePathElementSeparator);
os << "\n";
}

os << "#End of timing report\n";
}

void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path) const {
void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path, bool usePathElementSeparator) const {
std::string divider = "--------------------------------------------------------------------------------";

TimingPathInfo path_info = timing_path.path_info();
Expand Down Expand Up @@ -252,7 +271,7 @@ void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timi

arr_path = report_timing_clock_launch_subpath(os, path_helper, timing_path.clock_launch_path(), path_info.launch_domain(), path_info.type());

arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path);
arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path, usePathElementSeparator);

{
//Final arrival time
Expand Down Expand Up @@ -584,7 +603,8 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os,
const TimingSubPath& subpath,
DomainId domain,
TimingType timing_type,
Time path) const {
Time path,
bool usePathElementSeparator) const {

{
//Input constraint
Expand Down Expand Up @@ -615,7 +635,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os,

//Launch data
for(const TimingPathElem& path_elem : subpath.elements()) {

if (usePathElementSeparator) os << "el{\n";
//Ask the application for a detailed breakdown of the edge delays
auto delay_breakdown = name_resolver_.edge_delay_breakdown(path_elem.incomming_edge(), delay_type);
if (!delay_breakdown.components.empty()) {
Expand Down Expand Up @@ -644,6 +664,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os,
path = path_elem.tag().time();

path_helper.update_print_path(os, point, path);
if (usePathElementSeparator) os << "el}\n";
}
return path;
}
Expand Down
9 changes: 6 additions & 3 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, bool usePathElementSeparator=false) 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, bool usePathElementSeparator=false) 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 Expand Up @@ -94,9 +96,9 @@ class TimingReporter {
};

private:
void report_timing(std::ostream& os, const std::vector<TimingPath>& paths) const;
void report_timing(std::ostream& os, const std::vector<TimingPath>& paths, bool usePathElementSeparator = false) const;

void report_timing_path(std::ostream& os, const TimingPath& path) const;
void report_timing_path(std::ostream& os, const TimingPath& path, bool usePathElementSeparator = false) const;

void report_unconstrained(std::ostream& os, const NodeType type, const detail::TagRetriever& tag_retriever) const;

Expand All @@ -123,7 +125,8 @@ class TimingReporter {
const TimingSubPath& subpath,
DomainId domain,
TimingType timing_type,
Time path) const;
Time path,
bool usePathElementSeparator = false) const;

Time report_timing_data_required_element(std::ostream& os,
detail::ReportTimingPathHelper& path_helper,
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/read_xml_arch_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void XmlReadArch(const char* ArchFile,
pugi::xml_node Next;
ReqOpt POWER_REQD, SWITCHBLOCKLIST_REQD;

if ((vtr::check_file_name_extension(ArchFile, ".xml") == false) && (vtr::check_file_name_extension(ArchFile, ".xml") == false)) {
if ((vtr::check_file_name_extension(ArchFile, ".xml") == false) && (vtr::check_file_name_extension(ArchFile, ".xmle") == false)) {
VTR_LOG_WARN(
"Architecture file '%s' may be in incorrect format. "
"Expecting .xml or .xmle format for architecture files.\n",
Expand Down
9 changes: 6 additions & 3 deletions libs/libpugiutil/src/pugixml_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ namespace pugiutil {
loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents
const std::string filename) { //Filename to load from
//store the position of last '.' in the file name
int position = filename.find_last_of(".");
//store the characters after the '.' from the file_name string
std::string result = filename.substr(position);
size_t position = filename.find_last_of(".");
std::string result = "";
if(position != std::string::npos) {
//store the characters after the '.' from the file_name string
result = filename.substr(position);
}
if (result == ".xmle") {
Decryption E1(filename);
std::string fn_file = E1.getDecryptedContent();
Expand Down
10 changes: 9 additions & 1 deletion vpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ set(VPR_PGO_DATA_DIR "." CACHE PATH "Where to store and retrieve PGO data")
#Handle graphics setup
set(GRAPHICS_DEFINES "")

#sockpp
set(SOCKPP_BUILD_SHARED OFF CACHE BOOL "Override default value" FORCE)
set(SOCKPP_BUILD_STATIC ON CACHE BOOL "Override default value" FORCE)
add_subdirectory(thirdparty/sockpp)
set(THIRDPARTY_INCLUDE_DIRS thirdparty/sockpp/include)

if (VPR_USE_EZGL STREQUAL "on")
message(STATUS "EZGL: graphics enabled")
set(
Expand Down Expand Up @@ -54,7 +60,7 @@ add_library(libvpr STATIC
)


target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS})
target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS} ${THIRDPARTY_INCLUDE_DIRS})

#VPR_ANALYTIC_PLACE is inisitalized in the root CMakeLists
#Check Eigen dependency
Expand Down Expand Up @@ -84,6 +90,8 @@ target_link_libraries(libvpr
libargparse
libpugixml
librrgraph
sockpp-static
-lz
)

#link graphics library only when graphics set to on
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 @@ -750,6 +754,11 @@ static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
return;
}

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
13 changes: 13 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,16 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.action(argparse::Action::STORE_TRUE)
.default_value("off");

stage_grp.add_argument<bool, ParseOnOff>(args.is_server_mode_enabled, "--server")
.help("Run in server mode")
.action(argparse::Action::STORE_TRUE)
.default_value("off");

stage_grp.add_argument<int>(args.server_port_num, "--port")
.help("Server port number")
.default_value("60555")
.show_in(argparse::ShowIn::HELP_ONLY);

stage_grp.epilog(
"If none of the stage options are specified, all stages are run.\n"
"Analysis is always run after routing, unless the implementation\n"
Expand Down Expand Up @@ -1377,6 +1387,9 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.help("Show version information then exit")
.action(argparse::Action::VERSION);

gen_grp.add_argument<bool, ParseOnOff>(args.show_resource_usage_only_mode, "--show_resource_usage")
.help("Show resource usage then exit");

gen_grp.add_argument<std::string>(args.device_layout, "--device")
.help(
"Controls which device layout/floorplan is used from the architecture file."
Expand Down
5 changes: 5 additions & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct t_options {
/* General options */
argparse::ArgValue<bool> show_help;
argparse::ArgValue<bool> show_version;
argparse::ArgValue<bool> show_resource_usage_only_mode;
argparse::ArgValue<size_t> num_workers;
argparse::ArgValue<bool> timing_analysis;
argparse::ArgValue<e_timing_update_type> timing_update_type;
Expand All @@ -74,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
52 changes: 51 additions & 1 deletion vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,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 Down Expand Up @@ -365,6 +366,52 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a
device_ctx.pad_loc_type = vpr_setup->PlacerOpts.pad_loc_type;
}

void vpr_show_resource_usage(const t_vpr_setup& vpr_setup, const t_arch& Arch)
{
vtr::ScopedStartFinishTimer timer("Build Device Grid");
/* Read in netlist file for placement and routing */
auto& device_ctx = g_vpr_ctx.mutable_device();

device_ctx.arch = &Arch;

/*
*Load the device grid
*/

//Record the resource requirement
std::map<t_logical_block_type_ptr, size_t> num_type_instances;

//Build the device
for (const auto& l: Arch.grid_layouts) {
std::string device_layout_variant = l.name;

float target_device_utilization = vpr_setup.PackerOpts.target_device_utilization;
device_ctx.grid = create_device_grid(device_layout_variant, Arch.grid_layouts, num_type_instances, target_device_utilization);

/*
*Report on the device
*/
size_t num_grid_tiles = count_grid_tiles(device_ctx.grid);
VTR_LOG("FPGA sized to %zu x %zu: %zu grid tiles (%s)\n", device_ctx.grid.width(), device_ctx.grid.height(), num_grid_tiles, device_ctx.grid.name().c_str());

std::string title("\nResource usage for device layout " + device_layout_variant + "...\n");
VTR_LOG(title.c_str());
for (const auto& type : device_ctx.logical_block_types) {
if (is_empty_type(&type)) continue;

VTR_LOG("\tArchitecture\n");
for (const auto equivalent_tile : type.equivalent_tiles) {
auto num_instances = 0;
//get the number of equivalent tile across all layers
num_instances = (int)device_ctx.grid.num_instances(equivalent_tile, -1);

VTR_LOG("\t\t%d\tblocks of type: %s\n",
num_instances, equivalent_tile->name);
}
}
}
}

bool vpr_flow(t_vpr_setup& vpr_setup, t_arch& arch) {
if (vpr_setup.exit_before_pack) {
VTR_LOG_WARN("Exiting before packing as requested.\n");
Expand Down Expand Up @@ -806,6 +853,7 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,

//Initialize the delay calculator
std::shared_ptr<SetupHoldTimingInfo> timing_info = nullptr;

std::shared_ptr<RoutingDelayCalculator> routing_delay_calc = nullptr;
if (vpr_setup.Timing.timing_analysis_enabled) {
auto& atom_ctx = g_vpr_ctx.atom();
Expand Down Expand Up @@ -1051,7 +1099,7 @@ void vpr_init_graphics(const t_vpr_setup& vpr_setup, const t_arch& arch, bool is
/* Startup X graphics */
init_graphics_state(vpr_setup.ShowGraphics, vpr_setup.GraphPause,
vpr_setup.RouterOpts.route_type, vpr_setup.SaveGraphics,
vpr_setup.GraphicsCommands, is_flat);
vpr_setup.GraphicsCommands, is_flat, vpr_setup.ServerOpts.is_server_mode_enabled, vpr_setup.ServerOpts.port_num);
if (vpr_setup.ShowGraphics || vpr_setup.SaveGraphics || !vpr_setup.GraphicsCommands.empty())
alloc_draw_structs(&arch);
}
Expand Down Expand Up @@ -1266,6 +1314,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 @@ -1290,6 +1339,7 @@ void vpr_setup_vpr(t_options* Options,
RouterOpts,
AnalysisOpts,
NocOpts,
ServerOpts,
RoutingArch,
PackerRRGraph,
Segments,
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 @@ -132,6 +132,9 @@ void vpr_analysis(const Netlist<>& net_list,
///@brief Create the device (grid + rr graph)
void vpr_create_device(t_vpr_setup& vpr_setup, const t_arch& Arch, bool is_flat);

/// @brief Show resource usage
void vpr_show_resource_usage(const t_vpr_setup& vpr_setup, const t_arch& Arch);

///@brief Create the device grid
void vpr_create_device_grid(const t_vpr_setup& vpr_setup, const t_arch& Arch);

Expand Down Expand Up @@ -177,6 +180,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 Down
Loading
Loading