Skip to content

Commit b2697ff

Browse files
[CAPNPROTO] Cleaned Up Lookahead IFDEFs
Instead of having two implementations of the same functions, it is cleaner and would prevent regressions if there was a single implementation with IFDEFs inside of it. Combined the implementations of the ExtendedMapLookaead's read and write methods.
1 parent ad2a404 commit b2697ff

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

vpr/src/route/router_lookahead_extended_map.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -604,26 +604,25 @@ float ExtendedMapLookahead::get_expected_cost(
604604
}
605605
}
606606

607-
#ifndef VTR_ENABLE_CAPNPROTO
608-
609-
void ExtendedMapLookahead::read(const std::string& /*file*/) {
610-
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented");
611-
}
612-
void ExtendedMapLookahead::write(const std::string& /*file*/) const {
613-
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented");
614-
}
615-
616-
#else
617-
618607
void ExtendedMapLookahead::read(const std::string& file) {
608+
#ifndef VTR_ENABLE_CAPNPROTO
619609
cost_map_.read(file);
620610

621611
this->src_opin_delays = util::compute_router_src_opin_lookahead(is_flat_);
622612

623613
this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead();
614+
#else // VTR_ENABLE_CAPNPROTO
615+
(void)file;
616+
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented");
617+
#endif // VTR_ENABLE_CAPNPROTO
624618
}
619+
625620
void ExtendedMapLookahead::write(const std::string& file) const {
621+
#ifndef VTR_ENABLE_CAPNPROTO
626622
cost_map_.write(file);
623+
#else // VTR_ENABLE_CAPNPROTO
624+
(void)file;
625+
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented");
626+
#endif // VTR_ENABLE_CAPNPROTO
627627
}
628628

629-
#endif

0 commit comments

Comments
 (0)