From 6a09f2a8565b6085a8ca730a42951bbcf2f721cb Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 26 Dec 2018 17:10:52 -0800 Subject: [PATCH] Remove fasm writer --- xc7/main.cc | 6 ----- xc7/xdl.cc | 75 ----------------------------------------------------- xc7/xdl.h | 1 - 3 files changed, 82 deletions(-) diff --git a/xc7/main.cc b/xc7/main.cc index 1ff585b3..cac9a397 100644 --- a/xc7/main.cc +++ b/xc7/main.cc @@ -56,7 +56,6 @@ po::options_description Xc7CommandHandler::getArchOptions() specific.add_options()("package", po::value(), "set device package"); specific.add_options()("pcf", po::value(), "PCF constraints file to ingest"); specific.add_options()("xdl", po::value(), "XDL file to write"); - specific.add_options()("fasm", po::value(), "FASM file to write"); // specific.add_options()("tmfuzz", "run path delay estimate fuzzer"); return specific; } @@ -84,11 +83,6 @@ void Xc7CommandHandler::customBitstream(Context *ctx) std::ofstream f(filename); write_xdl(ctx, f); } - if (vm.count("fasm")) { - std::string filename = vm["fasm"].as(); - std::ofstream f(filename); - write_fasm(ctx, f); - } } void Xc7CommandHandler::setupArchContext(Context *ctx) diff --git a/xc7/xdl.cc b/xc7/xdl.cc index 317b4108..ef1be83e 100644 --- a/xc7/xdl.cc +++ b/xc7/xdl.cc @@ -282,79 +282,4 @@ void write_xdl(const Context *ctx, std::ostream &out) exporter(designPtr); } -void write_fasm(const Context *ctx, std::ostream &out) -{ - auto designPtr = create_torc_design(ctx); - - static const boost::regex re_loc(".+_X(\\d+)Y(\\d+)"); - boost::smatch what; - - // export the instances - Circuit::InstanceSharedPtrConstIterator pi = designPtr->instancesBegin(); - Circuit::InstanceSharedPtrConstIterator ei = designPtr->instancesEnd(); - for (; pi < ei; ++pi) { - std::stringstream ss; - ss << (*pi)->getTile() << '.'; - const auto& type = (*pi)->getType(); - if (type == "SLICEL") { - const auto& site_name = (*pi)->getSite(); - if (!boost::regex_match(site_name, what, re_loc)) - throw; - - const auto x = boost::lexical_cast(what.str(1)); - ss << type << "_X" << static_cast(x & 1) << '.'; - - out << "# " << (*pi)->getName() << std::endl; - - auto pc = (*pi)->configBegin(); - auto ec = (*pi)->configEnd(); - for (; pc != ec; ++pc) - if (pc->first == "A6LUT" || pc->first == "B6LUT" || pc->first == "C6LUT" || pc->first == "D6LUT") { - auto name = pc->second.getName(); - boost::replace_all(name, "\\:", ":"); - auto it = ctx->cells.find(ctx->id(name)); - if (it == ctx->cells.end()) it = ctx->cells.find(ctx->id(name + "_LC")); - assert(it != ctx->cells.end()); - auto cell = it->second.get(); - const auto &init = cell->params[ctx->id("INIT")]; - if (cell->lcInfo.inputCount <= 5) { - auto num_bits = (1 << cell->lcInfo.inputCount); - auto init_as_uint = boost::lexical_cast(init); - out << ss.str() << pc->first[0] << pc->first.substr(2,std::string::npos) << ".INIT"; - out << "[" << num_bits-1 << ":0]" << "="; - out << num_bits << "'b"; - for (auto i = 0; i < num_bits; ++i) - out << ((init_as_uint >> i) & 1 ? '1' : '0'); - out << std::endl; - } - else { - out << ss.str() << pc->first[0] << pc->first.substr(2,std::string::npos) << ".INIT[31:0]="; - out << "32'b" << boost::adaptors::reverse(init.substr(0,32)) << std::endl; - out << ss.str() << pc->first[0] << pc->first.substr(2,std::string::npos) << ".INIT[63:32]="; - out << "32'b" << boost::adaptors::reverse(init.substr(32,32)) << std::endl; - } - } - else - out << ss.str() << pc->first << '.' << pc->second.getValue() << std::endl; - - out << std::endl; - } - } - - // export the nets - Circuit::NetSharedPtrConstIterator pn = designPtr->netsBegin(); - Circuit::NetSharedPtrConstIterator en = designPtr->netsEnd(); - for (; pn < en; ++pn) { - - out << "# " << (*pn)->getName() << std::endl; - - auto pp = (*pn)->pipsBegin(); - auto ep = (*pn)->pipsEnd(); - for (; pp != ep; ++pp) - out << pp->getTileName() << "." << pp->getSourceWireName() << "." << pp->getSinkWireName() << std::endl; - - out << std::endl; - } -} - NEXTPNR_NAMESPACE_END diff --git a/xc7/xdl.h b/xc7/xdl.h index 19ee10cc..19bc5478 100644 --- a/xc7/xdl.h +++ b/xc7/xdl.h @@ -27,7 +27,6 @@ NEXTPNR_NAMESPACE_BEGIN void write_xdl(const Context *ctx, std::ostream &out); -void write_fasm(const Context *ctx, std::ostream &out); NEXTPNR_NAMESPACE_END