machxo2: Implement General Methods.

This commit is contained in:
William D. Jones 2020-12-06 22:06:24 -05:00 committed by gatecat
parent 094233a4ab
commit 3e6be4bbfd
2 changed files with 28 additions and 5 deletions

View File

@ -109,6 +109,25 @@ std::string Arch::getChipName() const
}
}
IdString Arch::archArgsToId(ArchArgs args) const
{
if (args.type == ArchArgs::LCMXO2_256HC) {
return id("lcmxo2_256hc");
} else if (args.type == ArchArgs::LCMXO2_640HC) {
return id("lcmxo2_640hc");
} else if (args.type == ArchArgs::LCMXO2_1200HC) {
return id("lcmxo2_1200hc");
} else if (args.type == ArchArgs::LCMXO2_2000HC) {
return id("lcmxo2_2000hc");
} else if (args.type == ArchArgs::LCMXO2_4000HC) {
return id("lcmxo2_4000hc");
} else if (args.type == ArchArgs::LCMXO2_7000HC) {
return id("lcmxo2_7000hc");
}
return IdString();
}
// ---------------------------------------------------------------
BelId Arch::getBelByName(IdString name) const

View File

@ -339,12 +339,16 @@ struct Arch : BaseCtx
IdString archId() const { return id("machxo2"); }
ArchArgs archArgs() const { return args; }
IdString archArgsToId(ArchArgs args) const { return id("none"); }
IdString archArgsToId(ArchArgs args) const;
int getGridDimX() const { return 0; }
int getGridDimY() const { return 0; }
int getTileBelDimZ(int x, int y) const { return 0; }
int getTilePipDimZ(int x, int y) const { return 0; }
static const int max_loc_bels = 20;
int getGridDimX() const { return chip_info->width; }
int getGridDimY() const { return chip_info->height; }
int getTileBelDimZ(int x, int y) const { return max_loc_bels; }
// TODO: Make more precise? The CENTER MUX having config bits across
// tiles can complicate this?
int getTilePipDimZ(int x, int y) const { return 2; }
BelId getBelByName(IdString name) const;
IdString getBelName(BelId bel) const;