{"action":"created","issue":{"url":"https://api.github.com/repos/steveicarus/iverilog/issues/141","repository_url":"https://api.github.com/repos/steveicarus/iverilog","labels_url":"https://api.github.com/repos/steveicarus/iverilog/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/steveicarus/iverilog/issues/141/comments","events_url":"https://api.github.com/repos/steveicarus/iverilog/issues/141/events","html_url":"https://github.com/steveicarus/iverilog/issues/141","id":197278268,"number":141,"title":"$display causing seg fault with PLI","user":{"login":"markNZed","id":242998,"avatar_url":"https://avatars.githubusercontent.com/u/242998?v=3","gravatar_id":"","url":"https://api.github.com/users/markNZed","html_url":"https://github.com/markNZed","followers_url":"https://api.github.com/users/markNZed/followers","following_url":"https://api.github.com/users/markNZed/following{/other_user}","gists_url":"https://api.github.com/users/markNZed/gists{/gist_id}","starred_url":"https://api.github.com/users/markNZed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markNZed/subscriptions","organizations_url":"https://api.github.com/users/markNZed/orgs","repos_url":"https://api.github.com/users/markNZed/repos","events_url":"https://api.github.com/users/markNZed/events{/privacy}","received_events_url":"https://api.github.com/users/markNZed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-22T22:18:12Z","updated_at":"2016-12-24T15:57:26Z","closed_at":null,"body":"I'm driving signals through the VPI e.g.\r\n\r\nvpi_put_value(wr_handle, &val, &delay, vpiInertialDelay || vpiForceFlag);\r\n\r\nand in the Verilog testbench it runs fine if I don't use $display. I can use $display before initialising the VPI/PLI code. But if I use $display during the simulation I get a seg fault.\r\n\r\n```\r\nProgram terminated with signal SIGABRT, Aborted.\r\n#0  0x00007f519b5b0428 in raise () from /lib/x86_64-linux-gnu/libc.so.6\r\n(gdb) bt\r\n#0  0x00007f519b5b0428 in raise () from /lib/x86_64-linux-gnu/libc.so.6\r\n#1  0x00007f519b5b202a in abort () from /lib/x86_64-linux-gnu/libc.so.6\r\n#2  0x00007f519b5a8bd7 in ?? () from /lib/x86_64-linux-gnu/libc.so.6\r\n#3  0x00007f519b5a8c82 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6\r\n#4  0x00000000004b93fb in vpi_put_value (obj=<optimized out>, vp=vp@entry=0x7ffc1c6a8790, when=when@entry=0x7ffc1c6a87a0, flags=flags@entry=1) at vpi_priv.cc:1062\r\n#5  0x00007f519b367280 in vcdread_changes () at vcdr_pli.c:362\r\n#6  0x00007f519b367707 in vcdr_misc (data=<optimized out>, reason=10, paramvc=<optimized out>) at vcdr_pli.c:564\r\n#7  0x00000000004b3135 in sync_cb::run_run (this=0x1d0e490) at vpi_callback.cc:319\r\n#8  0x000000000048ab4e in generic_event_s::run_run (this=0x71d510 <generic_event_heap+1456>) at schedule.cc:502\r\n#9  0x000000000048cf68 in schedule_simulate () at schedule.cc:1183\r\n#10 0x0000000000444584 in main (argc=<optimized out>, argv=0x7ffc1c6a9b38) at main.cc:501\r\n \r\n```\r\n\r\nApart from this I have the PLI based VCD replay from http://chris.spear.net/pli/ working in Icarus. I'd like to resolve the $display issue then Chris could make the package available.\r\n\r\nI've attached the demo. To see it running without the seg fault comment out `$display(\"hello\"); `in tb_read.v Any hints much appreciated!\r\n\r\n[vcdr2.tar.gz](https://github.com/steveicarus/iverilog/files/669956/vcdr2.tar.gz)\r\n "},"comment":{"url":"https://api.github.com/repos/steveicarus/iverilog/issues/comments/269089777","html_url":"https://github.com/steveicarus/iverilog/issues/141#issuecomment-269089777","issue_url":"https://api.github.com/repos/steveicarus/iverilog/issues/141","id":269089777,"user":{"login":"markNZed","id":242998,"avatar_url":"https://avatars.githubusercontent.com/u/242998?v=3","gravatar_id":"","url":"https://api.github.com/users/markNZed","html_url":"https://github.com/markNZed","followers_url":"https://api.github.com/users/markNZed/followers","following_url":"https://api.github.com/users/markNZed/following{/other_user}","gists_url":"https://api.github.com/users/markNZed/gists{/gist_id}","starred_url":"https://api.github.com/users/markNZed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markNZed/subscriptions","organizations_url":"https://api.github.com/users/markNZed/orgs","repos_url":"https://api.github.com/users/markNZed/repos","events_url":"https://api.github.com/users/markNZed/events{/privacy}","received_events_url":"https://api.github.com/users/markNZed/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T15:57:26Z","updated_at":"2016-12-24T15:57:26Z","body":"Thanks for taking a look. The code in vcdr_pli.c looks like:     \r\n```\r\nvpiHandle wr_handle;\r\nwr_handle = acc_handle_tfarg(signal->argn);\r\nvpi_put_value(wr_handle, &val, &delay, vpiInertialDelay || vpiForceFlag);\r\n```\r\n\r\nwr_handle is passed in as obj. \r\n"}}
{"actor":{"display_login":"markNZed"}}