From: Cary R. <cy...@ya...> - 2015-02-26 03:27:14
|
I have pushed a patch that fixes the oversight in updating the plusargs routine to allow SV strings and add support to put a string value to a SV string from the VPI. If you get the latest code from git this should now work correctly. Cary On Wednesday, February 25, 2015 6:12 PM, Cary R. <cy...@ya...> wrote: Hi Niels, Yes this should work. The problem is the plusargs code was not updated to know that a SystemVerilog string is a variable. Once that was done there is still a problem in that the string is not being updated correctly. I will look at why that is next and post again when I have this working correctly. Interfaces are not currently supported in Icarus. Once they are I hope that the vlog95 code generator can be enhanced to emit them as normal Verilog. I think it will work, but the internal representation may put constraints on how well that will work. Cary On Tuesday, February 10, 2015 6:35 AM, Niels Möller <ni...@ly...> wrote: I'm now trying to read a memory dump, using a command line argument for the file name (as hinted at the end of http://iverilog.wikia.com/wiki/Simulation). System verilog has a string type, so I tried this program, module main; reg [64:0] mem [0:100]; string img; initial begin if (!$value$plusargs("img=%s", img)) begin $display("Specify image file with +img=<image>."); $finish_and_return(1); end $display("Using image: %s", img); $readmemh(img, mem); $display("Initial memory word: mem[0] = %x", mem[0]); $finish; end endmodule // main I compile using $ iverilog -g2005-sv main.vl -o main (with iverilog compiled from git eariler today). Works fine, so far. But running it fails, $ ./main +img=../examples/hello.hex ERROR: main.vl:5: $value$plusargs's second argument must be a variable, found a vpiStringVar. If I change "string img;" to "reg [300:0] img;" it works, and I get the output Using image: ../examples/hello.hex WARNING: main.vl:10: $readmemh(../examples/hello.hex): Not enough words in the file for the requested range [0:100]. Initial memory word: mem[0] = 07000b4a08408e500 But that doesn't seem like a very good solution, since I have to put an arbitrary size on the register, and it will fail with filenames which exceed this size. If I try the System verilog support in iverilog (primarily, I would like to use the interface abstraction), I should be able to use the vlog95 target to generate plain verilog code which I could feed to, e.g., yosys, right? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Iverilog-devel mailing list Ive...@li... https://lists.sourceforge.net/lists/listinfo/iverilog-devel |