Add stub for XDL output

This commit is contained in:
Eddie Hung 2018-08-12 19:07:33 -07:00
parent 13e30a4eb1
commit 8dedd7a83c
3 changed files with 77 additions and 1 deletions

View File

@ -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<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()("read", po::value<std::string>(), "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::string>();
std::ofstream f(filename);
write_xdl(ctx, f);
}
}
void Xc7CommandHandler::setupArchContext(Context *ctx)
{
// if (vm.count("tmfuzz"))

33
xc7/xdl.cc Normal file
View File

@ -0,0 +1,33 @@
/*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
* Copyright (C) 2018 Serge Bazanski <q3k@symbioticeda.com>
*
* 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 <cctype>
#include <vector>
#include "cells.h"
#include "log.h"
NEXTPNR_NAMESPACE_BEGIN
void write_xdl(const Context *ctx, std::ostream &out)
{
}
NEXTPNR_NAMESPACE_END

33
xc7/xdl.h Normal file
View File

@ -0,0 +1,33 @@
/*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
*
* 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 <iostream>
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN
void write_xdl(const Context *ctx, std::ostream &out);
NEXTPNR_NAMESPACE_END
#endif