Rename ddb to torc
This commit is contained in:
parent
8dedd7a83c
commit
f6f20dce0c
26
xc7/arch.cc
26
xc7/arch.cc
@ -33,9 +33,9 @@
|
|||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
|
||||||
const DDB *ddb = nullptr;
|
const DDB *torc = nullptr;
|
||||||
const Sites *ddbSites = nullptr;
|
const Sites *torc_sites = nullptr;
|
||||||
const Tiles *ddbTiles = nullptr;
|
const Tiles *torc_tiles = nullptr;
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@ -53,7 +53,7 @@ Arch::Arch(ArchArgs args) : args(args)
|
|||||||
{
|
{
|
||||||
torc::common::DirectoryTree directoryTree("../../torc/src/torc");
|
torc::common::DirectoryTree directoryTree("../../torc/src/torc");
|
||||||
if (args.type == ArchArgs::Z020) {
|
if (args.type == ArchArgs::Z020) {
|
||||||
ddb = new DDB("xc7z020", "clg484");
|
torc = new DDB("xc7z020", "clg484");
|
||||||
} else {
|
} else {
|
||||||
log_error("Unsupported XC7 chip type.\n");
|
log_error("Unsupported XC7 chip type.\n");
|
||||||
}
|
}
|
||||||
@ -68,10 +68,10 @@ Arch::Arch(ArchArgs args) : args(args)
|
|||||||
// if (package_info == nullptr)
|
// if (package_info == nullptr)
|
||||||
// log_error("Unsupported package '%s'.\n", args.package.c_str());
|
// log_error("Unsupported package '%s'.\n", args.package.c_str());
|
||||||
|
|
||||||
ddbSites = &ddb->getSites();
|
torc_sites = &torc->getSites();
|
||||||
ddbTiles = &ddb->getTiles();
|
torc_tiles = &torc->getTiles();
|
||||||
|
|
||||||
bel_to_cell.resize(ddbSites->getSiteCount());
|
bel_to_cell.resize(torc_sites->getSiteCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@ -100,7 +100,7 @@ BelId Arch::getBelByName(IdString name) const
|
|||||||
{
|
{
|
||||||
BelId ret;
|
BelId ret;
|
||||||
|
|
||||||
auto it = ddbSites->findSiteIndex(name.str(this));
|
auto it = torc_sites->findSiteIndex(name.str(this));
|
||||||
if (it != SiteIndex(-1))
|
if (it != SiteIndex(-1))
|
||||||
ret.index = it;
|
ret.index = it;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ BelId Arch::getBelByLocation(Loc loc) const
|
|||||||
BelId bel;
|
BelId bel;
|
||||||
|
|
||||||
if (bel_by_loc.empty()) {
|
if (bel_by_loc.empty()) {
|
||||||
for (SiteIndex i(0); i < ddbSites->getSiteCount(); ++i) {
|
for (SiteIndex i(0); i < torc_sites->getSiteCount(); ++i) {
|
||||||
BelId b;
|
BelId b;
|
||||||
b.index = i;
|
b.index = i;
|
||||||
bel_by_loc[getBelLocation(b)] = b;
|
bel_by_loc[getBelLocation(b)] = b;
|
||||||
@ -130,11 +130,11 @@ BelRange Arch::getBelsByTile(int x, int y) const
|
|||||||
{
|
{
|
||||||
BelRange br;
|
BelRange br;
|
||||||
|
|
||||||
br.b.cursor = std::next(ddbSites->getSites().begin(), Arch::getBelByLocation(Loc(x, y, 0)).index);
|
br.b.cursor = std::next(torc_sites->getSites().begin(), Arch::getBelByLocation(Loc(x, y, 0)).index);
|
||||||
br.e.cursor = br.b.cursor;
|
br.e.cursor = br.b.cursor;
|
||||||
|
|
||||||
if (br.e.cursor != ddbSites->getSites().end()) {
|
if (br.e.cursor != torc_sites->getSites().end()) {
|
||||||
while (br.e.cursor < ddbSites->getSites().end() && ddbSites->getSite((*br.e).index).getTileIndex() == ddbSites->getSite((*br.b).index).getTileIndex())
|
while (br.e.cursor < torc_sites->getSites().end() && torc_sites->getSite((*br.e).index).getTileIndex() == torc_sites->getSite((*br.b).index).getTileIndex())
|
||||||
br.e.cursor++;
|
br.e.cursor++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const
|
|||||||
{
|
{
|
||||||
WireId ret;
|
WireId ret;
|
||||||
|
|
||||||
const auto& site = ddbSites->getSite(bel.index);
|
const auto& site = torc_sites->getSite(bel.index);
|
||||||
ret.index = site.getPinTilewire(pin.str(this));
|
ret.index = site.getPinTilewire(pin.str(this));
|
||||||
|
|
||||||
// NPNR_ASSERT(bel != BelId());
|
// NPNR_ASSERT(bel != BelId());
|
||||||
|
20
xc7/arch.h
20
xc7/arch.h
@ -233,9 +233,9 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
extern const DDB *ddb;
|
extern const DDB *torc;
|
||||||
extern const Sites *ddbSites;
|
extern const Sites *torc_sites;
|
||||||
extern const Tiles *ddbTiles;
|
extern const Tiles *torc_tiles;
|
||||||
|
|
||||||
|
|
||||||
/************************ End of chipdb section. ************************/
|
/************************ End of chipdb section. ************************/
|
||||||
@ -263,7 +263,7 @@ struct BelIterator
|
|||||||
BelId operator*() const
|
BelId operator*() const
|
||||||
{
|
{
|
||||||
BelId ret;
|
BelId ret;
|
||||||
ret.index = SiteIndex(std::distance(ddbSites->getSites().begin(), cursor));
|
ret.index = SiteIndex(std::distance(torc_sites->getSites().begin(), cursor));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -423,7 +423,7 @@ struct Arch : BaseCtx
|
|||||||
IdString getBelName(BelId bel) const
|
IdString getBelName(BelId bel) const
|
||||||
{
|
{
|
||||||
NPNR_ASSERT(bel != BelId());
|
NPNR_ASSERT(bel != BelId());
|
||||||
return id(ddbSites->getSite(bel.index).getName());
|
return id(torc_sites->getSite(bel.index).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getBelChecksum(BelId bel) const { return bel.index; }
|
uint32_t getBelChecksum(BelId bel) const { return bel.index; }
|
||||||
@ -472,15 +472,15 @@ struct Arch : BaseCtx
|
|||||||
BelRange getBels() const
|
BelRange getBels() const
|
||||||
{
|
{
|
||||||
BelRange range;
|
BelRange range;
|
||||||
range.b.cursor = ddbSites->getSites().begin();
|
range.b.cursor = torc_sites->getSites().begin();
|
||||||
range.e.cursor = ddbSites->getSites().end();
|
range.e.cursor = torc_sites->getSites().end();
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loc getBelLocation(BelId bel) const
|
Loc getBelLocation(BelId bel) const
|
||||||
{
|
{
|
||||||
const auto& site = ddbSites->getSite(bel.index);
|
const auto& site = torc_sites->getSite(bel.index);
|
||||||
const auto& tile_info = ddbTiles->getTileInfo(site.getTileIndex());
|
const auto& tile_info = torc_tiles->getTileInfo(site.getTileIndex());
|
||||||
Loc loc;
|
Loc loc;
|
||||||
loc.x = tile_info.getCol();
|
loc.x = tile_info.getCol();
|
||||||
loc.y = tile_info.getRow();
|
loc.y = tile_info.getRow();
|
||||||
@ -496,7 +496,7 @@ struct Arch : BaseCtx
|
|||||||
IdString getBelType(BelId bel) const
|
IdString getBelType(BelId bel) const
|
||||||
{
|
{
|
||||||
NPNR_ASSERT(bel != BelId());
|
NPNR_ASSERT(bel != BelId());
|
||||||
const auto& site = ddbSites->getSite(bel.index);
|
const auto& site = torc_sites->getSite(bel.index);
|
||||||
auto prim_def = site.getPrimitiveDefPtr();
|
auto prim_def = site.getPrimitiveDefPtr();
|
||||||
return id(prim_def->getName());
|
return id(prim_def->getName());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user