Skip to content

Commit fbce960

Browse files
authored
Merge pull request #1287 from verilog-to-routing/place_debug
Adding placer debug user interface
2 parents 36dae56 + 35f8a4e commit fbce960

31 files changed

+2291
-79
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,11 @@ This is the development trunk for the Verilog-to-Routing project.
7575
Unlike the nicely packaged releases that we create, you are working with code in a constant state of flux.
7676
You should expect that the tools are not always stable and that more work is needed to get the flow to run.
7777

78-
For new developers, please [do the tutorial](dev/tutorial/NewDeveloperTutorial.txt).
79-
You will be directed back here once you ramp up.
78+
For new developers, please follow the [quickstart guide](https://docs.verilogtorouting.org/en/latest/quickstart/).
8079

81-
VTR development follows a classic centralized repository (svn-like) workflow.
82-
The 'master' branch is supposed to be the most current stable version of the project.
83-
Developers checkout a local copy of the code at the start of development, then do regular updates (e.g. `git pull --rebase`) to keep in sync with the GitHub master.
84-
When a developer has a tested, working change to put back into the trunk, he/she performs a `git push` operation.
85-
Unstable code should remain in the developer's local copy.
80+
We follow a feature branch flow, where you create a new branch for new code, test it, measure its Quality of Results, and eventually produce a pull request for review by other developers. Pull requests that meet all the quality and review criteria are then merged into the master branch by a developer with the authority to do so.
8681

87-
We do automated testing of the trunk using BuildBot to verify functionality and Quality of Results (QoR).
82+
In addition to measuring QoR and functionality automatically on pull requests, we do periodic automated testing of the master using BuildBot, and the results can be viewed below to track QoR and stability.
8883
* [Trunk Status](http://builds.verilogtorouting.org:8080/waterfall)
8984
* [QoR Tracking](http://builds.verilogtorouting.org:8080/)
9085

doc/src/vpr/debug_aids.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ To access detailed echo files from VPR’s operation, use the command-line optio
1111
After parsing the netlist and architecture files, VPR dumps out an image of its internal data structures into echo files (typically ending in ``.echo``).
1212
These files can be examined to be sure that VPR is parsing the input files as you expect.
1313

14+
You ca visualize and control the placement move generator whenever the placement engine is paused in the UI. Run with graphics and VTR_ENABLE_DEBUG_LOGGONG enabled and set a breakpoint to stop placement. The new location of the moving block for each proposed move will be highlighted with GREEN and the old location will be highlighted with GOLD. The fanin and fanout blocks will also be highlighted. The move type, move outcome and delta cost will be printed in the status bar.
15+
.. warning:: VPR must have been compiled with `VTR_ENABLE_DEBUG_LOGGING` on to get any debug output from this flag.
16+
1417
If the preprocessor flag ``DEBUG`` is defined in ``vpr_types.h``, some additional sanity checks are performed during a run.
1518
``DEBUG`` only slows execution by 1 to 2%.
1619
The major sanity checks are always enabled, regardless of the state of ``DEBUG``.

libs/libvtrutil/src/vtr_expr_eval.cpp

Lines changed: 226 additions & 53 deletions
Large diffs are not rendered by default.

libs/libvtrutil/src/vtr_expr_eval.h

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
#include <vector>
66
#include <stack>
77
#include <cstring>
8+
#include <iostream>
89

910
#include "vtr_util.h"
1011
#include "vtr_error.h"
1112
#include "vtr_string_view.h"
1213
#include "vtr_flat_map.h"
14+
#include "../../../vpr/src/draw/breakpoint_state_globals.h"
15+
16+
/**The expression evaluator is capable of performing many operations on given variables, after parsing the expression. The parser goes character by character and identifies the type of char or chars. (e.g bracket, comma, number, operator, variable). The supported operations include addition, subtraction, multiplication, division, finding max, min, gcd, lcm, as well as boolean operators such as &&, ||, ==, >=, <= etc. The result is returned as an int value and operation precedance is taken into account. (e.g given 3-2*4, the result will be -5). This class is also used to parse expressions indicating breakpoints. The breakpoint expressions consist of variable names such as move_num, temp_num, from_block etc, and boolean operators (e.g move_num == 3). Multiple breakpoints can be expressed in one expression**/
17+
18+
//function declarations
19+
//returns the global variable that holds all values that can trigger a breakpoint and are updated by the router and placer
20+
BreakpointStateGlobals* get_bp_state_globals();
1321

1422
namespace vtr {
1523

@@ -50,6 +58,7 @@ typedef enum e_formula_obj {
5058
E_FML_BRACKET,
5159
E_FML_COMMA,
5260
E_FML_OPERATOR,
61+
E_FML_VARIABLE,
5362
E_FML_NUM_FORMULA_OBJS
5463
} t_formula_obj;
5564

@@ -60,16 +69,34 @@ typedef enum e_operator {
6069
E_OP_SUB,
6170
E_OP_MULT,
6271
E_OP_DIV,
63-
E_OP_MOD,
64-
E_OP_GT,
65-
E_OP_LT,
6672
E_OP_MIN,
6773
E_OP_MAX,
6874
E_OP_GCD,
6975
E_OP_LCM,
76+
E_OP_AND,
77+
E_OP_OR,
78+
E_OP_GT,
79+
E_OP_LT,
80+
E_OP_GTE,
81+
E_OP_LTE,
82+
E_OP_EQ,
83+
E_OP_MOD,
84+
E_OP_AA,
7085
E_OP_NUM_OPS
7186
} t_operator;
7287

88+
/* Used to identify operators with more than one character */
89+
typedef enum e_compound_operator {
90+
E_COM_OP_UNDEFINED = 0,
91+
E_COM_OP_AND,
92+
E_COM_OP_OR,
93+
E_COM_OP_EQ,
94+
E_COM_OP_AA,
95+
E_COM_OP_GTE,
96+
E_COM_OP_LTE
97+
98+
} t_compound_operator;
99+
73100
/**** Class Definitions ****/
74101
/* This class is used to represent an object in a formula, such as
75102
* a number, a bracket, an operator, or a variable */
@@ -83,6 +110,7 @@ class Formula_Object {
83110
int num; /*for number objects*/
84111
t_operator op; /*for operator objects*/
85112
bool left_bracket; /*for bracket objects -- specifies if this is a left bracket*/
113+
//std::string variable;
86114

87115
u_Data() { memset(this, 0, sizeof(u_Data)); }
88116
} data;
@@ -92,7 +120,7 @@ class Formula_Object {
92120
}
93121

94122
std::string to_string() const {
95-
if (type == E_FML_NUMBER) {
123+
if (type == E_FML_NUMBER || type == E_FML_VARIABLE) {
96124
return std::to_string(data.num);
97125
} else if (type == E_FML_BRACKET) {
98126
if (data.left_bracket) {
@@ -113,10 +141,20 @@ class Formula_Object {
113141
return "/";
114142
} else if (data.op == E_OP_MOD) {
115143
return "%";
144+
} else if (data.op == E_OP_AND) {
145+
return "&&";
146+
} else if (data.op == E_OP_OR) {
147+
return "||";
116148
} else if (data.op == E_OP_GT) {
117149
return ">";
118150
} else if (data.op == E_OP_LT) {
119151
return "<";
152+
} else if (data.op == E_OP_GTE) {
153+
return ">=";
154+
} else if (data.op == E_OP_LTE) {
155+
return "<=";
156+
} else if (data.op == E_OP_EQ) {
157+
return "==";
120158
} else if (data.op == E_OP_MIN) {
121159
return "min";
122160
} else if (data.op == E_OP_MAX) {
@@ -125,6 +163,8 @@ class Formula_Object {
125163
return "gcd";
126164
} else if (data.op == E_OP_LCM) {
127165
return "lcm";
166+
} else if (data.op == E_OP_AA) {
167+
return "+=";
128168
} else {
129169
return "???"; //Unkown
130170
}
@@ -141,7 +181,7 @@ class FormulaParser {
141181
FormulaParser& operator=(const FormulaParser&) = delete;
142182

143183
/* returns integer result according to specified formula and data */
144-
int parse_formula(std::string formula, const t_formula_data& mydata);
184+
int parse_formula(std::string formula, const t_formula_data& mydata, bool is_breakpoint = false);
145185

146186
/* returns integer result according to specified piece-wise formula and data */
147187
int parse_piecewise_formula(const char* formula, const t_formula_data& mydata);
@@ -154,5 +194,6 @@ class FormulaParser {
154194
std::stack<Formula_Object> op_stack_; /* stack for handling operators and brackets in formula */
155195
};
156196

157-
} //namespace vtr
197+
} // namespace vtr
198+
158199
#endif

vpr/main.ui

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,31 +126,31 @@
126126
<property name="visible">True</property>
127127
<property name="can_focus">False</property>
128128
<child>
129-
<object class="GtkButton" id="ProceedButton">
130-
<property name="label" translatable="yes">Proceed</property>
129+
<object class="GtkButton" id="SaveGraphics">
130+
<property name="label" translatable="yes">Save</property>
131131
<property name="visible">True</property>
132132
<property name="can_focus">True</property>
133133
<property name="receives_default">True</property>
134134
<property name="image_position">right</property>
135135
</object>
136136
<packing>
137137
<property name="left_attach">0</property>
138-
<property name="top_attach">2</property>
138+
<property name="top_attach">0</property>
139139
<property name="width">1</property>
140140
<property name="height">1</property>
141141
</packing>
142142
</child>
143143
<child>
144-
<object class="GtkButton" id="SaveGraphics">
145-
<property name="label" translatable="yes">Save</property>
144+
<object class="GtkButton" id="ProceedButton">
145+
<property name="label" translatable="yes">Proceed</property>
146146
<property name="visible">True</property>
147147
<property name="can_focus">True</property>
148148
<property name="receives_default">True</property>
149149
<property name="image_position">right</property>
150150
</object>
151151
<packing>
152152
<property name="left_attach">0</property>
153-
<property name="top_attach">0</property>
153+
<property name="top_attach">3</property>
154154
<property name="width">1</property>
155155
<property name="height">1</property>
156156
</packing>
@@ -163,6 +163,20 @@
163163
<property name="receives_default">True</property>
164164
<property name="image_position">right</property>
165165
</object>
166+
<packing>
167+
<property name="left_attach">0</property>
168+
<property name="top_attach">2</property>
169+
<property name="width">1</property>
170+
<property name="height">1</property>
171+
</packing>
172+
</child>
173+
<child>
174+
<object class="GtkButton" id="debugButton">
175+
<property name="label" translatable="yes">Debug</property>
176+
<property name="visible">True</property>
177+
<property name="can_focus">True</property>
178+
<property name="receives_default">True</property>
179+
</object>
166180
<packing>
167181
<property name="left_attach">0</property>
168182
<property name="top_attach">1</property>

vpr/packing_pin_util.rpt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#Packing pin usage report
2+
Type: io
3+
Input Pin Usage:
4+
Max: 1.00 (0.50)
5+
Avg: 0.34 (0.17)
6+
Min: 0.00 (0.00)
7+
Histogram:
8+
[ 0: 0.2) 41 ( 66.1%) |************************************************
9+
[ 0.2: 0.4) 0 ( 0.0%) |
10+
[ 0.4: 0.6) 0 ( 0.0%) |
11+
[ 0.6: 0.8) 0 ( 0.0%) |
12+
[ 0.8: 1) 21 ( 33.9%) |*************************
13+
[ 1: 1.2) 0 ( 0.0%) |
14+
[ 1.2: 1.4) 0 ( 0.0%) |
15+
[ 1.4: 1.6) 0 ( 0.0%) |
16+
[ 1.6: 1.8) 0 ( 0.0%) |
17+
[ 1.8: 2) 0 ( 0.0%) |
18+
Output Pin Usage:
19+
Max: 1.00 (1.00)
20+
Avg: 0.66 (0.66)
21+
Min: 0.00 (0.00)
22+
Histogram:
23+
[ 0: 0.1) 21 ( 33.9%) |*************************
24+
[ 0.1: 0.2) 0 ( 0.0%) |
25+
[ 0.2: 0.3) 0 ( 0.0%) |
26+
[ 0.3: 0.4) 0 ( 0.0%) |
27+
[ 0.4: 0.5) 0 ( 0.0%) |
28+
[ 0.5: 0.6) 0 ( 0.0%) |
29+
[ 0.6: 0.7) 0 ( 0.0%) |
30+
[ 0.7: 0.8) 0 ( 0.0%) |
31+
[ 0.8: 0.9) 0 ( 0.0%) |
32+
[ 0.9: 1) 41 ( 66.1%) |************************************************
33+
34+
Type: clb
35+
Input Pin Usage:
36+
Max: 17.00 (0.40)
37+
Avg: 11.60 (0.28)
38+
Min: 4.00 (0.10)
39+
Histogram:
40+
[ 0: 4.2) 1 ( 20.0%) |*************************
41+
[ 4.2: 8.4) 1 ( 20.0%) |*************************
42+
[ 8.4: 13) 0 ( 0.0%) |
43+
[ 13: 17) 1 ( 20.0%) |*************************
44+
[ 17: 21) 2 ( 40.0%) |*************************************************
45+
[ 21: 25) 0 ( 0.0%) |
46+
[ 25: 29) 0 ( 0.0%) |
47+
[ 29: 34) 0 ( 0.0%) |
48+
[ 34: 38) 0 ( 0.0%) |
49+
[ 38: 42) 0 ( 0.0%) |
50+
Output Pin Usage:
51+
Max: 9.00 (0.43)
52+
Avg: 4.60 (0.22)
53+
Min: 2.00 (0.10)
54+
Histogram:
55+
[ 0: 2.1) 3 ( 60.0%) |*************************************************
56+
[ 2.1: 4.2) 0 ( 0.0%) |
57+
[ 4.2: 6.3) 0 ( 0.0%) |
58+
[ 6.3: 8.4) 1 ( 20.0%) |****************
59+
[ 8.4: 10) 1 ( 20.0%) |****************
60+
[ 10: 13) 0 ( 0.0%) |
61+
[ 13: 15) 0 ( 0.0%) |
62+
[ 15: 17) 0 ( 0.0%) |
63+
[ 17: 19) 0 ( 0.0%) |
64+
[ 19: 21) 0 ( 0.0%) |
65+

0 commit comments

Comments
 (0)