Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pepijndevos
Copy link
Member

While we have documented the sdram pins of some devices we lack the ability to automatically place them like the vendor tools do. For better compatibility and user friendliness this PR adds the ability to constrain these magic pin locations.

It seems to load the constraints but I have yet to test if sdram actually functions, which isn't super trivial.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't actually work, because relptrs are relative so get() will add it's own location to the zero offset first. you'd need to add something like an is_null() or similar function to RelPtr that checks if the offset is zero (because a relptr is never going to be pointing to itself in any useful context, so zero is useful as a null offset value)

@@ -240,8 +240,31 @@ struct GowinCstReader
}
};


void add_sip_constraints(Context *ctx, const Extra_package_data_POD *extra) {
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants