Display slices
This commit is contained in:
parent
105c148848
commit
b7a06a02c4
34
xc7/arch.cc
34
xc7/arch.cc
@ -396,13 +396,18 @@ static bool endsWith(const std::string& str, const std::string& suffix)
|
|||||||
BelId Arch::getBelByName(IdString name) const
|
BelId Arch::getBelByName(IdString name) const
|
||||||
{
|
{
|
||||||
std::string n = name.str(this);
|
std::string n = name.str(this);
|
||||||
|
int ndx = 0;
|
||||||
if (endsWith(n,"_A") || endsWith(n,"_B") || endsWith(n,"_C") || endsWith(n,"_D"))
|
if (endsWith(n,"_A") || endsWith(n,"_B") || endsWith(n,"_C") || endsWith(n,"_D"))
|
||||||
{
|
{
|
||||||
|
ndx = (int)(n.back() - 'A');
|
||||||
n = n.substr(0,n.size()-2);
|
n = n.substr(0,n.size()-2);
|
||||||
}
|
}
|
||||||
auto it = torc_info->sites.findSiteIndex(n);
|
auto it = torc_info->sites.findSiteIndex(n);
|
||||||
if (it != SiteIndex(-1))
|
if (it != SiteIndex(-1)) {
|
||||||
return torc_info->site_index_to_bel.at(it);
|
BelId id = torc_info->site_index_to_bel.at(it);
|
||||||
|
id.index += ndx;
|
||||||
|
return id;
|
||||||
|
}
|
||||||
return BelId();
|
return BelId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -877,6 +882,31 @@ DecalXY Arch::getGroupDecal(GroupId group) const
|
|||||||
std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
|
std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
|
||||||
{
|
{
|
||||||
std::vector<GraphicElement> ret;
|
std::vector<GraphicElement> ret;
|
||||||
|
|
||||||
|
if (decal.type == DecalId::TYPE_BEL) {
|
||||||
|
BelId bel;
|
||||||
|
bel.index = decal.index;
|
||||||
|
auto bel_type = getBelType(bel);
|
||||||
|
int x = torc_info->bel_to_loc[bel.index].x;
|
||||||
|
int y = torc_info->bel_to_loc[bel.index].y;
|
||||||
|
int z = torc_info->bel_to_loc[bel.index].z;
|
||||||
|
if (bel_type == id_SLICE_LUT6) {
|
||||||
|
GraphicElement el;
|
||||||
|
/*if (z>3) {
|
||||||
|
z = z - 4;
|
||||||
|
x -= logic_cell_x2- logic_cell_x1;
|
||||||
|
}*/
|
||||||
|
el.type = GraphicElement::TYPE_BOX;
|
||||||
|
el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE;
|
||||||
|
el.x1 = x + logic_cell_x1;
|
||||||
|
el.x2 = x + logic_cell_x2;
|
||||||
|
el.y1 = y + logic_cell_y1 + (z)*logic_cell_pitch;
|
||||||
|
el.y2 = y + logic_cell_y2 + (z)*logic_cell_pitch;
|
||||||
|
ret.push_back(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user