-
Notifications
You must be signed in to change notification settings - Fork 1
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
cinterface/accarraygen example (Bounded by Generic Package - VHDL 2008) #5
base: master
Are you sure you want to change the base?
Conversation
@umarcor Please tell me you will be able to help me learn how to use generic packages and shared protected accesses... I think most of what is there is fine. The ghdl bug printout I get:
|
VHDL2008 Generic Package bugs out with VHPIDRECT (ghdl/ghdl/issues/1229) |
ghdl/ghdl/issues/1229 has been resolved, final test will work when git side updates its ghdl. how to? |
Just wait up to 24h. Then restart the tests, or force push again. Docker images are updated daily: https://github.com/ghdl/docker#-daily-3-jobs--max-3--6-images-daily. There is no triggering mechanism to force them being updated when changes are pushed to ghdl/ghdl. |
It seems that you found another legit bug... Is this one of the issues that you already opened in ghdl/ghdl? |
The bug printout above I no longer get. I don't think that the VHDL code was good. I'll checkout that commit and verify if the bug persists. The current run.sh succeeds on linux but produces a bug on windows. So that may be a legit bug.
|
The first bug report I mentioned seems to occur when the protected type has the foreign VHPIDIRECT function in it. Latest commit the foreign subprog is just in the package, not the protected type. I have not posted this bug. I'll look to do so. A different cause for it, but ghdl/ghdl/issues/1244 causes the same issue. |
Yes, I meant the one that happens on Windows only. |
It boils down to Generic package having a VHPIDIRECT function. ghdl/ghdl/issues/1229 |
Yes, please. Add a comment: |
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.
Overall, pkg.vhd
looks a lot like quickstart/sharedvar/pkg_08.vhd
. In fact, it is almost the same, but here the package is a generic package, and the variable is an array instead of an integer.
At the same time caux.c
is very similar to quickstart/intvector/vhdlsized/caux.c
.
This makes sense, because this new example is a mix between the protected type in quickstart/sharedvar
and the vhdlsized vector in intvector
.
I think we should make this explicit by using the same files, if possible. At least, by copying the functions/names that are common to the base examples.
BTW, you can use this comment as the base for the (missing) docs of this example.
.github/workflows/test.yml
Outdated
@@ -75,6 +76,7 @@ jobs: | |||
vhpidirect/shared/shlib, | |||
#vhpidirect/shared/dlopen, ! dlfcn.h is not available on win | |||
#vhpidirect/shared/shghdl, ! dlfcn.h is not available on win | |||
#vhpidirect/arrays/invector/vhdlpkgsized, ! fails with v0.37, should work with master (fixed under #1229) |
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.
I think it should go below intvector
, since it is a subexample. Ideally, we would not add a subexample to the CI list explicitly. Instead, intvector
should have a single run.sh
that calls other children run.sh
if required. However, since we would need to check the host OS in order to do that, I think it's ok to keep it for now.
.github/workflows/test.yml
Outdated
@@ -75,6 +76,7 @@ jobs: | |||
vhpidirect/shared/shlib, | |||
#vhpidirect/shared/dlopen, ! dlfcn.h is not available on win | |||
#vhpidirect/shared/shghdl, ! dlfcn.h is not available on win | |||
#vhpidirect/arrays/intvector/vhdlpkgsized, ! fails with v0.37, should work with master (fixed under #1229) |
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.
Maybe this is fixed in the docker image now?
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.
Nope, doesn't look like the windows ghdl has changed.
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
int vectorLength = 0; |
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.
I feel that +20 lines is too much, since this is not the main feature that we want to show. I think we should accept a single --grow-vec=3
or --grow-vec 3
and multiply it with the size. More complex examples would fit in #14.
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.
I actually really want to move the main.c to #14...
We would do so after this is merged for sure. And it would just take the main.c file and the appropriate half of the run.sh file....
sharedvar only references the address of an integer, so the get/set do not take indices, nor is there a free subprog. If we make a sharedvarIntArr, then we can reuse files. |
umarcor/ghdl/pull/1
Examples of sharing dynamically bounded arrays from C to VHDL.
type array(0 to cInt-1)
and that is the bounded array.