Skip to content

Commit

Permalink
[CAPNPROTO] Cleaned Up Lookahead IFDEFs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlexandreSinger committed Mar 22, 2024
1 parent ad2a404 commit b2697ff
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions vpr/src/route/router_lookahead_extended_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,26 +604,25 @@ float ExtendedMapLookahead::get_expected_cost(
}
}

#ifndef VTR_ENABLE_CAPNPROTO

void ExtendedMapLookahead::read(const std::string& /*file*/) {
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented");
}
void ExtendedMapLookahead::write(const std::string& /*file*/) const {
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented");
}

#else

void ExtendedMapLookahead::read(const std::string& file) {
#ifndef VTR_ENABLE_CAPNPROTO
cost_map_.read(file);

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

this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead();
#else // VTR_ENABLE_CAPNPROTO
(void)file;
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::read not implemented");
#endif // VTR_ENABLE_CAPNPROTO
}

void ExtendedMapLookahead::write(const std::string& file) const {
#ifndef VTR_ENABLE_CAPNPROTO
cost_map_.write(file);
#else // VTR_ENABLE_CAPNPROTO
(void)file;
VPR_THROW(VPR_ERROR_ROUTE, "MapLookahead::write not implemented");
#endif // VTR_ENABLE_CAPNPROTO
}

#endif

0 comments on commit b2697ff

Please sign in to comment.