From 7e57196cf924237a5b6c77025768fcf225b9aa9d Mon Sep 17 00:00:00 2001 From: gatecat Date: Fri, 30 Apr 2021 20:52:52 +0100 Subject: cyclonev: Add some useful constids Signed-off-by: gatecat --- cyclonev/arch.cc | 9 +++++++++ cyclonev/archdefs.h | 16 ++++++++++++++++ cyclonev/constids.inc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 cyclonev/constids.inc diff --git a/cyclonev/arch.cc b/cyclonev/arch.cc index 3f728b91..683118b2 100644 --- a/cyclonev/arch.cc +++ b/cyclonev/arch.cc @@ -26,6 +26,15 @@ NEXTPNR_NAMESPACE_BEGIN using namespace mistral; +void IdString::initialize_arch(const BaseCtx *ctx) +{ +#define X(t) initialize_add(ctx, #t, ID_##t); + +#include "constids.inc" + +#undef X +} + Arch::Arch(ArchArgs args) { this->args = args; diff --git a/cyclonev/archdefs.h b/cyclonev/archdefs.h index d8fd3160..71948ca1 100644 --- a/cyclonev/archdefs.h +++ b/cyclonev/archdefs.h @@ -33,6 +33,22 @@ using mistral::CycloneV; typedef int delay_t; +// https://bugreports.qt.io/browse/QTBUG-80789 + +#ifndef Q_MOC_RUN +enum ConstIds +{ + ID_NONE +#define X(t) , ID_##t +#include "constids.inc" +#undef X +}; + +#define X(t) static constexpr auto id_##t = IdString(ID_##t); +#include "constids.inc" +#undef X +#endif + struct DelayInfo { delay_t delay = 0; diff --git a/cyclonev/constids.inc b/cyclonev/constids.inc new file mode 100644 index 00000000..7efee143 --- /dev/null +++ b/cyclonev/constids.inc @@ -0,0 +1,51 @@ +X(MISTRAL_COMB) +X(MISTRAL_FF) +X(LAB) +X(MLAB) + +X(A) +X(B) +X(C) +X(D) +X(E) +X(F) +X(E0) +X(F0) +X(E1) +X(F1) +X(DATAIN) +X(FFT0) +X(FFT1) +X(FFB0) +X(FFB1) +X(FFT1L) +X(FFB1L) +X(CLKIN) +X(ACLR) +X(CLK) +X(ENA) +X(SCLR) +X(SLOAD) +X(SDATA) +X(Q) + +X(COMBOUT) +X(SUM_OUT) +X(CIN) +X(SHAREIN) +X(COUT) +X(SHAREOUT) + +X(MISTRAL_ALUT6) +X(MISTRAL_ALUT5) +X(MISTRAL_ALUT4) +X(MISTRAL_ALUT3) +X(MISTRAL_ALUT2) +X(MISTRAL_NOT) +X(MISTRAL_ALUT_ARITH) + +X(D0) +X(D1) +X(CI) +X(CO) +X(SO) -- cgit v1.2.3