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

dpi open array support (LRM 35.5.6.1 Open arrays) #1245

Closed
veripoolbot opened this issue Nov 19, 2017 · 8 comments
Closed

dpi open array support (LRM 35.5.6.1 Open arrays) #1245

veripoolbot opened this issue Nov 19, 2017 · 8 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Nov 19, 2017


Author Name: victor besyakov
Original Redmine Issue: 1245 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


trying to compile following:

import "DPI-C" function int shunt_dpi_send_bitN(input int sockid,input int size,input bit[] bitN);

and getting " syntax error, unexpected ']', expecting TYPE-IDENTIFIER"

Do you have any workaround, fixes?
Thanks Victor

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 19, 2017


Original Redmine Comment
Author Name: victor besyakov
Original Date: 2017-11-19T16:06:08Z


My verilator is: Verilator 3.906 2017-06-22 rev verilator_3_904-11-g1da5a33
I have found 2015 Issue #909 (Feature): integer arrays as DPI-C function call arguments. is it the same problem?
Thanks Victor

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 19, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-19T20:07:44Z


Open arrays are not currently supported, it isn't hugely difficult but the biggest problem would be that at present Verilator makes a wrapper that is size dependent, so this code would have to be specialized for each differently sized attachment.

Could you please contribute a test_regress example (perhaps modifying an existing example) that works on another simulator, and also perhaps attempt a patch?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 20, 2017


Original Redmine Comment
Author Name: victor besyakov
Original Date: 2017-11-20T13:20:29Z


I am integrating verilator with my DPI library (https://github.com/xver/Shunt).
I do have examples and definitely will try a patch.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 20, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-20T13:28:07Z


Nice. There was recently a patch to hook Verilator up to MyHDL, wish MyHDL used Shunt.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 6, 2017


Original Redmine Comment
Author Name: victor besyakov
Original Date: 2017-12-06T04:39:21Z


Hi Wilson. I am just updated Shunt depository.
Verilator-Shunt example path is: https://github.com/xver/Shunt/tree/master/examples/sv/sv2c/makedir
To run it: ./verilator_run
Please take a look at:
https://github.com/xver/Shunt/blob/master/utils/dpi/include/shunt_verilator_dpi.svh

To make "shunt_dpi_send_bitN" error, you need to comment out send/recv defines:
//define NO_SHUNT_DPI_HS_RECV_BITN //define NO_SHUNT_DPI_HS_SEND_BITN

BTW: Some comments about new errors are embedded into the same file too...

Thanks Victor

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 14, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-12-14T00:56:51Z


Making progress, but not there yet.

Note this is a superset of #�.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 17, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-12-17T21:33:51Z


Open arrays supported in git towards 3.917.

Based on a survey of other simulators, Verilator matches what they do and only supports unpacked arrays up to 3D (bit [31:0] foo[][][]). It does not support packed openarrays ("bit [] foo").

Your Shunt example passes in some cases, and fails on others. If this is due to a bug in this support please file another bug with a testcase - you can edit test_regress/t/t_open.v.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 2, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-01-02T23:15:00Z


In 3.918.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.