Skip to content

Commit 78352e7

Browse files
Merge remote-tracking branch 'origin/master' into Yosys42
2 parents 71ffc6f + 33a82f1 commit 78352e7

File tree

13 files changed

+42
-37
lines changed

13 files changed

+42
-37
lines changed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ endif()
130130
# Build type flags
131131
#
132132

133-
set(EXTRA_FLAGS "")
134-
if(VPR_ENABLE_INTERCHANGE)
135-
set(EXTRA_FLAGS "-lz")
136-
endif()
137-
138133
if(NOT MSVC)
139134
# for GCC and Clang
140135
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
@@ -298,6 +293,7 @@ endif()
298293
#
299294
# Increased debugging vebosity
300295
#
296+
set(EXTRA_FLAGS "")
301297
if(VTR_ENABLE_VERBOSE)
302298
set(EXTRA_FLAGS "${EXTRA_FLAGS} -DVTR_ENABLE_DEBUG_LOGGING")
303299
message(STATUS "Enabling increased debugging verbosity")

libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class TimingTags {
113113
using value_type = T;
114114
using pointer = T*;
115115
using reference = T&;
116+
using const_reference = const T&;
116117

117118
Iterator(): p_(nullptr) {}
118119
Iterator(pointer p): p_(p) {}
@@ -123,7 +124,7 @@ class TimingTags {
123124
friend bool operator!=(Iterator a, Iterator b) { return a.p_ != b.p_; }
124125

125126
reference operator*() { return *p_; }
126-
const reference operator*() const { return *p_; } //Required for MSVC (gcc/clang are fine with only the non-cost version)
127+
const_reference operator*() const { return *p_; } //Required for MSVC (gcc/clang are fine with only the non-cost version)
127128
pointer operator->() { return p_; }
128129
reference operator[](size_t n) { return *(p_ + n); }
129130

libs/libvqm/vqm_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void add_node(char* type, char *name, t_array_ref **ports, t_parse_info* parse_i
559559
new_assoc->associated_net = net;
560560
new_assoc->port_index = counter;
561561
new_assoc->port_name = (char *) malloc(strlen(association->port_name)+1);
562-
strcpy(new_assoc->port_name, (char*)malloc(strlen(association->port_name)));
562+
strcpy(new_assoc->port_name, association->port_name);
563563
new_assoc->wire_index = wire_index;
564564
wire_index += change;
565565
m_ports->array_size = insert_element_at_index((intptr_t) new_assoc, m_ports, counter);

vpr/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,22 @@ endif ()
109109
set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
110110

111111
#Specify link-time dependencies
112+
find_package(ZLIB)
112113
target_link_libraries(libvpr
113-
libvtrutil
114-
libarchfpga
115-
libsdcparse
116-
libblifparse
117-
libtatum
118-
libargparse
119-
libpugixml
120-
librrgraph
114+
libvtrutil
115+
libarchfpga
116+
libsdcparse
117+
libblifparse
118+
libtatum
119+
libargparse
120+
libpugixml
121+
librrgraph
122+
ZLIB::ZLIB
121123
)
122124

123125
if(VPR_USE_SERVER)
124126
target_link_libraries(libvpr
125127
sockpp-static
126-
-lz
127128
)
128129
endif()
129130

vpr/src/base/ShowSetup.h

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

4+
#include <ostream>
5+
#include <string>
6+
#include <vector>
7+
8+
class t_logical_block_type;
9+
class t_vpr_setup;
10+
411
struct ClusteredNetlistStats {
512
private:
613
void writeHuman(std::ostream& output) const;

vpr/src/draw/draw_rr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,7 @@ void draw_get_rr_pin_coords(const t_rr_node& node, float* xcen, float* ycen, con
926926

927927
default:
928928
vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__,
929-
"in draw_get_rr_pin_coords: Unexpected side %s.\n",
930-
SIDE_STRING[pin_side]);
929+
"in draw_get_rr_pin_coords: Unexpected side.\n");
931930
break;
932931
}
933932

vpr/src/power/power.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void power_usage_primitive(t_power_usage* power_usage, t_pb* pb, t_pb_gra
138138
if (strcmp(pb_graph_node->pb_type->blif_model, MODEL_NAMES) == 0) {
139139
/* LUT */
140140

141-
char* SRAM_values;
141+
std::string SRAM_values;
142142
float* input_probabilities;
143143
float* input_densities;
144144
int LUT_size;
@@ -174,7 +174,6 @@ static void power_usage_primitive(t_power_usage* power_usage, t_pb* pb, t_pb_gra
174174
power_ctx.arch->LUT_transistor_size, SRAM_values,
175175
input_probabilities, input_densities, power_ctx.solution_inf.T_crit);
176176
power_add_usage(power_usage, &sub_power_usage);
177-
delete[] SRAM_values;
178177
delete[] input_probabilities;
179178
delete[] input_densities;
180179
} else if (strcmp(pb_graph_node->pb_type->blif_model, MODEL_LATCH) == 0) {

vpr/src/power/power_components.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/************************* INCLUDES *********************************/
2424
#include <cstring>
2525
#include <cmath>
26+
#include <string>
2627

2728
#include "vtr_math.h"
2829
#include "vtr_assert.h"
@@ -203,7 +204,7 @@ void power_usage_ff(t_power_usage* power_usage, float size, float D_prob, float
203204
* 7 _Z_|
204205
*
205206
*/
206-
void power_usage_lut(t_power_usage* power_usage, int lut_size, float transistor_size, char* SRAM_values, float* input_prob, float* input_dens, float period) {
207+
void power_usage_lut(t_power_usage* power_usage, int lut_size, float transistor_size, std::string SRAM_values, float* input_prob, float* input_dens, float period) {
207208
float** internal_prob;
208209
float** internal_dens;
209210
float** internal_v;

vpr/src/power/power_components.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define __POWER_COMPONENTS_H__
2525

2626
/************************* INCLUDES *********************************/
27+
#include <string>
2728
#include "power.h"
2829
#include "clustered_netlist.h"
2930

@@ -82,7 +83,7 @@ void power_component_add_usage(t_power_usage* power_usage,
8283
float power_component_get_usage_sum(e_power_component_type component_idx);
8384

8485
void power_usage_ff(t_power_usage* power_usage, float size, float D_prob, float D_dens, float Q_prob, float Q_dens, float clk_prob, float clk_dens, float period);
85-
void power_usage_lut(t_power_usage* power_usage, int LUT_size, float transistor_size, char* SRAM_values, float* input_densities, float* input_probabilities, float period);
86+
void power_usage_lut(t_power_usage* power_usage, int LUT_size, float transistor_size, std::string SRAM_values, float* input_densities, float* input_probabilities, float period);
8687
void power_usage_local_interc_mux(t_power_usage* power_usage, t_pb* pb, t_interconnect_pins* interc_pins, ClusterBlockId iblk);
8788
void power_usage_mux_multilevel(t_power_usage* power_usage,
8889
t_mux_arch* mux_arch,

vpr/src/power/power_util.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cstring>
2424
#include <cmath>
2525
#include <map>
26+
#include <string>
2627

2728
#include "vtr_assert.h"
2829
#include "vtr_memory.h"
@@ -211,19 +212,16 @@ float calc_buffer_stage_effort(int N, float final_stage_size) {
211212
* - LUT_size: The number of LUT inputs
212213
* - truth_table: The logic terms saved from the BLIF file
213214
*/
214-
char* alloc_SRAM_values_from_truth_table(int LUT_size,
215-
const AtomNetlist::TruthTable& truth_table) {
216-
int num_SRAM_bits = 1 << LUT_size;
215+
std::string alloc_SRAM_values_from_truth_table(int LUT_size,
216+
const AtomNetlist::TruthTable& truth_table) {
217+
size_t num_SRAM_bits = 1 << LUT_size;
217218

218219
//SRAM value stored as a string of '0' and '1' characters
219220
// Initialize to all zeros
220-
char* SRAM_values = new char[num_SRAM_bits + 1];
221-
for (int i = 0; i < num_SRAM_bits + 1; i++)
222-
SRAM_values[i] = '0';
223-
SRAM_values[num_SRAM_bits] = '\0';
221+
std::string SRAM_values(num_SRAM_bits, '0');
224222

225223
if (truth_table.empty()) {
226-
for (int i = 0; i < num_SRAM_bits; i++) {
224+
for (size_t i = 0; i < num_SRAM_bits; i++) {
227225
SRAM_values[i] = '1';
228226
}
229227
return SRAM_values;
@@ -237,7 +235,7 @@ char* alloc_SRAM_values_from_truth_table(int LUT_size,
237235
if (truth_table[0].size() == 1) {
238236
if (truth_table[0][0] == vtr::LogicValue::TRUE) {
239237
//Mark all the SRAM values as ON
240-
for (int i = 0; i < num_SRAM_bits; i++) {
238+
for (size_t i = 0; i < num_SRAM_bits; i++) {
241239
SRAM_values[i] = '1';
242240
}
243241
return SRAM_values;
@@ -250,7 +248,7 @@ char* alloc_SRAM_values_from_truth_table(int LUT_size,
250248
auto expanded_truth_table = expand_truth_table(truth_table, LUT_size);
251249
std::vector<vtr::LogicValue> lut_mask = truth_table_to_lut_mask(expanded_truth_table, LUT_size);
252250

253-
VTR_ASSERT(lut_mask.size() == (size_t)num_SRAM_bits);
251+
VTR_ASSERT(lut_mask.size() == num_SRAM_bits);
254252

255253
//Convert to string
256254
for (size_t i = 0; i < lut_mask.size(); ++i) {

vpr/src/power/power_util.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define __POWER_UTIL_H__
2424

2525
/************************* INCLUDES *********************************/
26+
#include <string>
2627
#include "power.h"
2728
#include "power_components.h"
2829
#include "atom_netlist.h"
@@ -63,8 +64,8 @@ bool power_method_is_transistor_level(e_power_estimation_method estimation_metho
6364
bool power_method_is_recursive(e_power_estimation_method method);
6465

6566
const char* transistor_type_name(e_tx_type type);
66-
char* alloc_SRAM_values_from_truth_table(int LUT_size,
67-
const AtomNetlist::TruthTable& truth_table);
67+
std::string alloc_SRAM_values_from_truth_table(int LUT_size,
68+
const AtomNetlist::TruthTable& truth_table);
6869
float clb_net_density(ClusterNetId net_idx);
6970
const char* interconnect_type_name(enum e_interconnect type);
7071
float clb_net_prob(ClusterNetId net_idx);

vpr/src/route/route_path_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct t_heap_path {
2828
};
2929

3030
// Forward declaration of RoutingContext needed for traceback insertion
31-
class RoutingContext;
31+
struct RoutingContext;
3232

3333
/* A class to manage the extra data required for RCV
3434
* It manages a set containing all the nodes that currently exist in the route tree
@@ -117,4 +117,4 @@ class PathManager {
117117
std::set<RRNodeId> route_tree_nodes_;
118118
};
119119

120-
#endif
120+
#endif

vpr/test/test_post_verilog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "timing_place_lookup.h"
55

66
#include <fstream>
7+
#include <memory>
78

89
namespace {
910

@@ -87,7 +88,7 @@ void copy_file(const std::string& src_fname, const std::string& dst_fname) {
8788
size_t size = src_file.tellg();
8889
src_file.seekg(0, std::ios_base::beg);
8990

90-
auto buf = std::unique_ptr<uint8_t>(new uint8_t[size]);
91+
auto buf = std::make_unique<uint8_t[]>(size);
9192
src_file.read((char*)buf.get(), size);
9293
dst_file.write((char*)buf.get(), size);
9394
}

0 commit comments

Comments
 (0)