Fix clangformat and execute it
This commit is contained in:
parent
901ad4e917
commit
7a95629aff
@ -334,8 +334,8 @@ foreach (family ${ARCH})
|
|||||||
endforeach (family)
|
endforeach (family)
|
||||||
|
|
||||||
file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
|
file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
|
||||||
string(REGEX REPLACE "[^;]*/ice40/chipdbs/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
string(REGEX REPLACE "[^;]*/ice40/chipdb/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
||||||
string(REGEX REPLACE "[^;]*/ecp5/chipdbs/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
string(REGEX REPLACE "[^;]*/ecp5/chipdb/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
||||||
string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
||||||
string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <boost/iostreams/device/mapped_file.hpp>
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include "nextpnr.h"
|
#include <boost/iostreams/device/mapped_file.hpp>
|
||||||
#include "embed.h"
|
#include "embed.h"
|
||||||
|
#include "nextpnr.h"
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
#if defined(EXTERNAL_CHIPDB_ROOT)
|
#if defined(EXTERNAL_CHIPDB_ROOT)
|
||||||
|
|
||||||
const void *get_chipdb(const std::string &filename) {
|
const void *get_chipdb(const std::string &filename)
|
||||||
|
{
|
||||||
static std::map<std::string, boost::iostreams::mapped_file> files;
|
static std::map<std::string, boost::iostreams::mapped_file> files;
|
||||||
if (!files.count(filename)) {
|
if (!files.count(filename)) {
|
||||||
std::string full_filename = EXTERNAL_CHIPDB_ROOT "/" + filename;
|
std::string full_filename = EXTERNAL_CHIPDB_ROOT "/" + filename;
|
||||||
@ -24,7 +25,8 @@ const void *get_chipdb(const std::string &filename) {
|
|||||||
|
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
|
|
||||||
const void *get_chipdb(const std::string &filename) {
|
const void *get_chipdb(const std::string &filename)
|
||||||
|
{
|
||||||
HRSRC rc = ::FindResource(nullptr, filename.c_str(), RT_RCDATA);
|
HRSRC rc = ::FindResource(nullptr, filename.c_str(), RT_RCDATA);
|
||||||
HGLOBAL rcData = ::LoadResource(nullptr, rc);
|
HGLOBAL rcData = ::LoadResource(nullptr, rc);
|
||||||
return ::LockResource(rcData);
|
return ::LockResource(rcData);
|
||||||
@ -34,7 +36,8 @@ const void *get_chipdb(const std::string &filename) {
|
|||||||
|
|
||||||
EmbeddedFile *EmbeddedFile::head = nullptr;
|
EmbeddedFile *EmbeddedFile::head = nullptr;
|
||||||
|
|
||||||
const void *get_chipdb(const std::string &filename) {
|
const void *get_chipdb(const std::string &filename)
|
||||||
|
{
|
||||||
for (EmbeddedFile *file = EmbeddedFile::head; file; file = file->next)
|
for (EmbeddedFile *file = EmbeddedFile::head; file; file = file->next)
|
||||||
if (file->filename == filename)
|
if (file->filename == filename)
|
||||||
return file->content;
|
return file->content;
|
||||||
|
@ -33,8 +33,7 @@ struct EmbeddedFile
|
|||||||
const void *content;
|
const void *content;
|
||||||
EmbeddedFile *next = nullptr;
|
EmbeddedFile *next = nullptr;
|
||||||
|
|
||||||
EmbeddedFile(const std::string &filename, const void *content)
|
EmbeddedFile(const std::string &filename, const void *content) : filename(filename), content(content)
|
||||||
: filename(filename), content(content)
|
|
||||||
{
|
{
|
||||||
next = head;
|
next = head;
|
||||||
head = this;
|
head = this;
|
||||||
|
20
ecp5/arch.cc
20
ecp5/arch.cc
@ -23,11 +23,11 @@
|
|||||||
#include <boost/range/adaptor/reversed.hpp>
|
#include <boost/range/adaptor/reversed.hpp>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include "embed.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
#include "embed.h"
|
|
||||||
#include "placer1.h"
|
#include "placer1.h"
|
||||||
#include "placer_heap.h"
|
#include "placer_heap.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
@ -61,16 +61,15 @@ void IdString::initialize_arch(const BaseCtx *ctx)
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip) {
|
static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip)
|
||||||
|
{
|
||||||
std::string chipdb;
|
std::string chipdb;
|
||||||
if (chip == ArchArgs::LFE5U_12F || chip == ArchArgs::LFE5U_25F ||
|
if (chip == ArchArgs::LFE5U_12F || chip == ArchArgs::LFE5U_25F || chip == ArchArgs::LFE5UM_25F ||
|
||||||
chip == ArchArgs::LFE5UM_25F || chip == ArchArgs::LFE5UM5G_25F) {
|
chip == ArchArgs::LFE5UM5G_25F) {
|
||||||
chipdb = "ecp5/chipdb-25k.bin";
|
chipdb = "ecp5/chipdb-25k.bin";
|
||||||
} else if (chip == ArchArgs::LFE5U_45F ||
|
} else if (chip == ArchArgs::LFE5U_45F || chip == ArchArgs::LFE5UM_45F || chip == ArchArgs::LFE5UM5G_45F) {
|
||||||
chip == ArchArgs::LFE5UM_45F || chip == ArchArgs::LFE5UM5G_45F) {
|
|
||||||
chipdb = "ecp5/chipdb-45k.bin";
|
chipdb = "ecp5/chipdb-45k.bin";
|
||||||
} else if (chip == ArchArgs::LFE5U_85F ||
|
} else if (chip == ArchArgs::LFE5U_85F || chip == ArchArgs::LFE5UM_85F || chip == ArchArgs::LFE5UM5G_85F) {
|
||||||
chip == ArchArgs::LFE5UM_85F || chip == ArchArgs::LFE5UM5G_85F) {
|
|
||||||
chipdb = "ecp5/chipdb-85k.bin";
|
chipdb = "ecp5/chipdb-85k.bin";
|
||||||
} else {
|
} else {
|
||||||
log_error("Unknown chip\n");
|
log_error("Unknown chip\n");
|
||||||
@ -82,10 +81,7 @@ static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip) {
|
|||||||
return ptr->get();
|
return ptr->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arch::isAvailable(ArchArgs::ArchArgsTypes chip)
|
bool Arch::isAvailable(ArchArgs::ArchArgsTypes chip) { return get_chip_info(chip) != nullptr; }
|
||||||
{
|
|
||||||
return get_chip_info(chip) != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> Arch::getSupportedPackages(ArchArgs::ArchArgsTypes chip)
|
std::vector<std::string> Arch::getSupportedPackages(ArchArgs::ArchArgsTypes chip)
|
||||||
{
|
{
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "cells.h"
|
#include "cells.h"
|
||||||
|
#include "embed.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
#include "embed.h"
|
|
||||||
#include "placer1.h"
|
#include "placer1.h"
|
||||||
#include "placer_heap.h"
|
#include "placer_heap.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
@ -44,7 +44,8 @@ void IdString::initialize_arch(const BaseCtx *ctx)
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip) {
|
static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip)
|
||||||
|
{
|
||||||
std::string chipdb;
|
std::string chipdb;
|
||||||
if (chip == ArchArgs::LP384) {
|
if (chip == ArchArgs::LP384) {
|
||||||
chipdb = "ice40/chipdb-384.bin";
|
chipdb = "ice40/chipdb-384.bin";
|
||||||
@ -66,10 +67,7 @@ static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip) {
|
|||||||
return ptr->get();
|
return ptr->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arch::isAvailable(ArchArgs::ArchArgsTypes chip)
|
bool Arch::isAvailable(ArchArgs::ArchArgsTypes chip) { return get_chip_info(chip) != nullptr; }
|
||||||
{
|
|
||||||
return get_chip_info(chip) != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> Arch::getSupportedPackages(ArchArgs::ArchArgsTypes chip)
|
std::vector<std::string> Arch::getSupportedPackages(ArchArgs::ArchArgsTypes chip)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user