Skip to content

Commit a3b55ea

Browse files
authored
Merge branch 'master' into openfpga
2 parents e677079 + dc3e5dc commit a3b55ea

File tree

31 files changed

+266
-309
lines changed

31 files changed

+266
-309
lines changed

doc/src/vpr/command_line_usage.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,8 @@ The following options are used to enable server mode in VPR.
18791879

18801880
**Default:** ``60555``
18811881

1882+
.. seealso:: :ref:`interactive_path_analysis_client`
1883+
18821884
Command-line Auto Completion
18831885
----------------------------
18841886

doc/src/vtr/server_mode/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,19 @@ Draw selected critical path elements example
202202
203203
.. note:: If status is not 1, the field ***DATA*** contains error string.
204204

205+
`The interactive path analysis (IPA) client <https://github.com/w0lek/IPAClient>`_ is useful for viewing timing paths, and to test VPR's server mode functionality.
205206

207+
.. _interactive_path_analysis_client:
208+
209+
Interactive Path Analysis Client (IPA)
210+
====================================================
211+
212+
The interactive path analysis (IPA) client connects to VPR's server mode and allows interactive visualization of timing paths and their placement and routing. This client application is called **IPAClient** and can also be used to test VPR's server mode functionality. It is available in a public Git repository:
213+
`https://github.com/w0lek/IPAClient <https://github.com/w0lek/IPAClient>`_.
214+
215+
This UI application is designed to generate requests for VPR in server mode and display the responses in a readable format, acting as a result viewer.
216+
217+
More details on how to build and use **IPAClient** can be found in the `README <https://github.com/w0lek/IPAClient/blob/main/README.md>`_.
206218

207219

208220

libs/libvtrutil/src/vtr_ndoffsetmatrix.h

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ namespace vtr {
1010
/**
1111
* @brief A half-open range specification for a matrix dimension [begin_index, last_index)
1212
*
13-
* It comes with valid indicies from [begin_index() ... end_index()-1], provided size() > 0.
13+
* It comes with valid indices from [begin_index() ... end_index()-1], provided size() > 0.
1414
*/
1515
class DimRange {
1616
public:
1717
///@brief default constructor
1818
DimRange() = default;
1919

2020
///@brief a constructor with begin_index, end_index
21-
DimRange(size_t begin, size_t end)
21+
DimRange(int begin, int end)
2222
: begin_index_(begin)
2323
, end_index_(end) {}
2424

2525
///@brief Return the begin index
26-
size_t begin_index() const { return begin_index_; }
26+
int begin_index() const { return begin_index_; }
2727

2828
///@brief Return the end index
29-
size_t end_index() const { return end_index_; }
29+
int end_index() const { return end_index_; }
3030

3131
///@brief Return the size
3232
size_t size() const { return end_index_ - begin_index_; }
3333

3434
private:
35-
size_t begin_index_ = 0;
36-
size_t end_index_ = 0;
35+
int begin_index_ = 0;
36+
int end_index_ = 0;
3737
};
3838

3939
/**
@@ -69,7 +69,7 @@ class NdOffsetMatrixProxy {
6969
, start_(start) {}
7070

7171
///@brief const [] operator
72-
const NdOffsetMatrixProxy<T, N - 1> operator[](size_t index) const {
72+
const NdOffsetMatrixProxy<T, N - 1> operator[](int index) const {
7373
VTR_ASSERT_SAFE_MSG(index >= dim_ranges_[idim_].begin_index(), "Index out of range (below dimension minimum)");
7474
VTR_ASSERT_SAFE_MSG(index < dim_ranges_[idim_].end_index(), "Index out of range (above dimension maximum)");
7575

@@ -79,10 +79,10 @@ class NdOffsetMatrixProxy {
7979
* The elements are stored in zero-indexed form, so we need to adjust
8080
* for any non-zero minimum index
8181
*/
82-
size_t effective_index = index - dim_ranges_[idim_].begin_index();
82+
int effective_index = index - dim_ranges_[idim_].begin_index();
8383

8484
//Determine the stride of the next dimension
85-
size_t next_dim_stride = dim_stride_ / dim_ranges_[idim_ + 1].size();
85+
int next_dim_stride = dim_stride_ / dim_ranges_[idim_ + 1].size();
8686

8787
//Strip off one dimension
8888
return NdOffsetMatrixProxy<T, N - 1>(dim_ranges_, //Pass the dimension information
@@ -92,7 +92,7 @@ class NdOffsetMatrixProxy {
9292
}
9393

9494
///@brief [] operator
95-
NdOffsetMatrixProxy<T, N - 1> operator[](size_t index) {
95+
NdOffsetMatrixProxy<T, N - 1> operator[](int index) {
9696
//Call the const version and cast-away constness
9797
return const_cast<const NdOffsetMatrixProxy<T, N>*>(this)->operator[](index);
9898
}
@@ -122,21 +122,21 @@ class NdOffsetMatrixProxy<T, 1> {
122122
, start_(start) {}
123123

124124
///@brief const [] operator
125-
const T& operator[](size_t index) const {
125+
const T& operator[](int index) const {
126126
VTR_ASSERT_SAFE_MSG(dim_stride_ == 1, "Final dimension must have stride 1");
127127
VTR_ASSERT_SAFE_MSG(index >= dim_ranges_[idim_].begin_index(), "Index out of range (below dimension minimum)");
128128
VTR_ASSERT_SAFE_MSG(index < dim_ranges_[idim_].end_index(), "Index out of range (above dimension maximum)");
129129

130130
//The elements are stored in zero-indexed form, so we need to adjust
131131
//for any non-zero minimum index
132-
size_t effective_index = index - dim_ranges_[idim_].begin_index();
132+
int effective_index = index - dim_ranges_[idim_].begin_index();
133133

134134
//Base case
135135
return start_[effective_index];
136136
}
137137

138138
///@brief [] operator
139-
T& operator[](size_t index) {
139+
T& operator[](int index) {
140140
//Call the const version and cast-away constness
141141
return const_cast<T&>(const_cast<const NdOffsetMatrixProxy<T, 1>*>(this)->operator[](index));
142142
}
@@ -163,7 +163,7 @@ class NdOffsetMatrixProxy<T, 1> {
163163
* This should improve memory usage (no extra pointers to store for each dimension),
164164
* and cache locality (less indirection via pointers, predictable strides).
165165
*
166-
* The indicies are calculated based on the dimensions to access the appropriate elements.
166+
* The indices are calculated based on the dimensions to access the appropriate elements.
167167
* Since the indexing calculations are visible to the compiler at compile time they can be
168168
* optimized to be efficient.
169169
*/
@@ -230,14 +230,14 @@ class NdOffsetMatrixBase {
230230
}
231231

232232
///@brief Returns the starting index of ith dimension
233-
size_t begin_index(size_t i) const {
233+
int begin_index(size_t i) const {
234234
VTR_ASSERT_SAFE(i < ndims());
235235

236236
return dim_ranges_[i].begin_index();
237237
}
238238

239239
///@brief Returns the one-past-the-end index of the ith dimension
240-
size_t end_index(size_t i) const {
240+
int end_index(size_t i) const {
241241
VTR_ASSERT_SAFE(i < ndims());
242242

243243
return dim_ranges_[i].end_index();
@@ -333,7 +333,7 @@ class NdOffsetMatrixBase {
333333
*
334334
* Examples:
335335
*
336-
* //A 2-dimensional matrix with indicies [0..4][0..9]
336+
* //A 2-dimensional matrix with indices [0..4][0..9]
337337
* NdOffsetMatrix<int,2> m1({5,10});
338338
*
339339
* //Accessing an element
@@ -342,28 +342,28 @@ class NdOffsetMatrixBase {
342342
* //Setting an element
343343
* m4[6][20] = 0;
344344
*
345-
* //A 2-dimensional matrix with indicies [2..6][5..9]
345+
* //A 2-dimensional matrix with indices [2..6][5..9]
346346
* // Note that C++ requires one more set of curly brace than you would expect
347347
* NdOffsetMatrix<int,2> m2({{{2,7},{5,10}}});
348348
*
349-
* //A 3-dimensional matrix with indicies [0..4][0..9][0..19]
349+
* //A 3-dimensional matrix with indices [0..4][0..9][0..19]
350350
* NdOffsetMatrix<int,3> m3({5,10,20});
351351
*
352-
* //A 3-dimensional matrix with indicies [2..6][1..19][50..89]
352+
* //A 3-dimensional matrix with indices [2..6][1..19][50..89]
353353
* NdOffsetMatrix<int,3> m4({{{2,7}, {1,20}, {50,90}}});
354354
*
355-
* //A 2-dimensional matrix with indicies [2..6][1..20], with all entries
356-
* //intialized to 42
355+
* //A 2-dimensional matrix with indices [2..6][1..20], with all entries
356+
* //initialized to 42
357357
* NdOffsetMatrix<int,2> m4({{{2,7}, {1,21}}}, 42);
358358
*
359-
* //A 2-dimensional matrix with indicies [0..4][0..9], with all entries
359+
* //A 2-dimensional matrix with indices [0..4][0..9], with all entries
360360
* //initialized to 42
361361
* NdOffsetMatrix<int,2> m1({5,10}, 42);
362362
*
363363
* //Filling all entries with value 101
364364
* m1.fill(101);
365365
*
366-
* //Resizing an existing matrix (all values reset to default constucted value)
366+
* //Resizing an existing matrix (all values reset to default constructed value)
367367
* m1.resize({5,5})
368368
*
369369
* //Resizing an existing matrix (all elements set to value 88)
@@ -385,25 +385,25 @@ class NdOffsetMatrix : public NdOffsetMatrixBase<T, N> {
385385
* Returns a proxy-object to allow chained array-style indexing (N >= 2 case)
386386
* template<typename = typename std::enable_if<N >= 2>::type, typename T1=T>
387387
*/
388-
const NdOffsetMatrixProxy<T, N - 1> operator[](size_t index) const {
388+
const NdOffsetMatrixProxy<T, N - 1> operator[](int index) const {
389389
VTR_ASSERT_SAFE_MSG(this->dim_size(0) > 0, "Can not index into size zero dimension");
390390
VTR_ASSERT_SAFE_MSG(this->dim_size(1) > 0, "Can not index into size zero dimension");
391391
VTR_ASSERT_SAFE_MSG(index >= this->dim_ranges_[0].begin_index(), "Index out of range (below dimension minimum)");
392392
VTR_ASSERT_SAFE_MSG(index < this->dim_ranges_[0].end_index(), "Index out of range (above dimension maximum)");
393393

394394
/*
395-
* Clacluate the effective index
395+
* Calculate the effective index
396396
*
397397
* The elements are stored in zero-indexed form, so adjust for any
398398
* non-zero minimum index in this dimension
399399
*/
400-
size_t effective_index = index - this->dim_ranges_[0].begin_index();
400+
int effective_index = index - this->dim_ranges_[0].begin_index();
401401

402402
//Calculate the stride for the current dimension
403-
size_t dim_stride = this->size() / this->dim_size(0);
403+
int dim_stride = this->size() / this->dim_size(0);
404404

405405
//Calculate the stride for the next dimension
406-
size_t next_dim_stride = dim_stride / this->dim_size(1);
406+
int next_dim_stride = dim_stride / this->dim_size(1);
407407

408408
//Peel off the first dimension
409409
return NdOffsetMatrixProxy<T, N - 1>(this->dim_ranges_.data(), //Pass the dimension information
@@ -417,7 +417,7 @@ class NdOffsetMatrix : public NdOffsetMatrixBase<T, N> {
417417
*
418418
* Returns a proxy-object to allow chained array-style indexing
419419
*/
420-
NdOffsetMatrixProxy<T, N - 1> operator[](size_t index) {
420+
NdOffsetMatrixProxy<T, N - 1> operator[](int index) {
421421
//Call the const version, since returned by value don't need to worry about const
422422
return const_cast<const NdOffsetMatrix<T, N>*>(this)->operator[](index);
423423
}
@@ -436,7 +436,7 @@ class NdOffsetMatrix<T, 1> : public NdOffsetMatrixBase<T, 1> {
436436

437437
public:
438438
///@brief Access an element (immutable)
439-
const T& operator[](size_t index) const {
439+
const T& operator[](int index) const {
440440
VTR_ASSERT_SAFE_MSG(this->dim_size(0) > 0, "Can not index into size zero dimension");
441441
VTR_ASSERT_SAFE_MSG(index >= this->dim_ranges_[0].begin_index(), "Index out of range (below dimension minimum)");
442442
VTR_ASSERT_SAFE_MSG(index < this->dim_ranges_[0].end_index(), "Index out of range (above dimension maximum)");
@@ -445,7 +445,7 @@ class NdOffsetMatrix<T, 1> : public NdOffsetMatrixBase<T, 1> {
445445
}
446446

447447
///@brief Access an element (mutable)
448-
T& operator[](size_t index) {
448+
T& operator[](int index) {
449449
//Call the const version, and cast away const-ness
450450
return const_cast<T&>(const_cast<const NdOffsetMatrix<T, 1>*>(this)->operator[](index));
451451
}

vpr/src/draw/draw_basic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
628628
static vtr::OffsetMatrix<int> chany_track; /* [0..device_ctx.grid.width() - 2][1..device_ctx.grid.height() - 2] */
629629
if (draw_state->draw_route_type == GLOBAL) {
630630
/* Allocate some temporary storage if it's not already available. */
631-
size_t width = device_ctx.grid.width();
632-
size_t height = device_ctx.grid.height();
631+
int width = (int)device_ctx.grid.width();
632+
int height = (int)device_ctx.grid.height();
633633
if (chanx_track.empty()) {
634634
chanx_track = vtr::OffsetMatrix<int>({{{1, width - 1}, {0, height - 1}}});
635635
}
@@ -638,12 +638,12 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
638638
chany_track = vtr::OffsetMatrix<int>({{{0, width - 1}, {1, height - 1}}});
639639
}
640640

641-
for (size_t i = 1; i < width - 1; i++)
642-
for (size_t j = 0; j < height - 1; j++)
641+
for (int i = 1; i < width - 1; i++)
642+
for (int j = 0; j < height - 1; j++)
643643
chanx_track[i][j] = (-1);
644644

645-
for (size_t i = 0; i < width - 1; i++)
646-
for (size_t j = 1; j < height - 1; j++)
645+
for (int i = 0; i < width - 1; i++)
646+
for (int j = 1; j < height - 1; j++)
647647
chany_track[i][j] = (-1);
648648
}
649649

0 commit comments

Comments
 (0)