diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-06 19:32:17 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-06 19:32:17 +0200 |
commit | fffaaa613f498cb83f8d885e5a8b75dc41a9c157 (patch) | |
tree | 325deb17a71813a6316b5ecec253a4e3155d4733 /generic | |
parent | 9510c444c93fdb8923d77651562fb698e59dea5f (diff) | |
download | nextpnr-fffaaa613f498cb83f8d885e5a8b75dc41a9c157.tar.gz nextpnr-fffaaa613f498cb83f8d885e5a8b75dc41a9c157.tar.bz2 nextpnr-fffaaa613f498cb83f8d885e5a8b75dc41a9c157.zip |
Added project loader
Diffstat (limited to 'generic')
-rw-r--r-- | generic/arch.cc | 2 | ||||
-rw-r--r-- | generic/arch.h | 2 | ||||
-rw-r--r-- | generic/project.cc | 41 |
3 files changed, 44 insertions, 1 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index a0ab58f8..3389ac0d 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -175,7 +175,7 @@ void Arch::setGroupDecal(GroupId group, DecalXY decalxy) // --------------------------------------------------------------- -Arch::Arch(ArchArgs) : chipName("generic") {} +Arch::Arch(ArchArgs args) : chipName("generic"), args(args) {} void IdString::initialize_arch(const BaseCtx *ctx) {} diff --git a/generic/arch.h b/generic/arch.h index d3e8f69e..10cd1d5a 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -118,11 +118,13 @@ struct Arch : BaseCtx // --------------------------------------------------------------- // Common Arch API. Every arch must provide the following methods. + ArchArgs args; Arch(ArchArgs args); std::string getChipName() const { return chipName; } IdString archId() const { return id("generic"); } + ArchArgs archArgs() const { return args; } IdString archArgsToId(ArchArgs args) const { return id("none"); } IdString belTypeToId(BelType type) const { return type; } diff --git a/generic/project.cc b/generic/project.cc new file mode 100644 index 00000000..e412d8dc --- /dev/null +++ b/generic/project.cc @@ -0,0 +1,41 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic <miodrag@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 <boost/filesystem/convenience.hpp> +#include "project.h" +#include "log.h" +#include <fstream> + +NEXTPNR_NAMESPACE_BEGIN + +void ProjectHandler::saveArch(Context *ctx, pt::ptree &root) +{ +} + +std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) +{ + ArchArgs chipArgs; + return std::unique_ptr<Context>(new Context(chipArgs)); +} + +void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) +{ +} + +NEXTPNR_NAMESPACE_END |