66 lines
2.2 KiB
C++
66 lines
2.2 KiB
C++
/*
|
|
* nextpnr -- Next Generation Place and Route
|
|
*
|
|
* Copyright (C) 2024 The Project Peppercorn Authors.
|
|
*
|
|
* 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 HIMBAECHEL_GATEMATE_H
|
|
#define HIMBAECHEL_GATEMATE_H
|
|
|
|
#include "extra_data.h"
|
|
#include "himbaechel_api.h"
|
|
#include "log.h"
|
|
#include "nextpnr.h"
|
|
#include "util.h"
|
|
|
|
#include "himbaechel_helpers.h"
|
|
|
|
NEXTPNR_NAMESPACE_BEGIN
|
|
|
|
struct GateMateImpl : HimbaechelAPI
|
|
{
|
|
~GateMateImpl();
|
|
void init_database(Arch *arch) override;
|
|
|
|
void init(Context *ctx) override;
|
|
void setupArchContext() override;
|
|
|
|
void pack() override;
|
|
|
|
void postRoute() override;
|
|
|
|
bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override;
|
|
delay_t estimateDelay(WireId src, WireId dst) const override;
|
|
|
|
void drawBel(std::vector<GraphicElement> &g, GraphicElement::style_t style, IdString bel_type, Loc loc) override;
|
|
|
|
void write_bitstream(const std::string &device, const std::string &filename);
|
|
bool read_bitstream(const std::string &device, const std::string &filename);
|
|
|
|
void parse_ccf(const std::string &filename);
|
|
|
|
IdString getBelBucketForCellType(IdString cell_type) const;
|
|
bool isValidBelForCellType(IdString cell_type, BelId bel) const;
|
|
|
|
bool isPipInverting(PipId pip) const override {
|
|
const auto &extra_data = *reinterpret_cast<const GateMatePipExtraDataPOD*>(chip_pip_info(ctx->chip_info, pip).extra_data.get());
|
|
return extra_data.type == PipExtra::PIP_EXTRA_MUX && (extra_data.flags & MUX_INVERT);
|
|
}
|
|
};
|
|
|
|
NEXTPNR_NAMESPACE_END
|
|
#endif
|