diff --git a/xc7/main.cc b/xc7/main.cc index 67515f7b..ec73c940 100644 --- a/xc7/main.cc +++ b/xc7/main.cc @@ -27,6 +27,7 @@ #include "log.h" #include "pcf.h" #include "timing.h" +#include "xdl.h" USING_NEXTPNR_NAMESPACE @@ -39,6 +40,7 @@ class Xc7CommandHandler : public CommandHandler void setupArchContext(Context *ctx) override; void validate() override; void customAfterLoad(Context *ctx) override; + void customBitstream(Context *ctx) override; protected: po::options_description getArchOptions(); @@ -53,7 +55,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()("read", po::value(), "asc bitstream file to read"); // specific.add_options()("tmfuzz", "run path delay estimate fuzzer"); return specific; } @@ -74,6 +75,15 @@ void Xc7CommandHandler::customAfterLoad(Context *ctx) // log_error("Loading PCF failed.\n"); } } +void Xc7CommandHandler::customBitstream(Context *ctx) +{ + if (vm.count("xdl")) { + std::string filename = vm["xdl"].as(); + std::ofstream f(filename); + write_xdl(ctx, f); + } +} + void Xc7CommandHandler::setupArchContext(Context *ctx) { // if (vm.count("tmfuzz")) diff --git a/xc7/xdl.cc b/xc7/xdl.cc new file mode 100644 index 00000000..40ed9744 --- /dev/null +++ b/xc7/xdl.cc @@ -0,0 +1,33 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 David Shah + * Copyright (C) 2018 Serge Bazanski + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +#include "xdl.h" +#include +#include +#include "cells.h" +#include "log.h" + +NEXTPNR_NAMESPACE_BEGIN + +void write_xdl(const Context *ctx, std::ostream &out) +{ +} + +NEXTPNR_NAMESPACE_END diff --git a/xc7/xdl.h b/xc7/xdl.h new file mode 100644 index 00000000..19bc5478 --- /dev/null +++ b/xc7/xdl.h @@ -0,0 +1,33 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 David Shah + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#ifndef XC7_BITSTREAM_H +#define XC7_BITSTREAM_H + +#include +#include "nextpnr.h" + +NEXTPNR_NAMESPACE_BEGIN + +void write_xdl(const Context *ctx, std::ostream &out); + +NEXTPNR_NAMESPACE_END + +#endif