Skip to content

Commit f265293

Browse files
authored
Merge pull request #2057 from antmicro/mkurc/fix-generic-issues-up
Fix build errors with VERBOSE
2 parents 402e100 + 88ac8d4 commit f265293

File tree

7 files changed

+39
-7
lines changed

7 files changed

+39
-7
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ jobs:
6767
Build:
6868
name: 'B: Building VtR'
6969
runs-on: ubuntu-18.04
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
include:
74+
- { build_type: 'release', verbose: '0' }
75+
- { build_type: 'debug', verbose: '0' }
76+
- { build_type: 'debug', verbose: '1' }
7077
steps:
7178

7279
- uses: actions/setup-python@v2
@@ -79,10 +86,10 @@ jobs:
7986

8087
- name: Test
8188
env:
82-
BUILD_TYPE: release
89+
BUILD_TYPE: ${{ matrix.build_type }}
8390
run: |
8491
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
85-
./.github/scripts/build.sh
92+
./.github/scripts/build.sh VERBOSE=${{ matrix.verbose }}
8693
8794
8895
Format:

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ option(VTR_ENABLE_SANITIZE "Enable address/leak/undefined-behaviour sanitizers (
3131
option(VTR_ENABLE_PROFILING "Enable performance profiler (gprof)" OFF)
3232
option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
3333
option(VTR_ENABLE_DEBUG_LOGGING "Enable debug logging" OFF)
34+
option(VTR_ENABLE_VERBOSE "Enable increased debug verbosity" OFF)
3435

3536
#Allow the user to decide whether to compile the graphics library
3637
set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics library")
@@ -285,6 +286,14 @@ if(VTR_ENABLE_DEBUG_LOGGING)
285286
message(STATUS "Logging Flags: ${LOGGING_FLAGS}")
286287
endif()
287288

289+
#
290+
# Increased debugging vebosity
291+
#
292+
if(VTR_ENABLE_VERBOSE)
293+
set(EXTRA_FLAGS "${EXTRA_FLAGS} -DVTR_ENABLE_DEBUG_LOGGING")
294+
message(STATUS "Enabling increased debugging verbosity")
295+
endif()
296+
288297
if (CMAKE_MAKE_PROGRAM EQUAL "ninja" )
289298
#Only for coloured output for ninja, it may be desired
290299
#to not force colours with other make programs (e.g. if

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#
1111
# To perform a debug build use:
1212
# 'make BUILD_TYPE=debug'
13+
#
14+
# To enable debugging verbose messages as well use:
15+
#
16+
# 'make BUILD_TYPE=debug VERBOSE=1'
1317

1418
#Default build type
1519
# Possible values:
@@ -19,6 +23,9 @@
1923
# strict #Build VPR with warnings treated as errors
2024
BUILD_TYPE ?= release
2125

26+
#Debugging verbosity enable
27+
VERBOSE ?= 0
28+
2229
#Convert to lower case for consistency
2330
BUILD_TYPE := $(shell echo $(BUILD_TYPE) | tr '[:upper:]' '[:lower:]')
2431

@@ -36,6 +43,11 @@ ifneq (,$(findstring strict,$(BUILD_TYPE)))
3643
override CMAKE_PARAMS := -DVTR_ENABLE_STRICT_COMPILE=on ${CMAKE_PARAMS}
3744
endif #Strict build type
3845

46+
#Enable verbosity
47+
ifeq ($(VERBOSE),1)
48+
override CMAKE_PARAMS := -DVTR_ENABLE_VERBOSE=on ${CMAKE_PARAMS}
49+
endif
50+
3951
# -s : Suppresss makefile output (e.g. entering/leaving directories)
4052
# --output-sync target : For parallel compilation ensure output for each target is synchronized (make version >= 4.0)
4153
MAKEFLAGS := -s

vpr/src/base/read_circuit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ AtomNetlist read_and_process_circuit(e_circuit_format circuit_format, t_vpr_setu
3333
bool should_sweep_dangling_nets = vpr_setup.NetlistOpts.sweep_dangling_nets;
3434
bool should_sweep_dangling_blocks = vpr_setup.NetlistOpts.sweep_dangling_blocks;
3535
bool should_sweep_constant_primary_outputs = vpr_setup.NetlistOpts.sweep_constant_primary_outputs;
36-
bool verbosity = vpr_setup.NetlistOpts.netlist_verbosity;
36+
int verbosity = vpr_setup.NetlistOpts.netlist_verbosity;
3737

3838
if (circuit_format == e_circuit_format::AUTO) {
3939
auto name_ext = vtr::split_ext(circuit_file);

vpr/src/place/initial_placement.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#include <chrono>
1717
#include <time.h>
1818

19+
#ifdef VERBOSE
20+
void print_clb_placement(const char* fname);
21+
#endif
22+
1923
/**
2024
* @brief Used to assign each block a score for how difficult it is to place.
2125
* The higher numbers indicate a block is expected to be more difficult to place.

vpr/src/place/place.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ std::unique_ptr<FILE, decltype(&vtr::fclose)> f_move_stats_file(nullptr,
245245

246246
/********************* Static subroutines local to place.c *******************/
247247
#ifdef VERBOSE
248-
static void print_clb_placement(const char* fname);
248+
void print_clb_placement(const char* fname);
249249
#endif
250250

251251
static void alloc_and_load_placement_structs(float place_cost_exp,
@@ -2849,7 +2849,7 @@ int check_macro_placement_consistency() {
28492849
}
28502850

28512851
#ifdef VERBOSE
2852-
static void print_clb_placement(const char* fname) {
2852+
void print_clb_placement(const char* fname) {
28532853
/* Prints out the clb placements to a file. */
28542854
FILE* fp;
28552855
auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -2860,7 +2860,7 @@ static void print_clb_placement(const char* fname) {
28602860

28612861
fprintf(fp, "Block #\tName\t(X, Y, Z).\n");
28622862
for (auto i : cluster_ctx.clb_nlist.blocks()) {
2863-
fprintf(fp, "#%d\t%s\t(%d, %d, %d).\n", i, cluster_ctx.clb_nlist.block_name(i), place_ctx.block_locs[i].x, place_ctx.block_locs[i].y, place_ctx.block_locs[i].sub_tile);
2863+
fprintf(fp, "#%d\t%s\t(%d, %d, %d).\n", i, cluster_ctx.clb_nlist.block_name(i).c_str(), place_ctx.block_locs[i].loc.x, place_ctx.block_locs[i].loc.y, place_ctx.block_locs[i].loc.sub_tile);
28642864
}
28652865

28662866
fclose(fp);

vpr/src/place/timing_place_lookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static void generic_compute_matrix_dijkstra_expansion(
513513

514514
#ifdef VERBOSE
515515
VTR_LOG("Computed delay: %12g delta: %d,%d (src: %d,%d sink: %d,%d)\n",
516-
delay,
516+
delays[size_t(sink_rr_node)],
517517
delta_x, delta_y,
518518
source_x, source_y,
519519
sink_x, sink_y);

0 commit comments

Comments
 (0)