Skip to content

Commit 4b4d3e4

Browse files
committed
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into map_lookahead_bug_fix
2 parents bfc403a + f265293 commit 4b4d3e4

File tree

23 files changed

+48451
-410
lines changed

23 files changed

+48451
-410
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

ODIN_II/SRC/include/odin_error.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,29 @@ extern std::vector<std::pair<std::string, int>> include_file_names;
3939
extern int delayed_errors;
4040
extern const loc_t unknown_location;
4141

42-
#ifdef ODIN_USE_YOSYS
42+
#define SYSTEMVERILOG_PARSER_ERROR \
43+
"The SystemVerilog parser is provided within Yosys. " \
44+
"Please use the Yosys elaborator to synthesize SystemVerilog files.\n"
45+
#define UHDM_PARSER_ERROR \
46+
"The UHDM parser is provided within Yosys. " \
47+
"Please use the Yosys elaborator to synthesize UHDM files.\n"
48+
49+
#ifndef ODIN_USE_YOSYS
50+
# define YOSYS_INSTALLATION_ERROR \
51+
"It seems Yosys is not installed in the VTR repository. " \
52+
"Please compile the VTR with (\" -DODIN_USE_YOSYS=ON \") flag.\n"
53+
#else
4354
# define YOSYS_ELABORATION_ERROR \
4455
"Yosys failed to perform elaboration, " \
4556
"Please look at the log file for the failure cause or pass \'--show_yosys_log\' to Odin-II to see the logs.\n"
4657
# define YOSYS_FORK_ERROR \
4758
"Yosys child process failed to be created\n"
48-
# define YOSYS_PLUGINS_WITH_ODIN_ERROR \
49-
"Utilizing SystemVerilog/UHDM plugins requires activating the Yosys frontend.\
50-
Please recompile the VTR project either with the \"WITH_YOSYS\" or \"ODIN_USE_YOSYS\" flag on."
51-
#else
52-
# define YOSYS_INSTALLATION_ERROR \
53-
"It seems Yosys is not installed in the VTR repository." \
54-
" Please compile the VTR with (\" -DODIN_USE_YOSYS=ON \") flag.\n"
5559
#endif
5660

5761
#ifndef YOSYS_SV_UHDM_PLUGIN
58-
# define YOSYS_PLUGINS_NOT_COMPILED \
59-
"SystemVerilog/UHDM plugins are not compiled.\
60-
Please recompile the VTR project with the \"YOSYS_SV_UHDM_PLUGIN\" flag on."
62+
# define YOSYS_PLUGINS_NOT_COMPILED \
63+
"SystemVerilog/UHDM plugins are not compiled. " \
64+
"Please recompile the VTR project with the \"YOSYS_SV_UHDM_PLUGIN\" flag on."
6165
#endif
6266

6367
// causes an interrupt in GDB

ODIN_II/SRC/include/odin_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ long shift_left_value_with_overflow_check(long input_value, long shift_by, loc_t
1212
std::string get_file_extension(std::string input_file);
1313
std::string get_directory(std::string input_file);
1414
void create_directory(std::string path);
15-
void assert_valid_file_extenstion(std::vector<std::string> name_list, file_type_e type);
15+
void report_frontend_elaborator();
1616
void assert_supported_file_extension(std::string input_file, loc_t loc);
1717
FILE* open_file(const char* file_name, const char* open_type);
1818
void get_current_path();

ODIN_II/SRC/odin_ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ netlist_t* start_odin_ii(int argc, char** argv) {
349349
ODIN_ERROR_CODE error_code;
350350

351351
print_input_files_info();
352-
assert_valid_file_extenstion(configuration.list_of_file_names, configuration.input_file_type);
352+
report_frontend_elaborator();
353353

354354
if (configuration.input_file_type != file_type_e::_BLIF || configuration.coarsen) {
355355
try {

ODIN_II/SRC/odin_util.cpp

Lines changed: 45 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -92,80 +92,56 @@ void create_directory(std::string path) {
9292
}
9393

9494
/**
95-
* @brief assert all input files have valid type and extenstion
96-
*
97-
* @param name_list list of input files
98-
* @param type the type to be checked with
95+
* @brief report the frontend elaborator and its parser
9996
*/
100-
void assert_valid_file_extenstion(std::vector<std::string> name_list, file_type_e type) {
101-
for (auto file_name : name_list) {
102-
// lookup the file type string from file extension map
103-
auto file_ext_str = string_to_lower(get_file_extension(file_name));
104-
auto file_ext_it = file_extension_strmap.find(file_ext_str);
105-
106-
// Unsupported file types should be already check.
107-
// However, we double-check here
108-
if (file_ext_it == file_extension_strmap.end()) {
109-
assert_supported_file_extension(file_name, unknown_location);
110-
} else {
111-
file_type_e file_type = file_ext_it->second;
112-
// Check if the file_name extension matches with type
113-
switch (type) {
114-
case (file_type_e::_VERILOG): // fallthrough
115-
case (file_type_e::_VERILOG_HEADER): {
116-
if (file_type != file_type_e::_VERILOG && file_type != file_type_e::_VERILOG_HEADER)
117-
error_message(UTIL, unknown_location,
118-
"File (%s) has an invalid extension (%s), supposed to be a %s or %s file { %s, %s },\
119-
please see ./odin --help",
120-
file_name.c_str(),
121-
file_ext_str.c_str(),
122-
file_type_strmap.find(file_type_e::_VERILOG)->second.c_str(),
123-
file_type_strmap.find(file_type_e::_VERILOG_HEADER)->second.c_str(),
124-
file_extension_strmap.find(file_type_e::_VERILOG)->second.c_str(),
125-
file_extension_strmap.find(file_type_e::_VERILOG_HEADER)->second.c_str());
126-
break;
127-
}
128-
case (file_type_e::_SYSTEM_VERILOG): //fallthrough
129-
case (file_type_e::_UHDM): {
130-
if (configuration.elaborator_type != elaborator_e::_YOSYS) {
131-
#ifndef ODIN_USE_YOSYS
132-
error_message(PARSE_ARGS, unknown_location, "%s", YOSYS_INSTALLATION_ERROR);
97+
void report_frontend_elaborator() {
98+
// Check if the file_name extension matches with type
99+
switch (configuration.input_file_type) {
100+
case (file_type_e::_VERILOG): // fallthrough
101+
case (file_type_e::_VERILOG_HEADER): {
102+
if (configuration.elaborator_type == elaborator_e::_ODIN) {
103+
printf("Using the ODIN_II parser for elaboration\n");
104+
} else if (configuration.elaborator_type == elaborator_e::_YOSYS) {
105+
printf("Using the Yosys elaborator with it's conventional Verilog/SystemVerilog parser\n");
106+
}
107+
break;
108+
}
109+
case (file_type_e::_SYSTEM_VERILOG): {
110+
if (configuration.elaborator_type != elaborator_e::_YOSYS) {
111+
error_message(PARSE_ARGS, unknown_location, "%s", SYSTEMVERILOG_PARSER_ERROR);
112+
}
113+
#ifndef YOSYS_SV_UHDM_PLUGIN
114+
printf("Using the Yosys elaborator with it's conventional Verilog/SystemVerilog parser\n");
133115
#else
134-
error_message(UTIL, unknown_location, "%s", YOSYS_PLUGINS_WITH_ODIN_ERROR);
116+
printf("Using the Yosys elaborator with the Yosys-F4PGA-Plugin parser for SystemVerilog\n");
135117
#endif
136-
} else {
137-
#ifndef YOSYS_SV_UHDM_PLUGIN
138-
error_message(UTIL, unknown_location, "%s", YOSYS_PLUGINS_NOT_COMPILED);
118+
break;
119+
}
120+
case (file_type_e::_UHDM): {
121+
if (configuration.elaborator_type != elaborator_e::_YOSYS) {
122+
error_message(PARSE_ARGS, unknown_location, "%s", UHDM_PARSER_ERROR);
123+
124+
} else if (configuration.elaborator_type == elaborator_e::_YOSYS) {
125+
#ifndef ODIN_USE_YOSYS
126+
error_message(PARSE_ARGS, unknown_location, "%s", YOSYS_INSTALLATION_ERROR);
127+
#else
128+
# ifndef YOSYS_SV_UHDM_PLUGIN
129+
error_message(PARSE_ARGS, unknown_location, "%s", YOSYS_PLUGINS_NOT_COMPILED);
130+
# endif
139131
#endif
140-
}
141-
if (file_type != type && type != file_type_e::_UHDM)
142-
error_message(UTIL, unknown_location,
143-
"File (%s) has an invalid extension (%s), supposed to be a %s file { %s },\
144-
please see ./odin --help",
145-
file_name.c_str(),
146-
file_ext_str.c_str(),
147-
file_type_strmap.find(type)->second.c_str(),
148-
file_extension_strmap.find(type)->second.c_str());
149-
break;
150-
}
151-
case (file_type_e::_BLIF): {
152-
if (file_type != type)
153-
error_message(UTIL, unknown_location,
154-
"File (%s) has an invalid extension (%s), supposed to be a %s file { %s },\
155-
please see ./odin --help",
156-
file_name.c_str(),
157-
file_ext_str.c_str(),
158-
file_type_strmap.find(type)->second.c_str(),
159-
file_extension_strmap.find(type)->second.c_str());
160-
break;
161-
}
162-
case (file_type_e::_EBLIF): //fallthrough
163-
case (file_type_e::_ILANG): // fallthrough
164-
default: {
165-
assert_supported_file_extension(file_name, unknown_location);
166-
break;
167-
}
168132
}
133+
printf("Using the Yosys elaborator with the Surelog parser for UHDM\n");
134+
break;
135+
}
136+
case (file_type_e::_BLIF): {
137+
printf("Using the ODIN_II BLIF parser\n");
138+
break;
139+
}
140+
case (file_type_e::_EBLIF): //fallthrough
141+
case (file_type_e::_ILANG): //fallthrough
142+
default: {
143+
error_message(UTIL, unknown_location, "%s", "Invalid file type");
144+
break;
169145
}
170146
}
171147
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
.. _edit_vpr_ui:
22

3-
Editing VPR UI
3+
VPR UI and Graphics
44
--------------
55

66
VPR's UI is created with GTK, and actively maintained/edited through the use of Glade and a main.ui file. We prefer to not use code initializations of Gtk Buttons/UI objects, and instead make them with Glade.
7-
This allows for better organized menus and visual editing of the UI. Please consult the attached guide for Glade: <Link Glade/Gtk quickstart> (WIP as of August 8th, 2022).
7+
This allows for better organized menus and visual editing of the UI. Please consult the attached guide for Glade: <Link Glade/Gtk quickstart> (WIP as of August 24th, 2022).
88

9-
When connecting a button to its function, place it in an appropriate function depending on the drop down menu it will go in. Button setups are done in ui_setup.cpp/h and callback functions are in draw_toggle_functions.cpp/h.
9+
When connecting a button to its function, place it in an appropriate function depending on the drop down menu it will go in. Button setups are done in ui_setup.cpp/h and callback functions are in draw_toggle_functions.cpp/h.
10+
11+
VPR Graphics are drawn using the EZGL graphics library, which is a wrapper around the GTK graphics library (which is used for the UI). EZGL Documentation is found here: http://ug251.eecg.utoronto.ca/ece297s/ezgl_doc/index.html and GTK documentation is found here: https://docs.gtk.org/gtk3/
12+
13+
Make sure to test the UI when you edit it. Ensure that the graphics window opens (using the --disp on command) and click around the UI to ensure the buttons still work. Test all phases (Placement -> Routing) as the UI changes between them.

0 commit comments

Comments
 (0)