Skip to content

Commit 77cf5fa

Browse files
enum class e_stat
1 parent 488684e commit 77cf5fa

File tree

8 files changed

+31
-30
lines changed

8 files changed

+31
-30
lines changed

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,25 +123,25 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
123123
fprintf(Echo, "\tChannel Width Distribution:\n");
124124

125125
switch (arch->Chans.chan_x_dist.type) {
126-
case (UNIFORM):
126+
case e_stat::UNIFORM:
127127
fprintf(Echo, "\t\tx: type uniform peak %e\n",
128128
arch->Chans.chan_x_dist.peak);
129129
break;
130-
case (GAUSSIAN):
130+
case e_stat::GAUSSIAN:
131131
fprintf(Echo,
132132
"\t\tx: type gaussian peak %e \
133133
width %e Xpeak %e dc %e\n",
134134
arch->Chans.chan_x_dist.peak, arch->Chans.chan_x_dist.width,
135135
arch->Chans.chan_x_dist.xpeak, arch->Chans.chan_x_dist.dc);
136136
break;
137-
case (PULSE):
137+
case e_stat::PULSE:
138138
fprintf(Echo,
139139
"\t\tx: type pulse peak %e \
140140
width %e Xpeak %e dc %e\n",
141141
arch->Chans.chan_x_dist.peak, arch->Chans.chan_x_dist.width,
142142
arch->Chans.chan_x_dist.xpeak, arch->Chans.chan_x_dist.dc);
143143
break;
144-
case (DELTA):
144+
case e_stat::DELTA:
145145
fprintf(Echo,
146146
"\t\tx: distr dleta peak %e \
147147
Xpeak %e dc %e\n",
@@ -154,25 +154,25 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
154154
}
155155

156156
switch (arch->Chans.chan_y_dist.type) {
157-
case (UNIFORM):
157+
case e_stat::UNIFORM:
158158
fprintf(Echo, "\t\ty: type uniform peak %e\n",
159159
arch->Chans.chan_y_dist.peak);
160160
break;
161-
case (GAUSSIAN):
161+
case e_stat::GAUSSIAN:
162162
fprintf(Echo,
163163
"\t\ty: type gaussian peak %e \
164164
width %e Xpeak %e dc %e\n",
165165
arch->Chans.chan_y_dist.peak, arch->Chans.chan_y_dist.width,
166166
arch->Chans.chan_y_dist.xpeak, arch->Chans.chan_y_dist.dc);
167167
break;
168-
case (PULSE):
168+
case e_stat::PULSE:
169169
fprintf(Echo,
170170
"\t\ty: type pulse peak %e \
171171
width %e Xpeak %e dc %e\n",
172172
arch->Chans.chan_y_dist.peak, arch->Chans.chan_y_dist.width,
173173
arch->Chans.chan_y_dist.xpeak, arch->Chans.chan_y_dist.dc);
174174
break;
175-
case (DELTA):
175+
case e_stat::DELTA:
176176
fprintf(Echo,
177177
"\t\ty: distr dleta peak %e \
178178
Xpeak %e dc %e\n",

libs/libarchfpga/src/physical_types.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,14 +1535,15 @@ struct t_pb_graph_pin_power {
15351535
/* Description of routing channel distribution across the FPGA, only available for global routing
15361536
* Width is standard dev. for Gaussian. xpeak is where peak *
15371537
* occurs. dc is the dc offset for Gaussian and pulse waveforms. */
1538-
enum e_stat {
1538+
enum class e_stat {
15391539
UNIFORM,
15401540
GAUSSIAN,
15411541
PULSE,
15421542
DELTA
15431543
};
1544+
15441545
struct t_chan {
1545-
enum e_stat type;
1546+
e_stat type;
15461547
float peak;
15471548
float width;
15481549
float xpeak;

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,12 +2317,12 @@ struct ArchReader {
23172317
arch_->R_minW_nmos = 6065.520020;
23182318
arch_->R_minW_pmos = 18138.500000;
23192319
arch_->grid_logic_tile_area = 14813.392;
2320-
arch_->Chans.chan_x_dist.type = UNIFORM;
2320+
arch_->Chans.chan_x_dist.type = e_stat::UNIFORM;
23212321
arch_->Chans.chan_x_dist.peak = 1;
23222322
arch_->Chans.chan_x_dist.width = 0;
23232323
arch_->Chans.chan_x_dist.xpeak = 0;
23242324
arch_->Chans.chan_x_dist.dc = 0;
2325-
arch_->Chans.chan_y_dist.type = UNIFORM;
2325+
arch_->Chans.chan_y_dist.type = e_stat::UNIFORM;
23262326
arch_->Chans.chan_y_dist.peak = 1;
23272327
arch_->Chans.chan_y_dist.width = 0;
23282328
arch_->Chans.chan_y_dist.xpeak = 0;

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,16 +3033,16 @@ static void process_chan_width_distr_dir(pugi::xml_node Node, t_chan* chan, cons
30333033

30343034
Prop = get_attribute(Node, "distr", loc_data).value();
30353035
if (strcmp(Prop, "uniform") == 0) {
3036-
chan->type = UNIFORM;
3036+
chan->type = e_stat::UNIFORM;
30373037
} else if (strcmp(Prop, "gaussian") == 0) {
3038-
chan->type = GAUSSIAN;
3038+
chan->type = e_stat::GAUSSIAN;
30393039
hasXpeak = hasWidth = hasDc = ReqOpt::REQUIRED;
30403040
} else if (strcmp(Prop, "pulse") == 0) {
3041-
chan->type = PULSE;
3041+
chan->type = e_stat::PULSE;
30423042
hasXpeak = hasWidth = hasDc = ReqOpt::REQUIRED;
30433043
} else if (strcmp(Prop, "delta") == 0) {
30443044
hasXpeak = hasDc = ReqOpt::REQUIRED;
3045-
chan->type = DELTA;
3045+
chan->type = e_stat::DELTA;
30463046
} else {
30473047
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Node),
30483048
vtr::string_fmt("Unknown property %s for chan_width_distr x\n", Prop).c_str());

libs/librtlnumber/src/include/internal_bits.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ constexpr short integer_t_size = (sizeof(integer_t) * 8);
2727
}
2828

2929
#define unroll_1d(lut) \
30-
{ lut[_0], lut[_1], lut[_x], lut[_z] }
30+
{lut[_0], lut[_1], lut[_x], lut[_z]}
3131
#define unroll_2d(lut) \
32-
{ unroll_1d(lut[_0]), unroll_1d(lut[_1]), unroll_1d(lut[_x]), unroll_1d(lut[_z]) }
32+
{unroll_1d(lut[_0]), unroll_1d(lut[_1]), unroll_1d(lut[_x]), unroll_1d(lut[_z])}
3333

3434
#define unroll_1d_invert(lut) \
35-
{ l_not[lut[_0]], l_not[lut[_1]], l_not[lut[_x]], l_not[lut[_z]] }
35+
{l_not[lut[_0]], l_not[lut[_1]], l_not[lut[_x]], l_not[lut[_z]]}
3636
#define unroll_2d_invert(lut) \
37-
{ unroll_1d_invert(lut[_0]), unroll_1d_invert(lut[_1]), unroll_1d_invert(lut[_x]), unroll_1d_invert(lut[_z]) }
37+
{unroll_1d_invert(lut[_0]), unroll_1d_invert(lut[_1]), unroll_1d_invert(lut[_x]), unroll_1d_invert(lut[_z])}
3838

3939
namespace BitSpace {
4040
typedef uint8_t bit_value_t;

vpr/src/base/CheckSetup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void CheckSetup(const t_packer_opts& packer_opts,
112112
}
113113

114114
if (e_route_type::DETAILED == router_opts.route_type) {
115-
if ((chans.chan_x_dist.type != UNIFORM)
116-
|| (chans.chan_y_dist.type != UNIFORM)) {
115+
if ((chans.chan_x_dist.type != e_stat::UNIFORM)
116+
|| (chans.chan_y_dist.type != e_stat::UNIFORM)) {
117117
VPR_FATAL_ERROR(VPR_ERROR_OTHER,
118118
"Detailed routing currently only supported on FPGAs with uniform channel distributions.\n");
119119
}

vpr/src/base/place_and_route.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,18 +543,18 @@ static float comp_width(t_chan* chan, float x, float separation) {
543543
float val;
544544

545545
switch (chan->type) {
546-
case UNIFORM:
546+
case e_stat::UNIFORM:
547547
val = chan->peak;
548548
break;
549549

550-
case GAUSSIAN:
550+
case e_stat::GAUSSIAN:
551551
val = (x - chan->xpeak) * (x - chan->xpeak)
552552
/ (2 * chan->width * chan->width);
553553
val = chan->peak * exp(-val);
554554
val += chan->dc;
555555
break;
556556

557-
case PULSE:
557+
case e_stat::PULSE:
558558
val = (float)fabs((double)(x - chan->xpeak));
559559
if (val > chan->width / 2.) {
560560
val = 0;
@@ -564,7 +564,7 @@ static float comp_width(t_chan* chan, float x, float separation) {
564564
val += chan->dc;
565565
break;
566566

567-
case DELTA:
567+
case e_stat::DELTA:
568568
val = x - chan->xpeak;
569569
if (val > -separation / 2. && val <= separation / 2.)
570570
val = chan->peak;

vpr/src/route/rr_graph_generation/rr_graph_switch_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ void load_rr_switch_from_arch_switch(RRGraphBuilder& rr_graph_builder,
105105
rr_graph_builder.rr_switch()[RRSwitchId(rr_switch_idx)].Cout = arch_sw_inf.at(arch_switch_idx).Cout;
106106
rr_graph_builder.rr_switch()[RRSwitchId(rr_switch_idx)].Tdel = rr_switch_Tdel;
107107
rr_graph_builder.rr_switch()[RRSwitchId(rr_switch_idx)].mux_trans_size = arch_sw_inf.at(arch_switch_idx).mux_trans_size;
108-
if (arch_sw_inf.at(arch_switch_idx).buf_size_type == BufferSize::AUTO) {
108+
if (arch_sw_inf.at(arch_switch_idx).buf_size_type == e_buffer_size::AUTO) {
109109
// Size based on resistance
110110
rr_graph_builder.rr_switch()[RRSwitchId(rr_switch_idx)].buf_size = trans_per_buf(arch_sw_inf.at(arch_switch_idx).R, R_minW_nmos, R_minW_pmos);
111111
} else {
112-
VTR_ASSERT(arch_sw_inf.at(arch_switch_idx).buf_size_type == BufferSize::ABSOLUTE);
112+
VTR_ASSERT(arch_sw_inf.at(arch_switch_idx).buf_size_type == e_buffer_size::ABSOLUTE);
113113
// Use the specified size
114114
rr_graph_builder.rr_switch()[RRSwitchId(rr_switch_idx)].buf_size = arch_sw_inf.at(arch_switch_idx).buf_size;
115115
}
@@ -134,11 +134,11 @@ t_rr_switch_inf create_rr_switch_from_arch_switch(const t_arch_switch_inf& arch_
134134
rr_switch_inf.Cout = arch_sw_inf.Cout;
135135
rr_switch_inf.Tdel = rr_switch_Tdel;
136136
rr_switch_inf.mux_trans_size = arch_sw_inf.mux_trans_size;
137-
if (arch_sw_inf.buf_size_type == BufferSize::AUTO) {
137+
if (arch_sw_inf.buf_size_type == e_buffer_size::AUTO) {
138138
// Size based on resistance
139139
rr_switch_inf.buf_size = trans_per_buf(arch_sw_inf.R, R_minW_nmos, R_minW_pmos);
140140
} else {
141-
VTR_ASSERT(arch_sw_inf.buf_size_type == BufferSize::ABSOLUTE);
141+
VTR_ASSERT(arch_sw_inf.buf_size_type == e_buffer_size::ABSOLUTE);
142142
// Use the specified size
143143
rr_switch_inf.buf_size = arch_sw_inf.buf_size;
144144
}

0 commit comments

Comments
 (0)