Skip to content

Commit 5d5ccb9

Browse files
committed
Merge branch 'master' into ap_high_fanout_net_thresholding
2 parents 631616d + 6b099ad commit 5d5ccb9

File tree

4 files changed

+21
-65
lines changed

4 files changed

+21
-65
lines changed

doc/src/vtr/run_vtr_flow.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ Enable Synlig tool with the ``-DSYNLIG_SYSTEMVERILOG=ON`` compile flag for the P
9090
9191
Will run the VTR flow (default configuration) with Yosys frontend using Parmys plugin as partial mapper. To utilize the Parmys plugin, the ``-DYOSYS_PARMYS_PLUGIN=ON`` compile flag should be passed while building the VTR project with Yosys as a frontend.
9292

93+
.. code-block:: bash
94+
95+
# Using the Parmys (Partial Mapper for Yosys) plugin as partial mapper with include files
96+
./run_vtr_flow <path/to/Verilog/File> <path/to/arch/file> -include <path/to/include/directory>/*.v*
97+
98+
Will run the VTR flow (default configuration) with Yosys frontend using Parmys plugin as partial mapper. In addition to the main circuit passed in with the architecture, it will also pass in every HDL file with the specified file type within the include directory.
99+
93100
Detailed Command-line Options
94101
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95102

@@ -123,6 +130,15 @@ Detailed Command-line Options
123130
* ``vpr``
124131

125132
**Default:** ``vpr``
133+
134+
.. option:: -include <path_to_file(s)>/*.<file_type(s)>
135+
136+
List of include files to a benchmark circuit
137+
(pass to VTR frontends as a benchmark design set).
138+
139+
Include files can be any file supported by yosys+parmys (normally .v or .vh files).
140+
141+
The include directory should not contain the circuit passed in with the architecture.
126142

127143
.. option:: -power
128144

libs/libvtrutil/src/vtr_util.cpp

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -375,67 +375,6 @@ char* fgets(char* buf, int max_size, FILE* fp) {
375375
return nullptr;
376376
}
377377

378-
/**
379-
* @brief to get an arbitrary long input line and cut off any
380-
* comment part
381-
*
382-
* the getline function is exaly like the __get_delim function
383-
* in GNU with '\n' delimiter. As a result, to make the function
384-
* behaviour identical for Windows (\r\n) and Linux (\n) compiler
385-
* macros for checking operating systems have been used.
386-
*
387-
* @note user need to take care of the given pointer,
388-
* which will be dynamically allocated by getdelim
389-
*/
390-
char* getline(char*& _lineptr, FILE* _stream) {
391-
int i;
392-
int ch;
393-
size_t _n = 0;
394-
ssize_t nread;
395-
396-
#if defined(__unix__)
397-
nread = getdelim(&_lineptr, &_n, '\n', _stream);
398-
#elif defined(_WIN32)
399-
#define __WIN_NLTK "\r\n"
400-
nread = getdelim(&_lineptr, &_n, __WIN_NLTK, _stream);
401-
#endif
402-
403-
if (nread == -1) {
404-
int errsv = errno;
405-
std::string error_msg;
406-
407-
if (errsv == EINVAL)
408-
error_msg = string_fmt("[%s] Bad arguments (_lineptr is NULL, or _stream is not valid).", strerror(errsv));
409-
else if (errsv == ENOMEM)
410-
error_msg = string_fmt("[%s] Allocation or reallocation of the line buffer failed.", strerror(errsv));
411-
else
412-
/* end of file so it will return null */
413-
return nullptr;
414-
415-
/* getline was unsuccessful, so error */
416-
throw VtrError(string_fmt("Error -- %s\n",
417-
error_msg.c_str()),
418-
__FILE__, __LINE__);
419-
return nullptr;
420-
}
421-
422-
cont = 0; /* line continued? */
423-
file_line_number++; /* global variable */
424-
425-
for (i = 0; i < nread; i++) { /* Keep going until the line finishes */
426-
427-
ch = _lineptr[i];
428-
429-
if (ch == '#') { /* comment */
430-
_lineptr[i] = '\0';
431-
/* skip the rest of the line */
432-
break;
433-
}
434-
}
435-
436-
return (_lineptr);
437-
}
438-
439378
///@brief Returns line number of last opened and read file
440379
int get_file_line_number_of_last_opened_file() {
441380
return file_line_number;

vpr/src/draw/draw_basic.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#ifndef NO_GRAPHICS
55

66
#include <cstdio>
7+
#include <numbers>
78
#include <cmath>
89
#include <algorithm>
910
#include <sstream>
@@ -1236,7 +1237,7 @@ void draw_flyline_timing_edge(ezgl::point2d start, ezgl::point2d end, float incr
12361237
std::string incr_delay_str = ss.str();
12371238

12381239
// Get the angle of line, to rotate the text
1239-
float text_angle = (180 / M_PI)
1240+
float text_angle = (180 / std::numbers::pi)
12401241
* atan((end.y - start.y) / (end.x - start.x));
12411242

12421243
// Get the screen coordinates for text drawing
@@ -1251,9 +1252,9 @@ void draw_flyline_timing_edge(ezgl::point2d start, ezgl::point2d end, float incr
12511252

12521253
// Find an offset so it is sitting on top/below of the line
12531254
float x_offset = screen_coords.center().x
1254-
- 8 * sin(text_angle * (M_PI / 180));
1255+
- 8 * sin(text_angle * (std::numbers::pi / 180));
12551256
float y_offset = screen_coords.center().y
1256-
- 8 * cos(text_angle * (M_PI / 180));
1257+
- 8 * cos(text_angle * (std::numbers::pi / 180));
12571258

12581259
ezgl::point2d offset_text_bbox(x_offset, y_offset);
12591260
g->draw_text(offset_text_bbox, incr_delay_str.c_str(),

vtr_flow/scripts/python_libs/vtr/parmys/parmys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def run(
151151
Circuit file to optimize
152152
153153
include_files :
154-
list of header files
154+
List of include files to a benchmark circuit. Passed in by run_vtr_flow with -include
155155
156156
output_netlist :
157157
File name to output the resulting circuit to

0 commit comments

Comments
 (0)