-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apicula: add support for magic sip pins #1370
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,8 +240,31 @@ struct GowinCstReader | |
} | ||
}; | ||
|
||
|
||
void add_sip_constraints(Context *ctx, const Extra_package_data_POD *extra) { | ||
for(auto cst : extra->cst) { | ||
auto it = ctx->cells.find(IdString(cst.net)); | ||
if (it == ctx->cells.end()) { | ||
log_info("Cell %s not found\n", IdString(cst.net).c_str(ctx)); | ||
continue; | ||
} | ||
Loc loc = Loc(cst.col, cst.row, cst.bel); | ||
BelId bel = ctx->getBelByLocation(loc); | ||
if (bel == BelId()) { | ||
log_error("Pin not found.\n"); | ||
} | ||
it->second->setAttr(IdString(ID_BEL), std::string(ctx->nameOfBel(bel))); | ||
} | ||
} | ||
|
||
bool gowin_apply_constraints(Context *ctx, std::istream &in) | ||
{ | ||
// implicit constraints from SiP pins | ||
const Extra_package_data_POD *extra = reinterpret_cast<const Extra_package_data_POD *>(ctx->package_info->extra_data.get()); | ||
if(extra != nullptr) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this won't actually work, because relptrs are relative so |
||
add_sip_constraints(ctx, extra); | ||
} | ||
|
||
GowinCstReader reader(ctx, in); | ||
return reader.run(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be
static void
or in an anonymous namespace