ecp5: Adding command line options for device type
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
e6725dcde4
commit
0e31a8e266
@ -18,9 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cells.h"
|
#include "cells.h"
|
||||||
|
#include "design_utils.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "design_utils.h"
|
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ void add_port(const Context *ctx, CellInfo *cell, std::string name, PortType dir
|
|||||||
cell->ports[id] = PortInfo{id, nullptr, dir};
|
cell->ports[id] = PortInfo{id, nullptr, dir};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::string name)
|
||||||
std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::string name) {
|
{
|
||||||
static int auto_idx = 0;
|
static int auto_idx = 0;
|
||||||
std::unique_ptr<CellInfo> new_cell = std::unique_ptr<CellInfo>(new CellInfo());
|
std::unique_ptr<CellInfo> new_cell = std::unique_ptr<CellInfo>(new CellInfo());
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
|
24
ecp5/cells.h
24
ecp5/cells.h
@ -24,35 +24,25 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
|
||||||
// Create a standard ECP5 cell and return it
|
// Create a standard ECP5 cell and return it
|
||||||
// Name will be automatically assigned if not specified
|
// Name will be automatically assigned if not specified
|
||||||
std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::string name = "");
|
std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::string name = "");
|
||||||
|
|
||||||
// Return true if a cell is a LUT
|
// Return true if a cell is a LUT
|
||||||
inline bool is_lut(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_lut(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("LUT4"); }
|
||||||
{ return cell->type == ctx->id("LUT4"); }
|
|
||||||
|
|
||||||
// Return true if a cell is a flipflop
|
// Return true if a cell is a flipflop
|
||||||
inline bool is_ff(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_ff(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("TRELLIS_FF"); }
|
||||||
{
|
|
||||||
return cell->type == ctx->id("TRELLIS_FF");
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_carry(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_carry(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("CCU2C"); }
|
||||||
{ return cell->type == ctx->id("CCU2C"); }
|
|
||||||
|
|
||||||
inline bool is_lc(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_lc(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("TRELLIS_LC"); }
|
||||||
{ return cell->type == ctx->id("TRELLIS_LC"); }
|
|
||||||
|
|
||||||
inline bool is_dpram(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_dpram(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("TRELLIS_DPR16X4"); }
|
||||||
{ return cell->type == ctx->id("TRELLIS_DPR16X4"); }
|
|
||||||
|
|
||||||
inline bool is_pfumx(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_pfumx(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("PFUMX"); }
|
||||||
{ return cell->type == ctx->id("PFUMX"); }
|
|
||||||
|
|
||||||
inline bool is_l6mux(const BaseCtx *ctx, const CellInfo *cell)
|
inline bool is_l6mux(const BaseCtx *ctx, const CellInfo *cell) { return cell->type == ctx->id("L6MUX21"); }
|
||||||
{ return cell->type == ctx->id("L6MUX21"); }
|
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
|
13
ecp5/main.cc
13
ecp5/main.cc
@ -63,6 +63,11 @@ int main(int argc, char *argv[])
|
|||||||
#ifndef NO_GUI
|
#ifndef NO_GUI
|
||||||
options.add_options()("gui", "start gui");
|
options.add_options()("gui", "start gui");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
options.add_options()("25k", "set device type to LFE5U-25F");
|
||||||
|
options.add_options()("45k", "set device type to LFE5U-45F");
|
||||||
|
options.add_options()("85k", "set device type to LFE5U-85F");
|
||||||
|
|
||||||
options.add_options()("json", po::value<std::string>(), "JSON design file to ingest");
|
options.add_options()("json", po::value<std::string>(), "JSON design file to ingest");
|
||||||
options.add_options()("seed", po::value<int>(), "seed value for random number generator");
|
options.add_options()("seed", po::value<int>(), "seed value for random number generator");
|
||||||
|
|
||||||
@ -111,6 +116,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
ArchArgs args;
|
ArchArgs args;
|
||||||
args.type = ArchArgs::LFE5U_45F;
|
args.type = ArchArgs::LFE5U_45F;
|
||||||
|
|
||||||
|
if (vm.count("25k"))
|
||||||
|
args.type = ArchArgs::LFE5U_25F;
|
||||||
|
if (vm.count("45k"))
|
||||||
|
args.type = ArchArgs::LFE5U_45F;
|
||||||
|
if (vm.count("85k"))
|
||||||
|
args.type = ArchArgs::LFE5U_85F;
|
||||||
|
|
||||||
args.package = "CABGA381";
|
args.package = "CABGA381";
|
||||||
args.speed = 6;
|
args.speed = 6;
|
||||||
std::unique_ptr<Context> ctx = std::unique_ptr<Context>(new Context(args));
|
std::unique_ptr<Context> ctx = std::unique_ptr<Context>(new Context(args));
|
||||||
|
Loading…
Reference in New Issue
Block a user