Skip to content

Clock modeling 2 #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
0410e62
Added the VPR option for modeling clocks to the router options
mustafabbas Apr 30, 2018
b586169
Connected clock pins to general routing depending on VPR option
mustafabbas Apr 30, 2018
b0d4c64
Passed parameter to route clocks in the timing driven router
mustafabbas May 2, 2018
e55dee6
Matched the router and timing analyzer net delay for global nets
mustafabbas May 9, 2018
a6c0fd6
Reverted commits that routed the clock using general routing
mustafabbas May 27, 2018
cc7a27c
Added an option to route clock nets through a dedicated clock network
mustafabbas Jun 4, 2018
36bb832
Added clock_modeling_method to router options
mustafabbas Jun 4, 2018
5558d20
Added a StrongId for t_rr_node
mustafabbas Jun 13, 2018
9c8ab0d
Fix: rename change that caused a merge conflict
mustafabbas Jun 28, 2018
34dc89a
Passed clock modeling router option to rr_graph generation code
mustafabbas Jun 28, 2018
992ab30
Simple Star clock model (code resused from other parts in the code base)
mustafabbas Jul 19, 2018
de4c718
skeleton of clock network generation code
mustafabbas Sep 6, 2018
5105760
Added Spine and Rib wires rr_node generation code
mustafabbas Sep 11, 2018
cc25946
Added drive point node and started clock switch generation
mustafabbas Sep 15, 2018
49c7747
Moved clock network base class and its children to a sperate file
mustafabbas Sep 15, 2018
96f67e7
Added Switchs into reverse lookup
mustafabbas Sep 17, 2018
10f5a43
Added skelton of clock edge creation
mustafabbas Sep 19, 2018
217d366
Added clock network switches
mustafabbas Sep 23, 2018
c9c4bd9
Added missing information in clock rr nodes
mustafabbas Sep 26, 2018
11f15af
Allowed clock to be routable (still needs fixing)
mustafabbas Sep 27, 2018
1fb4c90
Added boundry checks for clock wires and adjusted ptc num calculation
mustafabbas Sep 28, 2018
ab1e441
Added support to draw edges for zero length wires in an unconventiona…
mustafabbas Sep 28, 2018
d5eb144
Better way to get ptc num for clock
mustafabbas Sep 29, 2018
b17afb7
Revert "Allowed clock to be routable (still needs fixing)"
mustafabbas Sep 30, 2018
cf66303
Safer way to acess is_global pin array in treat_clock_pins_as_non_glo…
mustafabbas Sep 30, 2018
d6ff779
Made clock nets routable with dedicated clock network
mustafabbas Sep 30, 2018
1636472
used a safer function to set ptc_num
mustafabbas Sep 30, 2018
22a1610
Code cleanup for clock to pin create_switches()
mustafabbas Oct 1, 2018
3ed093b
Changed rr_indexed_data from array to vector
mustafabbas Oct 1, 2018
037a937
Fixed mistake when selecting when to treat clock pins as global
mustafabbas Oct 1, 2018
43b7425
Added missing direction attribute value to clock rr_nodes
mustafabbas Oct 1, 2018
75d85ca
Adjusted drawing leave enough space for channel width
mustafabbas Oct 1, 2018
a30b19f
refractored alloc_and_load_rr_index_data to make it easier to use for…
mustafabbas Oct 2, 2018
dd99cb7
Added assert and modified load rr index data function to be more flex…
mustafabbas Oct 3, 2018
77e086c
Changed segment_inf array to vector
mustafabbas Oct 3, 2018
01bc66e
modified load rr index data function to be more flexible
mustafabbas Oct 3, 2018
2349795
Ensure that ortho_cost_index does not go out of bounds
mustafabbas Oct 3, 2018
b98c56b
removed nun_seg and used segment_inf.size() instead
mustafabbas Oct 3, 2018
59ac675
Revert "Added suppport to draw edges for zero lenght wires"
mustafabbas Oct 4, 2018
b3d1425
Added seg_index class variable to rr_node and set it in rr_graph.cpp
mustafabbas Oct 4, 2018
df35875
Fixed routing issue for clocks by reseting the seed per function call
mustafabbas Oct 5, 2018
634d24d
Parsed clock network into intermediate data types
mustafabbas Oct 10, 2018
ec8dab7
minor comment fixes
mustafabbas Oct 10, 2018
fefac09
moved data from arch to new clock networks vector in vpr context
mustafabbas Oct 11, 2018
3235405
Added parsing for clock connections
mustafabbas Oct 11, 2018
1855561
Addjusted boundry conditions for clock creation
mustafabbas Oct 13, 2018
7c0448d
Made rr_switch_inf into a vector
mustafabbas Oct 14, 2018
cab6036
Moved call to create clock nodes into create_rr_graph
mustafabbas Oct 14, 2018
3bbc2b3
Added clock switches to rr_switches
mustafabbas Oct 14, 2018
ec50220
Added function to set the cost index based on the seg index
mustafabbas Oct 14, 2018
6721fc2
Added clock segments
mustafabbas Oct 15, 2018
2e3bc39
Reverted modifications made to rr_graph_indexed_data
mustafabbas Oct 15, 2018
8e2ef4e
Changed pointer types in segment_inf to vector types
mustafabbas Oct 16, 2018
ecdca5e
Changed char* to string in t_segment_inf
mustafabbas Oct 16, 2018
7d9aed1
Added a check to skip connecting clock pins to clock networks if a bl…
mustafabbas Oct 16, 2018
29d7ae0
Added basic clock arrchitecture example
mustafabbas Oct 16, 2018
e40a0be
Eddited the drive buffer to be sized according to the regular routing…
mustafabbas Oct 17, 2018
fde6a79
Renamed is_global_pin flag to is_ignored_pin
mustafabbas Oct 17, 2018
d2d6024
Renamed is_global_net to is_ignored_net
mustafabbas Oct 17, 2018
b3ff343
Removed unused create_start_model function in rr_graph_clock
mustafabbas Oct 17, 2018
d1655d3
Added a is_pin_global flag and used it to mark nets as global
mustafabbas Oct 17, 2018
1cc850d
Ignore high fanout bounding box if routing a global net
mustafabbas Oct 17, 2018
ea44e95
Added missing c_str_conversion for printing segments
mustafabbas Oct 18, 2018
c1fe45b
Added missing c_str conversion for printing metal layers
mustafabbas Oct 18, 2018
f938a50
Added missing c_str conversion for printing clock errors
mustafabbas Oct 18, 2018
c23cf60
Added missing c_str conversion for printing segments rr_graph.cpp
mustafabbas Oct 18, 2018
51743c0
vpr: Avoid access to invalid segment
kmurray Nov 26, 2018
3e95697
vtr_flow/arch: Added a second clock instance to the rib and spine clo…
mustafabbas Dec 26, 2018
9d660bd
vtr_flow: Added a clock arch with a rib and spine clock network where…
mustafabbas Dec 26, 2018
605cc5a
Fixed warning about unsigned vs signed comparison
mustafabbas Dec 29, 2018
1a6d5ff
merge branch master
mustafabbas Dec 30, 2018
17dbb03
Merge branch 'master' into clock_modeling_2
mustafabbas Dec 30, 2018
da830a1
Clock Modeling:commenting on how the ptc num is requested and updated
mustafabbas Jan 11, 2019
2788ef1
Clock Modeling: Renamed ClockRRGraph class to ClockRRGraphBuilder
mustafabbas Jan 11, 2019
0af6e69
Clock Modeling: Adding comments to clock_name_to_switch_points map he…
mustafabbas Jan 11, 2019
fd19ade
Clock Modeling: Adding comments to SwitchPoint classes used to store …
mustafabbas Jan 11, 2019
ae598ae
Clock Modeling: Renamed switch_name to switchpoint_name to be consist…
mustafabbas Jan 11, 2019
69d6e5d
Clock Modeling: Adding comments for how to use SwitchPoint class
mustafabbas Jan 11, 2019
17ca1c3
Clock Modeling: Clarifing boundry conditions
mustafabbas Jan 11, 2019
31b4324
Clock Modeling: Fixing comment on wire creating above and below the d…
mustafabbas Jan 11, 2019
46646e1
Clock Modeling: Adding a comment to explain why tap locations are rec…
mustafabbas Jan 11, 2019
d81fa06
Clock Modeling: Renamed function for creating clock wires to clearly …
mustafabbas Jan 11, 2019
ebc701d
Clock Modeling: Adding disclaimer to set_cost_index for which the act…
mustafabbas Jan 11, 2019
b9994cd
Clock Modeling: Inserting a comment relating to unused segment_inf data
mustafabbas Jan 11, 2019
0fe65b1
Clock Modeling: Adding a highlevel comment to ClockRRGraphBuilder bui…
mustafabbas Jan 11, 2019
a901810
Clock Modeling: Removing unused function get_connection_type
mustafabbas Jan 11, 2019
0fb8448
Clock Modeling: Removed commented out code
mustafabbas Jan 11, 2019
efbd439
Clock Modeling: renamed switch_name to switch_point_name
mustafabbas Jan 24, 2019
71844b5
Clock Modeling: Renamed switch_index to rr_switch_index
mustafabbas Jan 24, 2019
247e951
Clock Modeling: Created a variable to describe the number of inter bl…
mustafabbas Jan 24, 2019
3b23176
Clock Modeling: Removed functions in RoutingToClockConnection class a…
mustafabbas Jan 25, 2019
869b7ca
Clock Modeling: Renamed indices to rr_node_indices
mustafabbas Jan 25, 2019
61aa34a
Clock Modeling: Adding comments to explain how clock to clock connect…
mustafabbas Jan 25, 2019
816485d
Clock Modeling: Added comment describing the limitaions of the ClockT…
mustafabbas Jan 25, 2019
786075f
Clock Modeling: Better naming in ClockToPinConnection class
mustafabbas Jan 25, 2019
26c94a6
Clock Modeling: Commenting function in ClockRRGraphBuilder
mustafabbas Jan 25, 2019
72a2f38
Clock Modeling: Added comment to clarify add_rr_switches_and_map_to_n…
mustafabbas Jan 25, 2019
fc0922b
Merge branch 'master' into clock_modeling_2
mustafabbas Feb 15, 2019
6e38548
Clock Modeling: Renamed switch to switchPoints
mustafabbas Feb 15, 2019
1c6deeb
Clock Modeling: Renamed clockConnection to clockRouting
mustafabbas Feb 15, 2019
df78a62
Clock Modeling: Changed dynamic casts to make_unique and move
mustafabbas Feb 15, 2019
7bf127f
Clock Modeling: Replaced repeated split function with the one in vtr_…
mustafabbas Feb 15, 2019
0a170ad
Clock Modeling: Capitalized special values 'clock' and 'routing' in c…
mustafabbas Feb 15, 2019
bb1041e
Clock Modeling: Added comment to clarify what setup_clock_network_wir…
mustafabbas Feb 15, 2019
4915283
Clock Modeling: Renamed buffer to switch_name in the clock arch descr…
mustafabbas Feb 18, 2019
c58e5e8
Clock Modeling: Renamed file clock_{network|connection}_types files t…
mustafabbas Feb 19, 2019
7e5c49c
Clock Modeling: Added expect_only_children() and expect_only_attribut…
mustafabbas Feb 19, 2019
754656c
Clock Modeling: Grouping clock related data types
mustafabbas Feb 25, 2019
a16d529
Merge branch 'master' into clock_modeling_2
mustafabbas Feb 25, 2019
5c0bde0
Clock Modeling: Made repeatx and repeaty optional for clock networks …
mustafabbas Feb 25, 2019
a31813c
Clock Modeling: Refactored load_rr_switch_inf for code reuse
mustafabbas Feb 25, 2019
e7ea3e1
Clock Modeling: Removing seg index from rr_nodes
mustafabbas Mar 8, 2019
7425a53
Merge branch 'master' into clock_modeling_2
mustafabbas Mar 8, 2019
2794983
Renaming is_global_net to net_is_global
mustafabbas Mar 8, 2019
4a5867c
Clock Modeling: Adding Regression test for dedicated clock
mustafabbas Mar 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions libs/libarchfpga/src/arch_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ void free_arch(t_arch* arch) {
}
delete[] arch->Switches;
arch->Switches = nullptr;
for (int i = 0; i < arch->num_segments; ++i) {
vtr::free(arch->Segments[i].cb);
arch->Segments[i].cb = nullptr;
vtr::free(arch->Segments[i].sb);
arch->Segments[i].sb = nullptr;
vtr::free(arch->Segments[i].name);
arch->Segments[i].name = nullptr;
}
vtr::free(arch->Segments);
t_model *model = arch->models;
while (model) {
t_model_ports *input_port = model->inputs;
Expand Down Expand Up @@ -149,7 +140,8 @@ void free_type_descriptors(t_type_descriptor* type_descriptors, int num_type_des
vtr::free(type_descriptors[i].class_inf[j].pinlist);
}
vtr::free(type_descriptors[i].class_inf);
vtr::free(type_descriptors[i].is_global_pin);
vtr::free(type_descriptors[i].is_ignored_pin);
vtr::free(type_descriptors[i].is_pin_global);
vtr::free(type_descriptors[i].pin_class);

free_pb_type(type_descriptors[i].pb_type);
Expand Down Expand Up @@ -420,7 +412,7 @@ void SetupEmptyType(t_type_descriptor* cb_type_descriptors,
type->num_class = 0;
type->class_inf = nullptr;
type->pin_class = nullptr;
type->is_global_pin = nullptr;
type->is_ignored_pin = nullptr;
type->pb_type = nullptr;
type->area = UNDEFINED;
type->switchblock_locations = vtr::Matrix<e_sb_type>({{size_t(type->width), size_t(type->height)}}, e_sb_type::FULL);
Expand Down Expand Up @@ -1230,10 +1222,10 @@ void primitives_annotation_clock_match(
}


t_segment_inf* find_segment(const t_arch* arch, std::string name) {
const t_segment_inf* find_segment(const t_arch* arch, std::string name) {

for (int i = 0; i < arch->num_segments; ++i) {
t_segment_inf* seg = &arch->Segments[i];
for (size_t i = 0; i < (arch->Segments).size(); ++i) {
const t_segment_inf* seg = &arch->Segments[i];
if (seg->name == name) {
return seg;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/arch_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void primitives_annotation_clock_match(
t_pin_to_pin_annotation *annotation, t_pb_type * parent_pb_type);

bool segment_exists(const t_arch* arch, std::string name);
t_segment_inf* find_segment(const t_arch* arch, std::string name);
const t_segment_inf* find_segment(const t_arch* arch, std::string name);
bool is_library_model(const char* model_name);
bool is_library_model(const t_model* model);
#endif
64 changes: 64 additions & 0 deletions libs/libarchfpga/src/clock_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#ifndef CLOCK_TYPES_H
#define CLOCK_TYPES_H

#include <string>
#include <vector>

enum class e_clock_type {
SPINE,
RIB,
H_TREE
};

struct t_metal_layer {
float r_metal;
float c_metal;
};

struct t_wire_repeat {
std::string x;
std::string y;
};

struct t_wire {
std::string start;
std::string end;
std::string position;
};

struct t_clock_drive {
std::string name;
std::string offset;
int arch_switch_idx;
};

struct t_clock_taps {
std::string name;
std::string offset;
std::string increment;
};

struct t_clock_network_arch {
std::string name;
int num_inst;

e_clock_type type;

std::string metal_layer;
t_wire wire;
t_wire_repeat repeat;
t_clock_drive drive;
t_clock_taps tap;
};

struct t_clock_connection_arch {
std::string from;
std::string to;
int arch_switch_idx;
std::string locationx;
std::string locationy;
float fc;
};

#endif

8 changes: 4 additions & 4 deletions libs/libarchfpga/src/echo_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void EchoArch(const char *EchoFile, const t_type_descriptor* Types,
VTR_ASSERT(false);
}
fprintf(Echo, " fc_value: %f", fc_spec.fc_value);
fprintf(Echo, " segment: %s", arch->Segments[fc_spec.seg_index].name);
fprintf(Echo, " segment: %s", arch->Segments[fc_spec.seg_index].name.c_str());
fprintf(Echo, " pins:");
for (int pin : fc_spec.pins) {
fprintf(Echo, " %d", pin);
Expand Down Expand Up @@ -249,7 +249,7 @@ void PrintArchInfo(FILE * Echo, const t_arch *arch) {
//Segment List
fprintf(Echo, "*************************************************\n");
fprintf(Echo, "Segment List:\n");
for (i = 0; i < arch->num_segments; i++) {
for (i = 0; i < (int)(arch->Segments).size(); i++) {
struct t_segment_inf seg = arch->Segments[i];
fprintf(Echo,
"\tSegment[%d]: frequency %d length %d R_metal %e C_metal %e\n",
Expand All @@ -267,7 +267,7 @@ void PrintArchInfo(FILE * Echo, const t_arch *arch) {
}

fprintf(Echo, "\t\t\t\tcb ");
for (j = 0; j < seg.cb_len; j++) {
for (j = 0; j < (int)seg.cb.size(); j++) {
if (seg.cb[j]) {
fprintf(Echo, "1 ");
} else {
Expand All @@ -277,7 +277,7 @@ void PrintArchInfo(FILE * Echo, const t_arch *arch) {
fprintf(Echo, "\n");

fprintf(Echo, "\t\t\t\tsb ");
for (j = 0; j < seg.sb_len; j++) {
for (j = 0; j < (int)seg.sb.size(); j++) {
if (seg.sb[j]) {
fprintf(Echo, "1 ");
} else {
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/physical_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static e_directionality switch_type_directionaity(SwitchType type) {
* t_type_descriptor
*/

std::vector<int> t_type_descriptor::get_clock_pins_indices () {
std::vector<int> t_type_descriptor::get_clock_pins_indices () const {

VTR_ASSERT(this->pb_type); // assert not a nullptr

Expand Down
33 changes: 22 additions & 11 deletions libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@

#include <functional>
#include <vector>
#include <unordered_map>
#include <string>
#include <map>
#include <limits>

#include "vtr_ndmatrix.h"

#include "logic_types.h"
#include "clock_types.h"

//Forward declarations
struct t_clock_arch;
Expand Down Expand Up @@ -434,7 +436,12 @@ constexpr int DEFAULT_SWITCH = -2;
* pin_avg_width_offset: Average width offset to specified pin (exact if only a single physical pin instance)
* pin_avg_height_offset: Average height offset to specified pin (exact if only a single physical pin instance)
* pin_class: The class a pin belongs to
* is_global_pin: Whether or not a pin is global (hence not routed)
* is_ignored_pin: Whether or not a pin is ignored durring rr_graph generation and routing.
* This is usually the case for clock pins and other global pins unless the
* clock_modeling option is set to route the clock through regular inter-block
* wiring or through a dedicated clock network.
* is_pin_global: Whether or not this pin is marked as global. Clock pins and other specified
* global pins in the architecture file are marked as global.
*
* fc_specs: The Fc specifications for all pins
*
Expand Down Expand Up @@ -475,7 +482,8 @@ struct t_type_descriptor /* TODO rename this. maybe physical type descriptor or
std::vector<int> pin_width_offset; //[0..num_pins-1]
std::vector<int> pin_height_offset; //[0..num_pins-1]
int *pin_class = nullptr; /* [0..num_pins-1] */
bool *is_global_pin = nullptr; /* [0..num_pins-1] */
bool *is_ignored_pin = nullptr; /* [0..num_pins-1] */
bool *is_pin_global = nullptr; /* [0..num_pins -1] */

std::vector<t_fc_specification> fc_specs;

Expand All @@ -495,7 +503,7 @@ struct t_type_descriptor /* TODO rename this. maybe physical type descriptor or
int index = -1; /* index of type descriptor in array (allows for index referencing) */

/* Returns the indices of pins that contain a clock for this physical logic block */
std::vector<int> get_clock_pins_indices();
std::vector<int> get_clock_pins_indices() const;

};
typedef const t_type_descriptor* t_type_ptr;
Expand Down Expand Up @@ -1006,7 +1014,7 @@ enum e_Fc_type {
* (UDSD by AY) drivers: How do signals driving a routing track connect to *
* the track? */
struct t_segment_inf {
char *name;
std::string name;
int frequency;
int length;
short arch_wire_switch;
Expand All @@ -1017,10 +1025,8 @@ struct t_segment_inf {
float Rmetal;
float Cmetal;
enum e_directionality directionality;
bool *cb;
int cb_len;
bool *sb;
int sb_len;
std::vector<bool> cb;
std::vector<bool> sb;
//float Cmetal_per_m; /* Wire capacitance (per meter) */
};

Expand Down Expand Up @@ -1274,9 +1280,8 @@ struct t_arch {
float R_minW_pmos;
int Fs;
float grid_logic_tile_area;
t_segment_inf * Segments;
int num_segments;
t_arch_switch_inf *Switches;
std::vector<t_segment_inf> Segments;
t_arch_switch_inf *Switches;
int num_switches;
t_direct_inf *Directs;
int num_directs;
Expand All @@ -1291,6 +1296,12 @@ struct t_arch {
std::string ipin_cblock_switch_name;

std::vector<t_grid_def> grid_layouts; //Set of potential device layouts

// Clock related data types
std::vector<t_clock_network_arch> clock_networks_arch;
std::unordered_map<std::string, t_metal_layer> clock_metal_layers;
std::vector<t_clock_connection_arch> clock_connections_arch;

};

#endif
Loading