Remove fasm writer

This commit is contained in:
Eddie Hung 2018-12-26 17:10:52 -08:00
parent f2b6e525d5
commit 6a09f2a856
3 changed files with 0 additions and 82 deletions

View File

@ -56,7 +56,6 @@ po::options_description Xc7CommandHandler::getArchOptions()
specific.add_options()("package", po::value<std::string>(), "set device package");
specific.add_options()("pcf", po::value<std::string>(), "PCF constraints file to ingest");
specific.add_options()("xdl", po::value<std::string>(), "XDL file to write");
specific.add_options()("fasm", po::value<std::string>(), "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::string>();
std::ofstream f(filename);
write_fasm(ctx, f);
}
}
void Xc7CommandHandler::setupArchContext(Context *ctx)

View File

@ -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<int>(what.str(1));
ss << type << "_X" << static_cast<int>(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<uint32_t>(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

View File

@ -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