Skip to content

Commit

Permalink
resolved conflicts with master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
saaramahmoudi committed Sep 11, 2023
2 parents e853ae3 + 190fc90 commit 3e16a0f
Show file tree
Hide file tree
Showing 53 changed files with 885 additions and 428 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/hostsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ apt install -y \
default-jdk \
g++-9 \
gcc-9 \
wget
wget \
libtbb-dev

# installing the latest version of cmake
apt install -y apt-transport-https ca-certificates gnupg
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
- name: Execute test script
run: stdbuf -i0 -o0 -e0 ./.github/scripts/run-vtr.sh
env:
VPR_NUM_WORKERS: 4
VTR_TEST: ${{ matrix.test }}
VTR_TEST_OPTIONS: ${{ matrix.options }}
VTR_CMAKE_PARAMS: ${{ matrix.cmake }}
Expand Down
3 changes: 3 additions & 0 deletions dev/pylint_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def main():
cmd = ["pylint", path, "-s", "n"]
if ignore_list:
cmd.append("--disable=" + ",".join(ignore_list))
# Don't object to single-letter variable names (that's not in PEP8)
# see https://stackoverflow.com/q/21833872
cmd.append("--variable-rgx=[a-z][a-z0-9_]{0,40}$")

# Run pylint and check output
process = subprocess.run(cmd, check=False, stdout=subprocess.PIPE)
Expand Down
Binary file added doc/src/Images/view_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions doc/src/vpr/graphics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ Each block can contain a number of flip flops (ff), look up tables (lut), and ot

Visualizing Block Internals

View Menu
-----------------------------
.. figure:: ../Images/view_menu.png
:align: center

Items under view menu

The view menu is displayed when vpr is targeting a stacked multi-die architecture (more than 1 layer).
Layers are drawn in ascending order for many drawing features (e.g. blocks); that is layer 0 is drawn first, and (if visible), layer 1 is drawn on top of it etc.
The visibility and transparency of a layer can be changed, which will affect blocks, nets, routing, and critical path.
Cross-layer connections refer to connections that are in different layers.

Button Description Table
------------------------
Expand Down
60 changes: 40 additions & 20 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
*
* Cmdline: uxsdcxx/uxsdcxx.py /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: 9fa1b4c9c4b23d4c6d321612d2f76bad
* Cmdline: uxsdcxx/uxsdcxx.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
*/

#include <functional>
Expand Down Expand Up @@ -82,12 +82,12 @@ template <class T, typename Context>
inline void load_block_types(const pugi::xml_node &root, T &out, Context &context, const std::function<void(const char*)> *report_error, ptrdiff_t *offset_debug);
template <class T, typename Context>
inline void load_grid_loc(const pugi::xml_node &root, T &out, Context &context, const std::function<void(const char*)> *report_error, ptrdiff_t *offset_debug);
inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int * block_type_id, int * height_offset, int * layer, int * width_offset, int * x, int * y, const std::function<void(const char*)> * report_error);
inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int * block_type_id, int * height_offset, int * width_offset, int * x, int * y, const std::function<void(const char*)> * report_error);
template <class T, typename Context>
inline void load_grid_locs(const pugi::xml_node &root, T &out, Context &context, const std::function<void(const char*)> *report_error, ptrdiff_t *offset_debug);
template <class T, typename Context>
inline void load_node_loc(const pugi::xml_node &root, T &out, Context &context, const std::function<void(const char*)> *report_error, ptrdiff_t *offset_debug);
inline void load_node_loc_required_attributes(const pugi::xml_node &root, int * layer, int * ptc, int * xhigh, int * xlow, int * yhigh, int * ylow, const std::function<void(const char*)> * report_error);
inline void load_node_loc_required_attributes(const pugi::xml_node &root, int * ptc, int * xhigh, int * xlow, int * yhigh, int * ylow, const std::function<void(const char*)> * report_error);
template <class T, typename Context>
inline void load_node_timing(const pugi::xml_node &root, T &out, Context &context, const std::function<void(const char*)> *report_error, ptrdiff_t *offset_debug);
inline void load_node_timing_required_attributes(const pugi::xml_node &root, float * C, float * R, const std::function<void(const char*)> * report_error);
Expand Down Expand Up @@ -2314,7 +2314,7 @@ inline void load_block_type_required_attributes(const pugi::xml_node &root, int
if(!test_astate.all()) attr_error(test_astate, atok_lookup_t_block_type, report_error);
}

inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int * block_type_id, int * height_offset, int * layer, int * width_offset, int * x, int * y, const std::function<void(const char *)> * report_error){
inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int * block_type_id, int * height_offset, int * width_offset, int * x, int * y, const std::function<void(const char *)> * report_error){
std::bitset<6> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_grid_loc in = lex_attr_t_grid_loc(attr.name(), report_error);
Expand All @@ -2328,7 +2328,7 @@ inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int *
*height_offset = load_int(attr.value(), report_error);
break;
case atok_t_grid_loc::LAYER:
*layer = load_int(attr.value(), report_error);
/* Attribute layer set after element init */
break;
case atok_t_grid_loc::WIDTH_OFFSET:
*width_offset = load_int(attr.value(), report_error);
Expand All @@ -2342,19 +2342,19 @@ inline void load_grid_loc_required_attributes(const pugi::xml_node &root, int *
default: break; /* Not possible. */
}
}
std::bitset<6> test_astate = astate | std::bitset<6>(0b000000);
std::bitset<6> test_astate = astate | std::bitset<6>(0b000100);
if(!test_astate.all()) attr_error(test_astate, atok_lookup_t_grid_loc, report_error);
}

inline void load_node_loc_required_attributes(const pugi::xml_node &root, int * layer, int * ptc, int * xhigh, int * xlow, int * yhigh, int * ylow, const std::function<void(const char *)> * report_error){
inline void load_node_loc_required_attributes(const pugi::xml_node &root, int * ptc, int * xhigh, int * xlow, int * yhigh, int * ylow, const std::function<void(const char *)> * report_error){
std::bitset<8> astate = 0;
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_node_loc in = lex_attr_t_node_loc(attr.name(), report_error);
if(astate[(int)in] == 0) astate[(int)in] = 1;
else noreturn_report(report_error, ("Duplicate attribute " + std::string(attr.name()) + " in <node_loc>.").c_str());
switch(in){
case atok_t_node_loc::LAYER:
*layer = load_int(attr.value(), report_error);
/* Attribute layer set after element init */
break;
case atok_t_node_loc::PTC:
*ptc = load_int(attr.value(), report_error);
Expand All @@ -2380,7 +2380,7 @@ inline void load_node_loc_required_attributes(const pugi::xml_node &root, int *
default: break; /* Not possible. */
}
}
std::bitset<8> test_astate = astate | std::bitset<8>(0b00001100);
std::bitset<8> test_astate = astate | std::bitset<8>(0b00001101);
if(!test_astate.all()) attr_error(test_astate, atok_lookup_t_node_loc, report_error);
}

Expand Down Expand Up @@ -3168,6 +3168,30 @@ inline void load_grid_loc(const pugi::xml_node &root, T &out, Context &context,
// Update current file offset in case an error is encountered.
*offset_debug = root.offset_debug();

for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
atok_t_grid_loc in = lex_attr_t_grid_loc(attr.name(), report_error);
switch(in){
case atok_t_grid_loc::BLOCK_TYPE_ID:
/* Attribute block_type_id is already set */
break;
case atok_t_grid_loc::HEIGHT_OFFSET:
/* Attribute height_offset is already set */
break;
case atok_t_grid_loc::LAYER:
out.set_grid_loc_layer(load_int(attr.value(), report_error), context);
break;
case atok_t_grid_loc::WIDTH_OFFSET:
/* Attribute width_offset is already set */
break;
case atok_t_grid_loc::X:
/* Attribute x is already set */
break;
case atok_t_grid_loc::Y:
/* Attribute y is already set */
break;
default: break; /* Not possible. */
}
}

if(root.first_child().type() == pugi::node_element)
noreturn_report(report_error, "Unexpected child element in <grid_loc>.");
Expand Down Expand Up @@ -3228,16 +3252,14 @@ inline void load_grid_locs(const pugi::xml_node &root, T &out, Context &context,
memset(&grid_loc_block_type_id, 0, sizeof(grid_loc_block_type_id));
int grid_loc_height_offset;
memset(&grid_loc_height_offset, 0, sizeof(grid_loc_height_offset));
int grid_loc_layer;
memset(&grid_loc_layer, 0, sizeof(grid_loc_layer));
int grid_loc_width_offset;
memset(&grid_loc_width_offset, 0, sizeof(grid_loc_width_offset));
int grid_loc_x;
memset(&grid_loc_x, 0, sizeof(grid_loc_x));
int grid_loc_y;
memset(&grid_loc_y, 0, sizeof(grid_loc_y));
load_grid_loc_required_attributes(node, &grid_loc_block_type_id, &grid_loc_height_offset, &grid_loc_layer, &grid_loc_width_offset, &grid_loc_x, &grid_loc_y, report_error);
auto child_context = out.add_grid_locs_grid_loc(context, grid_loc_block_type_id, grid_loc_height_offset, grid_loc_layer, grid_loc_width_offset, grid_loc_x, grid_loc_y);
load_grid_loc_required_attributes(node, &grid_loc_block_type_id, &grid_loc_height_offset, &grid_loc_width_offset, &grid_loc_x, &grid_loc_y, report_error);
auto child_context = out.add_grid_locs_grid_loc(context, grid_loc_block_type_id, grid_loc_height_offset, grid_loc_width_offset, grid_loc_x, grid_loc_y);
load_grid_loc(node, out, child_context, report_error, offset_debug);
out.finish_grid_locs_grid_loc(child_context);
}
Expand All @@ -3262,7 +3284,7 @@ inline void load_node_loc(const pugi::xml_node &root, T &out, Context &context,
atok_t_node_loc in = lex_attr_t_node_loc(attr.name(), report_error);
switch(in){
case atok_t_node_loc::LAYER:
/* Attribute layer is already set */
out.set_node_loc_layer(load_int(attr.value(), report_error), context);
break;
case atok_t_node_loc::PTC:
/* Attribute ptc is already set */
Expand Down Expand Up @@ -3448,8 +3470,6 @@ inline void load_node(const pugi::xml_node &root, T &out, Context &context, cons
switch(in){
case gtok_t_node::LOC:
{
int node_loc_layer;
memset(&node_loc_layer, 0, sizeof(node_loc_layer));
int node_loc_ptc;
memset(&node_loc_ptc, 0, sizeof(node_loc_ptc));
int node_loc_xhigh;
Expand All @@ -3460,8 +3480,8 @@ inline void load_node(const pugi::xml_node &root, T &out, Context &context, cons
memset(&node_loc_yhigh, 0, sizeof(node_loc_yhigh));
int node_loc_ylow;
memset(&node_loc_ylow, 0, sizeof(node_loc_ylow));
load_node_loc_required_attributes(node, &node_loc_layer, &node_loc_ptc, &node_loc_xhigh, &node_loc_xlow, &node_loc_yhigh, &node_loc_ylow, report_error);
auto child_context = out.init_node_loc(context, node_loc_layer, node_loc_ptc, node_loc_xhigh, node_loc_xlow, node_loc_yhigh, node_loc_ylow);
load_node_loc_required_attributes(node, &node_loc_ptc, &node_loc_xhigh, &node_loc_xlow, &node_loc_yhigh, &node_loc_ylow, report_error);
auto child_context = out.init_node_loc(context, node_loc_ptc, node_loc_xhigh, node_loc_xlow, node_loc_yhigh, node_loc_ylow);
load_node_loc(node, out, child_context, report_error, offset_debug);
out.finish_node_loc(child_context);
}
Expand Down
12 changes: 7 additions & 5 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_capnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
*
* Cmdline: uxsdcxx/uxsdcap.py /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: 9fa1b4c9c4b23d4c6d321612d2f76bad
* Cmdline: uxsdcxx/uxsdcap.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
*/

#include <functional>
Expand Down Expand Up @@ -672,6 +672,7 @@ inline void load_grid_loc_capnp_type(const ucap::GridLoc::Reader &root, T &out,
(void)report_error;
(void)stack;

out.set_grid_loc_layer(root.getLayer(), context);
}

template<class T, typename Context>
Expand All @@ -687,7 +688,7 @@ inline void load_grid_locs_capnp_type(const ucap::GridLocs::Reader &root, T &out
auto data = root.getGridLocs();
out.preallocate_grid_locs_grid_loc(context, data.size());
for(const auto & el : data) {
auto child_context = out.add_grid_locs_grid_loc(context, el.getBlockTypeId(), el.getHeightOffset(), el.getLayer(), el.getWidthOffset(), el.getX(), el.getY());
auto child_context = out.add_grid_locs_grid_loc(context, el.getBlockTypeId(), el.getHeightOffset(), el.getWidthOffset(), el.getX(), el.getY());
load_grid_loc_capnp_type(el, out, child_context, report_error, stack);
out.finish_grid_locs_grid_loc(child_context);
stack->back().second += 1;
Expand All @@ -704,6 +705,7 @@ inline void load_node_loc_capnp_type(const ucap::NodeLoc::Reader &root, T &out,
(void)report_error;
(void)stack;

out.set_node_loc_layer(root.getLayer(), context);
out.set_node_loc_side(conv_enum_loc_side(root.getSide(), report_error), context);
out.set_node_loc_twist(root.getTwist(), context);
}
Expand Down Expand Up @@ -776,7 +778,7 @@ inline void load_node_capnp_type(const ucap::Node::Reader &root, T &out, Context
stack->push_back(std::make_pair("getLoc", 0));
if (root.hasLoc()) {
auto child_el = root.getLoc();
auto child_context = out.init_node_loc(context, child_el.getLayer(), child_el.getPtc(), child_el.getXhigh(), child_el.getXlow(), child_el.getYhigh(), child_el.getYlow());
auto child_context = out.init_node_loc(context, child_el.getPtc(), child_el.getXhigh(), child_el.getXlow(), child_el.getYhigh(), child_el.getYlow());
load_node_loc_capnp_type(child_el, out, child_context, report_error, stack);
out.finish_node_loc(child_context);
}
Expand Down
18 changes: 10 additions & 8 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* This file is generated by uxsdcxx 0.1.0.
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
* Cmdline: uxsdcxx/uxsdcxx.py /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/RLPLACE_LOCAL/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: 9fa1b4c9c4b23d4c6d321612d2f76bad
*
* Cmdline: uxsdcxx/uxsdcxx.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
*/

#include <functional>
Expand Down Expand Up @@ -329,7 +330,7 @@ class RrGraphBase {

/** Generated for complex type "grid_loc":
* <xs:complexType name="grid_loc">
* <xs:attribute name="layer" type="xs:int" use="required" />
* <xs:attribute name="layer" type="xs:int" default="0" />
* <xs:attribute name="x" type="xs:int" use="required" />
* <xs:attribute name="y" type="xs:int" use="required" />
* <xs:attribute name="block_type_id" type="xs:int" use="required" />
Expand All @@ -340,6 +341,7 @@ class RrGraphBase {
virtual inline int get_grid_loc_block_type_id(typename ContextTypes::GridLocReadContext &ctx) = 0;
virtual inline int get_grid_loc_height_offset(typename ContextTypes::GridLocReadContext &ctx) = 0;
virtual inline int get_grid_loc_layer(typename ContextTypes::GridLocReadContext &ctx) = 0;
virtual inline void set_grid_loc_layer(int layer, typename ContextTypes::GridLocWriteContext &ctx) = 0;
virtual inline int get_grid_loc_width_offset(typename ContextTypes::GridLocReadContext &ctx) = 0;
virtual inline int get_grid_loc_x(typename ContextTypes::GridLocReadContext &ctx) = 0;
virtual inline int get_grid_loc_y(typename ContextTypes::GridLocReadContext &ctx) = 0;
Expand All @@ -352,15 +354,14 @@ class RrGraphBase {
* </xs:complexType>
*/
virtual inline void preallocate_grid_locs_grid_loc(typename ContextTypes::GridLocsWriteContext &ctx, size_t size) = 0;
virtual inline typename ContextTypes::GridLocWriteContext add_grid_locs_grid_loc(typename ContextTypes::GridLocsWriteContext &ctx, int block_type_id, int height_offset, int layer, int width_offset, int x, int y) = 0;
virtual inline typename ContextTypes::GridLocWriteContext add_grid_locs_grid_loc(typename ContextTypes::GridLocsWriteContext &ctx, int block_type_id, int height_offset, int width_offset, int x, int y) = 0;
virtual inline void finish_grid_locs_grid_loc(typename ContextTypes::GridLocWriteContext &ctx) = 0;
virtual inline size_t num_grid_locs_grid_loc(typename ContextTypes::GridLocsReadContext &ctx) = 0;
virtual inline typename ContextTypes::GridLocReadContext get_grid_locs_grid_loc(int n, typename ContextTypes::GridLocsReadContext &ctx) = 0;

/** Generated for complex type "node_loc":
* <xs:complexType name="node_loc">
* <xs:attribute name="layer" type="xs:int" use="required" />
* <xs:attribute name="twist" type="xs:int" />
* <xs:attribute name="layer" type="xs:int" default="0" />
* <xs:attribute name="xlow" type="xs:int" use="required" />
* <xs:attribute name="ylow" type="xs:int" use="required" />
* <xs:attribute name="xhigh" type="xs:int" use="required" />
Expand All @@ -371,6 +372,7 @@ class RrGraphBase {
* </xs:complexType>
*/
virtual inline int get_node_loc_layer(typename ContextTypes::NodeLocReadContext &ctx) = 0;
virtual inline void set_node_loc_layer(int layer, typename ContextTypes::NodeLocWriteContext &ctx) = 0;
virtual inline int get_node_loc_ptc(typename ContextTypes::NodeLocReadContext &ctx) = 0;
virtual inline enum_loc_side get_node_loc_side(typename ContextTypes::NodeLocReadContext &ctx) = 0;
virtual inline void set_node_loc_side(enum_loc_side side, typename ContextTypes::NodeLocWriteContext &ctx) = 0;
Expand Down Expand Up @@ -443,7 +445,7 @@ class RrGraphBase {
virtual inline void set_node_direction(enum_node_direction direction, typename ContextTypes::NodeWriteContext &ctx) = 0;
virtual inline unsigned int get_node_id(typename ContextTypes::NodeReadContext &ctx) = 0;
virtual inline enum_node_type get_node_type(typename ContextTypes::NodeReadContext &ctx) = 0;
virtual inline typename ContextTypes::NodeLocWriteContext init_node_loc(typename ContextTypes::NodeWriteContext &ctx, int layer, int ptc, int xhigh, int xlow, int yhigh, int ylow) = 0;
virtual inline typename ContextTypes::NodeLocWriteContext init_node_loc(typename ContextTypes::NodeWriteContext &ctx, int ptc, int xhigh, int xlow, int yhigh, int ylow) = 0;
virtual inline void finish_node_loc(typename ContextTypes::NodeLocWriteContext &ctx) = 0;
virtual inline typename ContextTypes::NodeLocReadContext get_node_loc(typename ContextTypes::NodeReadContext &ctx) = 0;
virtual inline typename ContextTypes::NodeTimingWriteContext init_node_timing(typename ContextTypes::NodeWriteContext &ctx, float C, float R) = 0;
Expand Down
4 changes: 2 additions & 2 deletions libs/librrgraph/src/io/rr_graph.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
</xs:simpleType>

<xs:complexType name="grid_loc">
<xs:attribute name="layer" type="xs:int" use="required"/>
<xs:attribute name="layer" type="xs:int" default="0"/>
<xs:attribute name="x" type="xs:int" use="required"/>
<xs:attribute name="y" type="xs:int" use="required"/>
<xs:attribute name="block_type_id" type="xs:int" use="required"/>
Expand Down Expand Up @@ -259,7 +259,7 @@
</xs:simpleType>

<xs:complexType name="node_loc">
<xs:attribute name="layer" type="xs:int" use="required"/>
<xs:attribute name="layer" type="xs:int" default="0"/>
<xs:attribute name="xlow" type="xs:int" use="required"/>
<xs:attribute name="ylow" type="xs:int" use="required"/>
<xs:attribute name="xhigh" type="xs:int" use="required"/>
Expand Down
Loading

0 comments on commit 3e16a0f

Please sign in to comment.