diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-11-09 12:57:14 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-11-09 12:57:14 +0100 |
commit | 66dd17664c08aca17b53d2853558121aa9e702e4 (patch) | |
tree | b6bc5dd919e5f525ec7328861b81f616673a1ea6 /ecp5/config.cc | |
parent | e91241f10d68fcaaf0a81fa77e9a91666120ccee (diff) | |
parent | 15d9b3d3cc05656e58d01ba2f97ec92b6daaee1c (diff) | |
download | nextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.tar.gz nextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.tar.bz2 nextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.zip |
Merge branch 'master' of github.com:YosysHQ/nextpnr into router_improve
Diffstat (limited to 'ecp5/config.cc')
-rw-r--r-- | ecp5/config.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ecp5/config.cc b/ecp5/config.cc index 826c16a9..c8f94857 100644 --- a/ecp5/config.cc +++ b/ecp5/config.cc @@ -19,6 +19,7 @@ #include "config.h" #include <boost/range/adaptor/reversed.hpp> +#include <iomanip> #include "log.h" NEXTPNR_NAMESPACE_BEGIN @@ -274,6 +275,28 @@ std::ostream &operator<<(std::ostream &out, const ChipConfig &cc) out << std::endl; } } + for (const auto &bram : cc.bram_data) { + out << ".bram_init " << bram.first << std::endl; + std::ios_base::fmtflags f(out.flags()); + for (size_t i = 0; i < bram.second.size(); i++) { + out << std::setw(3) << std::setfill('0') << std::hex << bram.second.at(i); + if (i % 8 == 7) + out << std::endl; + else + out << " "; + } + out.flags(f); + out << std::endl; + } + for (const auto &tg : cc.tilegroups) { + out << ".tile_group"; + for (const auto &tile : tg.tiles) { + out << " " << tile; + } + out << std::endl; + out << tg.config; + out << std::endl; + } return out; } @@ -294,6 +317,29 @@ std::istream &operator>>(std::istream &in, ChipConfig &cc) TileConfig tc; in >> tc; cc.tiles[tilename] = tc; + } else if (verb == ".tile_group") { + TileGroup tg; + std::string line; + getline(in, line); + std::stringstream ss2(line); + + std::string tile; + while (ss2) { + ss2 >> tile; + tg.tiles.push_back(tile); + } + in >> tg.config; + cc.tilegroups.push_back(tg); + } else if (verb == ".bram_init") { + uint16_t bram; + in >> bram; + std::ios_base::fmtflags f(in.flags()); + while (!skip_check_eor(in)) { + uint16_t value; + in >> std::hex >> value; + cc.bram_data[bram].push_back(value); + } + in.flags(f); } else { log_error("unrecognised config entry %s\n", verb.c_str()); } |