Skip to content

Commit d81ba45

Browse files
committed
Merge branches 'wip/add-issue-template', 'wip/add_explicit_ports', 'wip/avoid-criticality-issue', 'wip/disable-check-route-option', 'wip/inline_main_loop', 'wip/length_bounded', 'wip/lookahead_sampling2', 'wip/place-constraints', 'wip/refactor_heap2', 'wip/revert_clock_propigation', 'wip/sdcparser-fix', 'wip/symbiflow-badger', 'wip/use_bool_over_std_set' and 'wip/use_expansion_for_place_delay' into read_edge_metadata
15 parents e5b04f3 + 598de8e + ab5e24e + f30377e + dadb077 + 901a18b + b23e8b6 + bf769a2 + 8a1a5f9 + 4821561 + 88d5411 + e054fc7 + c1a023e + d076e56 + 12222a0 commit d81ba45

File tree

103 files changed

+15028
-2298
lines changed

Some content is hidden

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

103 files changed

+15028
-2298
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

.github/ISSUE_TEMPLATE/vtr-change.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: VTR change
3+
about: Describe purpose and lifecycle of a local change we made to VTR
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### Why did we need this? (what does this change enable us to do)
11+
<!--- i.e. what does this change enable us to do? -->
12+
13+
### What did it change?
14+
<!--- i.e. technical description what the change does -->
15+
16+
### Should it be merged upstream - if not, when can we delete it?
17+
18+
### What is needed to get this merged / deleted?
19+
20+
* [ ] is the implementation work to make suitable for merging / deletion completed?
21+
* [ ] Is there an associated test? <!--- i.e. how will we prevent it from regressing? -->
22+
* [ ] is this currently part of the Conda package?
23+
* [ ] is this properly cleaned up in our local repositories? <!--- add subtasks here if needed) -->
24+
25+
### Tracker / branch / PR & other useful links

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
2+
SymbiFlow WIP changes for Verilog to Routing (VTR)
3+
==================================================
4+
5+
This branch contains work in progress changes for using Verilog to Routing
6+
(VTR) as part of SymbiFlow.
7+
8+
---
9+
110
# Verilog to Routing (VTR)
2-
[![Build Status](https://travis-ci.com/verilog-to-routing/vtr-verilog-to-routing.svg?branch=master)](https://travis-ci.org/verilog-to-routing/vtr-verilog-to-routing) [![Documentation Status](https://readthedocs.org/projects/vtr/badge/?version=latest)](http://docs.verilogtorouting.org/en/latest/?badge=latest)
11+
[![Build Status](https://travis-ci.com/SymbiFlow/vtr-verilog-to-routing.svg?branch=master)](https://travis-ci.com/SymbiFlow/vtr-verilog-to-routing) [![Documentation Status](https://readthedocs.org/projects/vtr/badge/?version=latest)](http://docs.verilogtorouting.org/en/latest/?badge=latest)
312

413
## Introduction
514
The Verilog-to-Routing (VTR) project is a world-wide collaborative effort to provide a open-source framework for conducting FPGA architecture and CAD research and development.

libs/EXTERNAL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ add_subdirectory(libsdcparse)
88
add_subdirectory(libblifparse)
99
add_subdirectory(libtatum)
1010

11-
#VPR_USE_EZGL is initialized in the root CMakeLists.
11+
#VPR_USE_EZGL is initialized in the root CMakeLists.
1212
#compile libezgl only if the user asks for or has its dependencies installed.
1313
if(VPR_USE_EZGL STREQUAL "on")
1414
add_subdirectory(libezgl)

libs/EXTERNAL/libsdcparse/src/sdc_lexer.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ FLOAT_EXP ([eE][-+]?{DIGIT10}+)
5656
FLOAT_NUMBER ({NAN}|([-+]?({INF}|({FLOAT_BASE}{FLOAT_EXP}?))))
5757
INT_NUMBER ([-+]?{DIGIT10}+)
5858
ALPHA [a-zA-Z_]
59-
SYMBOL [-~|:*\\/^]
60-
ID_FIRST ({ALPHA})
59+
SYMBOL [-~|:*\\/^\$\.]
60+
ID_FIRST ({ALPHA}|{SYMBOL})
6161
ID_MID ({ALPHA}|{DIGIT10}|{SYMBOL})
6262
ID_INDEX (\[{DIGIT10}+\])
6363
ID ({ID_FIRST}{ID_MID}*{ID_INDEX}?)

libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,8 @@ bool TimingGraph::validate_structure() const {
731731

732732
} else if (src_type == NodeType::CPIN) {
733733
if( sink_type != NodeType::SOURCE
734-
&& sink_type != NodeType::SINK
735-
&& sink_type != NodeType::OPIN) {
736-
throw tatum::Error("CPIN nodes should only drive SOURCE, OPIN or SINK nodes", src_node, out_edge);
734+
&& sink_type != NodeType::SINK) {
735+
throw tatum::Error("CPIN nodes should only drive SOURCE or SINK nodes", src_node, out_edge);
737736
}
738737

739738
if(sink_type == NodeType::SOURCE && out_edge_type != EdgeType::PRIMITIVE_CLOCK_LAUNCH) {

libs/libarchfpga/src/arch_util.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,3 +1321,38 @@ bool is_library_model(const char* model_name) {
13211321
bool is_library_model(const t_model* model) {
13221322
return is_library_model(model->name);
13231323
}
1324+
1325+
//Returns true if the specified block type contains the specified blif model name
1326+
bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::string& blif_model_name) {
1327+
return pb_type_contains_blif_model(type->pb_type, blif_model_name);
1328+
}
1329+
1330+
//Returns true of a pb_type (or it's children) contain the specified blif model name
1331+
bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& blif_model_name) {
1332+
if (!pb_type) {
1333+
return false;
1334+
}
1335+
1336+
if (pb_type->blif_model != nullptr) {
1337+
//Leaf pb_type
1338+
VTR_ASSERT(pb_type->num_modes == 0);
1339+
if (blif_model_name == pb_type->blif_model
1340+
|| ".subckt " + blif_model_name == pb_type->blif_model) {
1341+
return true;
1342+
} else {
1343+
return false;
1344+
}
1345+
} else {
1346+
for (int imode = 0; imode < pb_type->num_modes; ++imode) {
1347+
const t_mode* mode = &pb_type->modes[imode];
1348+
1349+
for (int ichild = 0; ichild < mode->num_pb_type_children; ++ichild) {
1350+
const t_pb_type* pb_type_child = &mode->pb_type_children[ichild];
1351+
if (pb_type_contains_blif_model(pb_type_child, blif_model_name)) {
1352+
return true;
1353+
}
1354+
}
1355+
}
1356+
}
1357+
return false;
1358+
}

libs/libarchfpga/src/arch_util.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef ARCH_UTIL_H
22
#define ARCH_UTIL_H
33

4+
#include <regex>
45
#include "physical_types.h"
56

67
class InstPort {
@@ -74,4 +75,11 @@ bool segment_exists(const t_arch* arch, std::string name);
7475
const t_segment_inf* find_segment(const t_arch* arch, std::string name);
7576
bool is_library_model(const char* model_name);
7677
bool is_library_model(const t_model* model);
78+
79+
//Returns true if the specified block type contains the specified blif model name
80+
bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::string& blif_model_name);
81+
82+
//Returns true of a pb_type (or it's children) contain the specified blif model name
83+
bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& blif_model_name);
84+
7785
#endif

libs/libarchfpga/src/physical_types.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ std::vector<int> t_physical_tile_type::get_clock_pins_indices() const {
110110
int clock_pins_start_idx = 0;
111111
int clock_pins_stop_idx = 0;
112112

113-
for (int capacity_num = 0; capacity_num < this->capacity; capacity_num++) {
113+
int num_capacity = 1;
114+
if (capacity_type == e_capacity_type::DUPLICATE) {
115+
num_capacity = this->capacity;
116+
}
117+
118+
for (int capacity_num = 0; capacity_num < num_capacity; capacity_num++) {
114119
// Ranges are picked on the basis that pins are ordered: inputs, outputs, then clock pins
115120
// This is because ProcessPb_type assigns pb_type port indices in that order and
116121
// SetupPinLocationsAndPinClasses assigns t_logical_block_type_ptr pin indices in the order of port indices

libs/libarchfpga/src/physical_types.h

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "vtr_ndmatrix.h"
4040
#include "vtr_hash.h"
4141
#include "vtr_bimap.h"
42+
#include "vtr_string_interning.h"
4243

4344
#include "logic_types.h"
4445
#include "clock_types.h"
@@ -90,31 +91,32 @@ enum class e_sb_type;
9091
// Metadata value storage.
9192
class t_metadata_value {
9293
public:
93-
explicit t_metadata_value(std::string v)
94+
explicit t_metadata_value(vtr::interned_string v)
9495
: value_(v) {}
9596
explicit t_metadata_value(const t_metadata_value& o)
9697
: value_(o.value_) {}
9798

9899
// Return string value.
99-
std::string as_string() const { return value_; }
100+
vtr::interned_string as_string() const { return value_; }
100101

101102
private:
102-
std::string value_;
103+
vtr::interned_string value_;
103104
};
104105

105106
// Metadata storage dictionary.
106-
struct t_metadata_dict : std::unordered_map<
107-
std::string,
108-
std::vector<t_metadata_value>> {
107+
struct t_metadata_dict : vtr::flat_map<
108+
vtr::interned_string,
109+
std::vector<t_metadata_value>,
110+
vtr::interned_string_less> {
109111
// Is this key present in the map?
110-
inline bool has(std::string key) const {
112+
inline bool has(vtr::interned_string key) const {
111113
return this->count(key) >= 1;
112114
}
113115

114116
// Get all metadata values matching key.
115117
//
116118
// Returns nullptr if key is not found.
117-
inline const std::vector<t_metadata_value>* get(std::string key) const {
119+
inline const std::vector<t_metadata_value>* get(vtr::interned_string key) const {
118120
auto iter = this->find(key);
119121
if (iter != this->end()) {
120122
return &iter->second;
@@ -126,7 +128,7 @@ struct t_metadata_dict : std::unordered_map<
126128
//
127129
// Returns nullptr if key is not found or if multiple values are prsent
128130
// per key.
129-
inline const t_metadata_value* one(std::string key) const {
131+
inline const t_metadata_value* one(vtr::interned_string key) const {
130132
auto values = get(key);
131133
if (values == nullptr) {
132134
return nullptr;
@@ -138,11 +140,10 @@ struct t_metadata_dict : std::unordered_map<
138140
}
139141

140142
// Adds value to key.
141-
void add(std::string key, std::string value) {
143+
void add(vtr::interned_string key, vtr::interned_string value) {
142144
// Get the iterator to the key, which may already have elements if
143145
// add was called with this key in the past.
144-
auto iter_inserted = this->emplace(key, std::vector<t_metadata_value>());
145-
iter_inserted.first->second.push_back(t_metadata_value(value));
146+
(*this)[key].emplace_back(t_metadata_value(value));
146147
}
147148
};
148149

@@ -523,6 +524,12 @@ enum class e_sb_type {
523524

524525
};
525526

527+
enum class e_capacity_type {
528+
DUPLICATE, // Capacity duplicates ports.
529+
EXPLICIT // Capacity increases the number of logical tiles, but does not
530+
// modify the physical ports.
531+
};
532+
526533
constexpr int NO_SWITCH = -1;
527534
constexpr int DEFAULT_SWITCH = -2;
528535

@@ -577,6 +584,7 @@ struct t_physical_tile_type {
577584
int num_clock_pins = 0;
578585

579586
int capacity = 0;
587+
e_capacity_type capacity_type = e_capacity_type::DUPLICATE;
580588

581589
int width = 0;
582590
int height = 0;
@@ -618,25 +626,30 @@ struct t_physical_tile_type {
618626

619627
/* Returns the indices of pins that contain a clock for this physical logic block */
620628
std::vector<int> get_clock_pins_indices() const;
629+
630+
bool is_input_type;
631+
bool is_output_type;
621632
};
622633

623634
/** A logical pin defines the pin index of a logical block type (i.e. a top level PB type)
624635
* This structure wraps the int value of the logical pin to allow its storage in the
625636
* vtr::bimap container.
626637
*/
627638
struct t_logical_pin {
639+
int z_index = -1;
628640
int pin = -1;
629641

630-
t_logical_pin(int value) {
642+
t_logical_pin(int z_index_value, int value) {
643+
z_index = z_index_value;
631644
pin = value;
632645
}
633646

634647
bool operator==(const t_logical_pin o) const {
635-
return pin == o.pin;
648+
return z_index == o.z_index && pin == o.pin;
636649
}
637650

638651
bool operator<(const t_logical_pin o) const {
639-
return pin < o.pin;
652+
return std::make_pair(z_index, pin) < std::make_pair(o.z_index, o.pin);
640653
}
641654
};
642655

@@ -1374,6 +1387,7 @@ struct t_arch_switch_inf {
13741387
float Cin = 0.;
13751388
float Cout = 0.;
13761389
float Cinternal = 0.;
1390+
float penalty_cost = 0.;
13771391
float mux_trans_size = 1.;
13781392
BufferSize buf_size_type = BufferSize::AUTO;
13791393
float buf_size = 0.;
@@ -1438,6 +1452,7 @@ struct t_rr_switch_inf {
14381452
float Cout = 0.;
14391453
float Cinternal = 0.;
14401454
float Tdel = 0.;
1455+
float penalty_cost = 0.;
14411456
float mux_trans_size = 0.;
14421457
float buf_size = 0.;
14431458
const char* name = nullptr;
@@ -1585,6 +1600,8 @@ struct t_clock_arch_spec {
15851600

15861601
/* Detailed routing architecture */
15871602
struct t_arch {
1603+
mutable vtr::string_internment strings;
1604+
15881605
char* architecture_id; //Secure hash digest of the architecture file to uniquely identify this architecture
15891606

15901607
t_chan_width_dist Chans;

0 commit comments

Comments
 (0)