Skip to content

Commit 595af59

Browse files
author
Nathan Shreve
committed
Merge branch 'master' into feature_router_lookahead_verifier
2 parents 17ab565 + 78c89f5 commit 595af59

File tree

143 files changed

+6492
-5637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+6492
-5637
lines changed

doc/src/arch/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FPGA Architecture Description
44
=============================
55

66
VTR uses an XML-based architecture description language to describe the targeted FPGA architecture.
7-
This flexible description langauge allows the user to describe a large number of hypothetical and commercial-like FPGA architectures.
7+
This flexible description language allows the user to describe a large number of hypothetical and commercial-like FPGA architectures.
88

99
See the :ref:`arch_tutorial` for an introduction to the architecture description langauge.
1010
For a detailed reference on the supported options see the :ref:`arch_reference`.

doc/src/arch/reference.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,12 @@ The ``<segment>`` tag and its contents are described below.
20362036
20372037
Tag must be included and ``name`` must be the same as the name you give in ``<switch type="mux" name="...``
20382038
2039+
.. arch:tag:: <mux_inter_die name="string"/>
2040+
2041+
:req_param name: Name of the mux switch type used to drive this segment type when the driver (block outputs and other wires) is located on a different die than the segment. This information is utilized during rr-graph construction.
2042+
2043+
Tag must be included and ``name`` must be the same as the name you give in ``<switch type="mux" name="...``
2044+
20392045
.. arch:tag:: <wire_switch name="string"/>
20402046
20412047
:req_param name: Name of the switch type used by other wires to drive this type of segment by default. This information is used during rr-graph construction, and a custom switch block can override this switch type for specific connections if desired.

doc/src/quickstart/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
VTR Quick Start
33
###############
44

5-
This is a quick introduction to VTR which covers how to run VTR and some if its associated tools (:ref:`VPR`, :ref:`odin_ii`, :ref:`ABC`).
5+
This is a quick introduction to VTR which covers how to run VTR and some of its associated tools (:ref:`VPR`, :ref:`odin_ii`, :ref:`ABC`).
66

77
Setting Up VTR
88
==============
99

1010
Download VTR
1111
------------
1212

13-
The first step is to `download VTR <https://verilogtorouting.org/download/>`_ and extract VTR on your local machine.
13+
The first step is to `download VTR <https://verilogtorouting.org/download/>`_ and extract it on your local machine.
1414

1515
.. note:: Developers planning to modify VTR should clone the `VTR git repository <https://github.com/verilog-to-routing/vtr-verilog-to-routing/>`_.
1616

1717

1818
Environment Setup
1919
-----------------
20-
If you cloned the repository you will need to set up the git submodules (if you downloaded and extracted a release, you can skip this step):
20+
If you cloned the repository, you will need to set up the git submodules (if you downloaded and extracted a release, you can skip this step):
2121

2222
.. code-block:: bash
2323
@@ -77,12 +77,12 @@ For more details on building VTR on various operating systems/platforms see :doc
7777
Running VPR
7878
===========
7979

80-
Lets now try taking a simple pre-synthesized circuit (consisting of LUTs and Flip-Flops) and use the VPR tool to implement it on a specific FPGA architecture.
80+
Let's now try taking a simple pre-synthesized circuit (consisting of LUTs and Flip-Flops) and use the VPR tool to implement it on a specific FPGA architecture.
8181

8282
Running VPR on a Pre-Synthesized Circuit
8383
----------------------------------------
8484

85-
First, lets make a directory in our home directory where we can work:
85+
First, let's make a directory in our home directory where we can work:
8686

8787
.. code-block:: bash
8888
@@ -211,13 +211,13 @@ Running the VTR Flow
211211
In the previous section we have implemented a pre-synthesized circuit onto a pre-existing FPGA architecture using VPR, and visualized the result.
212212
We now turn to how we can implement *our own circuit* on a pre-existing FPGA architecture.
213213

214-
To do this we begin by describing a circuit behaviourly using the Verilog Hardware Description Language (HDL).
214+
To do this, we begin by describing a circuit behaviourally using the Verilog Hardware Description Language (HDL).
215215
This allows us to quickly and consisely define the circuit's behaviour.
216216
We will then use the VTR Flow to synthesize the behavioural Verilog description it into a circuit netlist, and implement it onto an FPGA.
217217

218218
Example Circuit
219219
---------------
220-
We will use the following simple example circuit, which causes it's output to toggle on and off:
220+
We will use the following simple example circuit, which causes its output to toggle on and off:
221221

222222
.. literalinclude:: blink.v
223223
:language: verilog
@@ -230,7 +230,7 @@ If the count is below ``16`` it drives the output (``o_led``) high, otherwise it
230230

231231
Manually Running the VTR Flow
232232
-----------------------------
233-
Lets start by making a fresh directory for us to work in:
233+
Let's start by making a fresh directory for us to work in:
234234

235235
.. code-block:: bash
236236
@@ -241,15 +241,15 @@ Next we need to run the three main sets of tools:
241241

242242
* :ref:`odin_ii` performs 'synthesis' which converts our behavioural Verilog (``.v`` file) into a circuit netlist (``.blif`` file) consisting of logic equations and FPGA architecture primitives (Flip-Flops, adders etc.),
243243
* :ref:`ABC` performs 'logic optimization' which simplifies the circuit logic, and 'technology mapping' which converts logic equations into the Look-Up-Tables (LUTs) available on an FPGA, and
244-
* :ref:`VPR` which performs packing, placement and routing of the circuit to implement it on the targetted FPGA architecture.
244+
* :ref:`VPR` which performs packing, placement and routing of the circuit to implement it on the targeted FPGA architecture.
245245

246246
.. _synthesizing_with_odin_ii:
247247
Synthesizing with ODIN II
248248
~~~~~~~~~~~~~~~~~~~~~~~~~
249249

250250
First we'll run ODIN II on our Verilog file to synthesize it into a circuit netlist, providing the options:
251251

252-
* ``-a $VTR_ROOT/vtr_flow/arch/timing/EArch.xml`` which specifies what FPGA architecture we are targetting,
252+
* ``-a $VTR_ROOT/vtr_flow/arch/timing/EArch.xml`` which specifies what FPGA architecture we are targeting,
253253
* ``-V $VTR_ROOT/doc/src/quickstart/blink.v`` which specifies the verilog file we want to synthesize, and
254254
* ``-o blink.odin.blif`` which specifies the name of the generated ``.blif`` circuit netlist.
255255

@@ -400,7 +400,7 @@ Automatically Running the VTR Flow
400400
Running each stage of the flow manually is time consuming (and potentially error prone).
401401
For convenience, VTR provides a script (:ref:`run_vtr_flow`) which automates this process.
402402

403-
First, make sure you sure you have activated the Python virtual environment created at the beginning of this tutorial:
403+
First, make sure you have activated the Python virtual environment created at the beginning of this tutorial:
404404

405405
.. code-block:: bash
406406

doc/src/vpr/file_formats.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,11 @@ All the following lines have the format::
623623

624624
block_name x y subtile_number
625625

626-
The ``block_name`` is the name of this block, as given in the input .net formatted netlist.
626+
The ``block_name`` can refer to either:
627+
628+
- The name of a clustered block, as given in the input .net formatted netlist.
629+
- The name of a primitive within a clustered block.
630+
627631
``x`` and ``y`` are the row and column in which the block is placed, respectively.
628632

629633
.. note:: The blocks in a placement file can be listed in any order.

doc/src/vpr/vpr_constraints.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ VPR Constraints
22
=========================
33
.. _vpr_constraints:
44

5-
VPR allows users to run the flow with placement constraints that enable primitives to be locked down to a specific region on the chip and global routing constraints that facilitate the routing of global nets through clock networks.
6-
7-
Users can specify these constraints through a constraints file in XML format, as shown in the format below.
5+
Users can specify placement and/or global routing constraints on all or part of a design through a constraints file in XML format, as shown in the format below. These constraints are optional and allow detailed control of the region on the chip in which parts of the design are placed, and of the routing of global nets through dedicated (usually clock) networks.
86

97
.. code-block:: xml
108
:caption: The overall format of a VPR constraints file

libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os,
606606

607607
{
608608
//Input constraint
609-
TATUM_ASSERT(subpath.elements().size() > 0);
609+
TATUM_ASSERT(!subpath.elements().empty());
610610
const TimingPathElem& path_elem = *(subpath.elements().begin());
611611

612612
Time input_constraint;
@@ -712,7 +712,7 @@ bool TimingReporter::nearly_equal(const Time& lhs, const Time& rhs) const {
712712

713713
size_t TimingReporter::estimate_point_print_width(const TimingPath& path) const {
714714
size_t width = 60; //default
715-
for(auto subpath : {path.clock_launch_path(), path.data_arrival_path(), path.clock_capture_path()}) {
715+
for(const auto& subpath : {path.clock_launch_path(), path.data_arrival_path(), path.clock_capture_path()}) {
716716
for(auto elem : subpath.elements()) {
717717
//Take the longest typical point name
718718
std::string point = name_resolver_.node_name(elem.node()) + " (" + name_resolver_.node_type_name(elem.node()) + ")";

libs/librrgraph/src/base/rr_graph_storage.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
#include "vtr_memory.h"
1616
#include "vtr_strong_id_range.h"
1717
#include "vtr_array_view.h"
18-
#include<iostream>
18+
#include <iostream>
1919
#include <optional>
20+
#include <cstdint>
2021

2122
/* Main structure describing one routing resource node. Everything in *
2223
* this structure should describe the graph -- information needed only *

libs/librrgraph/src/base/rr_node_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <vector>
88
#include <array>
99
#include <map>
10+
#include <cstdint>
1011
#include "vtr_range.h"
1112
#include "vtr_ndmatrix.h"
1213

libs/librrgraph/src/io/gen/README.gen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
`rr_graph_uxsdcxx_interface.h` are generated via uxsdcxx and are checked in to
33
avoid requiring python3 and the uxsdcxx depedencies to build VPR.
44

5-
See `vpr/src/route/gen/SCHEMA_GENERATOR.md` for details.
5+
See `$VTR_DIR/libs/librrgraph/src/base/SCHEMA_GENERATOR.md` for details.

libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* https://github.com/duck2/uxsdcxx
55
* Modify only if your build process doesn't involve regenerating this file.
66
*
7-
* Cmdline: /home/talaeikh/uxsdcxx/uxsdcxx.py /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8-
* Input file: /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9-
* md5sum of input file: 9c14a0ddd3c6bc1e690ca6abf467bae6
7+
* Cmdline: uxsdcxx/uxsdcxx.py /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8+
* Input file: /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9+
* md5sum of input file: 65eddcc840064bbb91d7f4cf0b8bf821
1010
*/
1111

1212
#include <functional>
@@ -247,8 +247,8 @@ constexpr const char *atok_lookup_t_segment_timing[] = {"C_per_meter", "R_per_me
247247

248248
enum class gtok_t_segment {TIMING};
249249
constexpr const char *gtok_lookup_t_segment[] = {"timing"};
250-
enum class atok_t_segment {ID, NAME, RES_TYPE};
251-
constexpr const char *atok_lookup_t_segment[] = {"id", "name", "res_type"};
250+
enum class atok_t_segment {ID, LENGTH, NAME, RES_TYPE};
251+
constexpr const char *atok_lookup_t_segment[] = {"id", "length", "name", "res_type"};
252252

253253
enum class gtok_t_segments {SEGMENT};
254254
constexpr const char *gtok_lookup_t_segments[] = {"segment"};
@@ -792,6 +792,24 @@ inline atok_t_segment lex_attr_t_segment(const char *in, const std::function<voi
792792
default: break;
793793
}
794794
break;
795+
case 6:
796+
switch(*((triehash_uu32*)&in[0])){
797+
case onechar('l', 0, 32) | onechar('e', 8, 32) | onechar('n', 16, 32) | onechar('g', 24, 32):
798+
switch(in[4]){
799+
case onechar('t', 0, 8):
800+
switch(in[5]){
801+
case onechar('h', 0, 8):
802+
return atok_t_segment::LENGTH;
803+
break;
804+
default: break;
805+
}
806+
break;
807+
default: break;
808+
}
809+
break;
810+
default: break;
811+
}
812+
break;
795813
case 8:
796814
switch(*((triehash_uu64*)&in[0])){
797815
case onechar('r', 0, 64) | onechar('e', 8, 64) | onechar('s', 16, 64) | onechar('_', 24, 64) | onechar('t', 32, 64) | onechar('y', 40, 64) | onechar('p', 48, 64) | onechar('e', 56, 64):
@@ -2325,7 +2343,7 @@ inline void load_switch_required_attributes(const pugi::xml_node &root, int * id
23252343
}
23262344

23272345
inline void load_segment_required_attributes(const pugi::xml_node &root, int * id, const std::function<void(const char *)> * report_error){
2328-
std::bitset<3> astate = 0;
2346+
std::bitset<4> astate = 0;
23292347
for(pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()){
23302348
atok_t_segment in = lex_attr_t_segment(attr.name(), report_error);
23312349
if(astate[(int)in] == 0) astate[(int)in] = 1;
@@ -2334,6 +2352,9 @@ inline void load_segment_required_attributes(const pugi::xml_node &root, int * i
23342352
case atok_t_segment::ID:
23352353
*id = load_int(attr.value(), report_error);
23362354
break;
2355+
case atok_t_segment::LENGTH:
2356+
/* Attribute length set after element init */
2357+
break;
23372358
case atok_t_segment::NAME:
23382359
/* Attribute name set after element init */
23392360
break;
@@ -2343,7 +2364,7 @@ inline void load_segment_required_attributes(const pugi::xml_node &root, int * i
23432364
default: break; /* Not possible. */
23442365
}
23452366
}
2346-
std::bitset<3> test_astate = astate | std::bitset<3>(0b100);
2367+
std::bitset<4> test_astate = astate | std::bitset<4>(0b1010);
23472368
if(!test_astate.all()) attr_error(test_astate, atok_lookup_t_segment, report_error);
23482369
}
23492370

@@ -2936,6 +2957,9 @@ inline void load_segment(const pugi::xml_node &root, T &out, Context &context, c
29362957
case atok_t_segment::ID:
29372958
/* Attribute id is already set */
29382959
break;
2960+
case atok_t_segment::LENGTH:
2961+
out.set_segment_length(load_int(attr.value(), report_error), context);
2962+
break;
29392963
case atok_t_segment::NAME:
29402964
out.set_segment_name(attr.value(), context);
29412965
break;
@@ -4006,6 +4030,8 @@ inline void write_segments(T &in, std::ostream &os, Context &context){
40064030
auto child_context = in.get_segments_segment(i, context);
40074031
os << "<segment";
40084032
os << " id=\"" << in.get_segment_id(child_context) << "\"";
4033+
if((bool)in.get_segment_length(child_context))
4034+
os << " length=\"" << in.get_segment_length(child_context) << "\"";
40094035
os << " name=\"" << in.get_segment_name(child_context) << "\"";
40104036
if((bool)in.get_segment_res_type(child_context))
40114037
os << " res_type=\"" << lookup_segment_res_type[(int)in.get_segment_res_type(child_context)] << "\"";

libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_capnp.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* https://github.com/duck2/uxsdcxx
55
* Modify only if your build process doesn't involve regenerating this file.
66
*
7-
* Cmdline: /home/talaeikh/uxsdcxx/uxsdcap.py /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8-
* Input file: /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9-
* md5sum of input file: 9c14a0ddd3c6bc1e690ca6abf467bae6
7+
* Cmdline: uxsdcxx/uxsdcap.py /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8+
* Input file: /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9+
* md5sum of input file: 65eddcc840064bbb91d7f4cf0b8bf821
1010
*/
1111

1212
#include <functional>
@@ -601,6 +601,7 @@ inline void load_segment_capnp_type(const ucap::Segment::Reader &root, T &out, C
601601
(void)report_error;
602602
(void)stack;
603603

604+
out.set_segment_length(root.getLength(), context);
604605
out.set_segment_name(root.getName().cStr(), context);
605606
out.set_segment_res_type(conv_enum_segment_res_type(root.getResType(), report_error), context);
606607
stack->push_back(std::make_pair("getTiming", 0));
@@ -1101,6 +1102,8 @@ inline void write_segments_capnp_type(T &in, ucap::Segments::Builder &root, Cont
11011102
auto segments_segment = segments_segments[i];
11021103
auto child_context = in.get_segments_segment(i, context);
11031104
segments_segment.setId(in.get_segment_id(child_context));
1105+
if((bool)in.get_segment_length(child_context))
1106+
segments_segment.setLength(in.get_segment_length(child_context));
11041107
segments_segment.setName(in.get_segment_name(child_context));
11051108
if((bool)in.get_segment_res_type(child_context))
11061109
segments_segment.setResType(conv_to_enum_segment_res_type(in.get_segment_res_type(child_context)));

libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_interface.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* https://github.com/duck2/uxsdcxx
55
* Modify only if your build process doesn't involve regenerating this file.
66
*
7-
* Cmdline: /home/talaeikh/uxsdcxx/uxsdcxx.py /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8-
* Input file: /home/talaeikh/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9-
* md5sum of input file: 9c14a0ddd3c6bc1e690ca6abf467bae6
7+
* Cmdline: uxsdcxx/uxsdcxx.py /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
8+
* Input file: /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
9+
* md5sum of input file: 65eddcc840064bbb91d7f4cf0b8bf821
1010
*/
1111

1212
#include <functional>
@@ -245,11 +245,14 @@ class RrGraphBase {
245245
* <xs:element minOccurs="0" name="timing" type="segment_timing" />
246246
* </xs:all>
247247
* <xs:attribute name="id" type="xs:int" use="required" />
248+
* <xs:attribute name="length" type="xs:int" />
248249
* <xs:attribute name="name" type="xs:string" use="required" />
249250
* <xs:attribute name="res_type" type="segment_res_type" />
250251
* </xs:complexType>
251252
*/
252253
virtual inline int get_segment_id(typename ContextTypes::SegmentReadContext &ctx) = 0;
254+
virtual inline int get_segment_length(typename ContextTypes::SegmentReadContext &ctx) = 0;
255+
virtual inline void set_segment_length(int length, typename ContextTypes::SegmentWriteContext &ctx) = 0;
253256
virtual inline const char * get_segment_name(typename ContextTypes::SegmentReadContext &ctx) = 0;
254257
virtual inline void set_segment_name(const char * name, typename ContextTypes::SegmentWriteContext &ctx) = 0;
255258
virtual inline enum_segment_res_type get_segment_res_type(typename ContextTypes::SegmentReadContext &ctx) = 0;

libs/librrgraph/src/io/rr_graph.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
<xs:element name="timing" type="segment_timing" minOccurs="0"/>
156156
</xs:all>
157157
<xs:attribute name="id" type="xs:int" use="required"/>
158+
<xs:attribute name="length" type="xs:int"/>
158159
<xs:attribute name="name" type="xs:string" use="required"/>
159160
<xs:attribute name="res_type" type="segment_res_type"/>
160161
</xs:complexType>

libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,13 +1347,23 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
13471347
inline const char* get_segment_name(const t_segment_inf*& segment) final {
13481348
return segment->name.c_str();
13491349
}
1350+
inline int get_segment_length(const t_segment_inf*& segment) final {
1351+
return segment->length;
1352+
}
13501353
inline void set_segment_name(const char* name, const t_segment_inf*& segment) final {
13511354
if (segment->name != name) {
13521355
report_error(
13531356
"Architecture file does not match RR graph's segment name: arch uses %s, RR graph uses %s",
13541357
segment->name.c_str(), name);
13551358
}
13561359
}
1360+
inline void set_segment_length(int length, const t_segment_inf*& segment) final {
1361+
if (segment->length != length) {
1362+
report_error(
1363+
"Architecture file does not match RR graph's length: arch uses %d, RR graph uses %d",
1364+
segment->length, length);
1365+
}
1366+
}
13571367
inline uxsd::enum_segment_res_type get_segment_res_type(const t_segment_inf*& segment) final {
13581368
return to_uxsd_segment_res_type(segment->res_type);
13591369
}

0 commit comments

Comments
 (0)