|
From: Maciej S. <mac...@ce...> - 2015-12-07 16:53:03
Attachments:
signature.asc
|
Hi, I am wondering what would be the right way to implement VHDL 'image attribute, which returns a string representation of a variable. The first idea is to use SV $sformatf system function, which returns a string based on the formatting string (e.g. "%d" and input data, but it is currently not available in Icarus. I could add it, but as far as I know, the VPI standard does not allow to write functions that return strings. What's your opinion? Should I extend VPI in Icarus to allow returning strings or is there another, more elegant solution to the problem? Regards, Orson |
|
From: Maciej S. <mac...@ce...> - 2016-01-07 13:19:35
Attachments:
signature.asc
|
Hi,
I have just sent a new merge request [1] with tests [2]. Changes:
- 'image attribute (VHDL)
- VPI extension to allow functions return a string
- $sformatf (SV)
- improved report statements so they accept expressions instead of
string literals (VHDL)
I would be particularly thankful for reviewing the last commit from the
pull request (32fab21e). I have done the change, so e.g. the following
code could be run:
$display({ $sformatf("%d",int_var), $sformatf("%d", int_var) });
Without the change, I was getting a message:
error: Concatenation/replication may not have zero width in this context.
Regards,
Orson
1. https://github.com/steveicarus/iverilog/pull/88
2. https://github.com/orsonmmz/ivtest/tree/image_attr_test
|
|
From: Stephen W. <st...@ic...> - 2016-01-11 00:56:56
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Merged into git master.
On 01/07/2016 05:19 AM, Maciej Sumiński wrote:
> Hi,
>
> I have just sent a new merge request [1] with tests [2]. Changes: -
> 'image attribute (VHDL) - VPI extension to allow functions return a
> string - $sformatf (SV) - improved report statements so they accept
> expressions instead of string literals (VHDL)
>
> I would be particularly thankful for reviewing the last commit from
> the pull request (32fab21e). I have done the change, so e.g. the
> following code could be run:
>
> $display({ $sformatf("%d",int_var), $sformatf("%d", int_var) });
>
> Without the change, I was getting a message:
>
> error: Concatenation/replication may not have zero width in this
> context.
>
> Regards, Orson
>
> 1. https://github.com/steveicarus/iverilog/pull/88 2.
> https://github.com/orsonmmz/ivtest/tree/image_attr_test
>
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlaS78oACgkQrPt1Sc2b3imxgACg6hgll/mrSR7OqT1jqr4pjOOp
dxkAoOv5kHlkQRQLy9gbfh6AV8VLQlBJ
=qCSm
-----END PGP SIGNATURE-----
|
|
From: Stephen W. <st...@ic...> - 2015-12-07 18:12:06
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 First guess, I think the best would be to implement $sformatf. It is something that we would need anyhow. On 12/07/2015 08:52 AM, Maciej Sumi?ski wrote: > Hi, > > I am wondering what would be the right way to implement VHDL > 'image attribute, which returns a string representation of a > variable. > > The first idea is to use SV $sformatf system function, which > returns a string based on the formatting string (e.g. "%d" and > input data, but it is currently not available in Icarus. I could > add it, but as far as I know, the VPI standard does not allow to > write functions that return strings. > > What's your opinion? Should I extend VPI in Icarus to allow > returning strings or is there another, more elegant solution to the > problem? > > Regards, Orson > > > > ------------------------------------------------------------------------------ > > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for > multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > > > > _______________________________________________ Iverilog-devel > mailing list Ive...@li... > https://lists.sourceforge.net/lists/listinfo/iverilog-devel > - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlZly+4ACgkQrPt1Sc2b3im7sACgzRDRyA8tZkjZ0wIuVtLpqMr2 vXgAn0DOH3qd291wbhZq1fKtIZnLorOU =d2S0 -----END PGP SIGNATURE----- |
|
From: Maciej S. <mac...@ce...> - 2015-12-07 20:49:18
Attachments:
signature.asc
|
True, I prefer to follow this way too. The thing is, $sformatf returns a string, which is seemingly impossible with the VPI interface. There are function types: vpiSysFuncInt, vpiSysFuncReal, vpiSysFuncTime and vpiSysFuncSized. I was wondering if adding vpiSysFuncString (in a separate header, so the original one is not polluted) is acceptable or is there any better method. Regards, Orson On 12/07/2015 07:11 PM, Stephen Williams wrote: > > First guess, I think the best would be to implement $sformatf. > It is something that we would need anyhow. > On 12/07/2015 08:52 AM, Maciej Sumi?ski wrote: >> Hi, > >> I am wondering what would be the right way to implement VHDL >> 'image attribute, which returns a string representation of a >> variable. > >> The first idea is to use SV $sformatf system function, which >> returns a string based on the formatting string (e.g. "%d" and >> input data, but it is currently not available in Icarus. I could >> add it, but as far as I know, the VPI standard does not allow to >> write functions that return strings. > >> What's your opinion? Should I extend VPI in Icarus to allow >> returning strings or is there another, more elegant solution to the >> problem? > >> Regards, Orson > > > >> ------------------------------------------------------------------------------ > > > Go from Idea to Many App Stores Faster with Intel(R) XDK >> Give your users amazing mobile app experiences with Intel(R) XDK. >> Use one codebase in this all-in-one HTML5 development environment. >> Design, debug & build mobile apps & 2D/3D high-impact games for >> multiple OSs. >> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > > > >> _______________________________________________ Iverilog-devel >> mailing list Ive...@li... >> https://lists.sourceforge.net/lists/listinfo/iverilog-devel > > > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > _______________________________________________ > Iverilog-devel mailing list > Ive...@li... > https://lists.sourceforge.net/lists/listinfo/iverilog-devel > |
|
From: Stephen W. <st...@ic...> - 2015-12-07 21:56:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hmm... I think the proper answer is to define in the sv_vpi_user.h a vpiStringFunc that is probably a value like 10 so that it is sure to not intefere with other declaration. I'd put it in the sv_vpi_user.h header file instead of the vpi_user.h header file so that it does not pollute the vpi_user.h name space. You are right that the SV standard doesn't have a code for string return values, but I think we want such things, and absent any other standard on the matter, we can define what we want. It's either that, or start implementing DPI. Big job. On 12/07/2015 12:48 PM, Maciej Sumiński wrote: > True, I prefer to follow this way too. The thing is, $sformatf > returns a string, which is seemingly impossible with the VPI > interface. There are function types: vpiSysFuncInt, vpiSysFuncReal, > vpiSysFuncTime and vpiSysFuncSized. I was wondering if adding > vpiSysFuncString (in a separate header, so the original one is not > polluted) is acceptable or is there any better method. > > Regards, Orson > > On 12/07/2015 07:11 PM, Stephen Williams wrote: >> >> First guess, I think the best would be to implement $sformatf. It >> is something that we would need anyhow. On 12/07/2015 08:52 AM, >> Maciej Sumi?ski wrote: >>> Hi, >> >>> I am wondering what would be the right way to implement VHDL >>> 'image attribute, which returns a string representation of a >>> variable. >> >>> The first idea is to use SV $sformatf system function, which >>> returns a string based on the formatting string (e.g. "%d" and >>> input data, but it is currently not available in Icarus. I >>> could add it, but as far as I know, the VPI standard does not >>> allow to write functions that return strings. >> >>> What's your opinion? Should I extend VPI in Icarus to allow >>> returning strings or is there another, more elegant solution to >>> the problem? >> >>> Regards, Orson >> >> >> >>> ------------------------------------------------------------------------------ >> >> >> >>> Go from Idea to Many App Stores Faster with Intel(R) XDK >>> Give your users amazing mobile app experiences with Intel(R) >>> XDK. Use one codebase in this all-in-one HTML5 development >>> environment. Design, debug & build mobile apps & 2D/3D >>> high-impact games for multiple OSs. >>> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 >> >> >> >>> >>> _______________________________________________ Iverilog-devel >>> mailing list Ive...@li... >>> https://lists.sourceforge.net/lists/listinfo/iverilog-devel >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Go from Idea to Many App Stores Faster with Intel(R) XDK >> Give your users amazing mobile app experiences with Intel(R) >> XDK. Use one codebase in this all-in-one HTML5 development >> environment. Design, debug & build mobile apps & 2D/3D >> high-impact games for multiple OSs. >> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 >> _______________________________________________ Iverilog-devel >> mailing list Ive...@li... >> https://lists.sourceforge.net/lists/listinfo/iverilog-devel >> > > > > ------------------------------------------------------------------------------ > > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for > multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > > > > _______________________________________________ Iverilog-devel > mailing list Ive...@li... > https://lists.sourceforge.net/lists/listinfo/iverilog-devel > - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlZmAIUACgkQrPt1Sc2b3imLYQCgvbkuGBSbOBNIjnw++Yr+foRn St0AnRWTrvLWJ9nHGkSngBI5xpm+MJuY =eogv -----END PGP SIGNATURE----- |
|
From: Cary R. <cy...@ya...> - 2015-12-08 06:23:23
|
It should probably be a private (Icarus specific define) like some of the ones in vpi_user.h and I agree it should be in the SV header file. The value should be way outside the range of the other return values to allow SV room to implement this, the two states variables, etc. that SV supports and not conflict.
Cary
On Monday, December 7, 2015 1:56 PM, Stephen Williams <st...@ic...> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hmm... I think the proper answer is to define in the sv_vpi_user.h
a vpiStringFunc that is probably a value like 10 so that it is sure
to not intefere with other declaration. I'd put it in the sv_vpi_user.h
header file instead of the vpi_user.h header file so that it does not
pollute the vpi_user.h name space.
You are right that the SV standard doesn't have a code for string
return values, but I think we want such things, and absent any other
standard on the matter, we can define what we want.
It's either that, or start implementing DPI. Big job.
On 12/07/2015 12:48 PM, Maciej Sumiński wrote:
> True, I prefer to follow this way too. The thing is, $sformatf
> returns a string, which is seemingly impossible with the VPI
> interface. There are function types: vpiSysFuncInt, vpiSysFuncReal,
> vpiSysFuncTime and vpiSysFuncSized. I was wondering if adding
> vpiSysFuncString (in a separate header, so the original one is not
> polluted) is acceptable or is there any better method.
>
> Regards, Orson
>
> On 12/07/2015 07:11 PM, Stephen Williams wrote:
>>
>> First guess, I think the best would be to implement $sformatf. It
>> is something that we would need anyhow. On 12/07/2015 08:52 AM,
>> Maciej Sumi?ski wrote:
>>> Hi,
>>
>>> I am wondering what would be the right way to implement VHDL
>>> 'image attribute, which returns a string representation of a
>>> variable.
>>
>>> The first idea is to use SV $sformatf system function, which
>>> returns a string based on the formatting string (e.g. "%d" and
>>> input data, but it is currently not available in Icarus. I
>>> could add it, but as far as I know, the VPI standard does not
>>> allow to write functions that return strings.
>>
>>> What's your opinion? Should I extend VPI in Icarus to allow
>>> returning strings or is there another, more elegant solution to
>>> the problem?
>>
>>> Regards, Orson
>>
>>
>>
>>> ------------------------------------------------------------------------------
>>
>>
>>
>>>
Go from Idea to Many App Stores Faster with Intel(R) XDK
>>> Give your users amazing mobile app experiences with Intel(R)
>>> XDK. Use one codebase in this all-in-one HTML5 development
>>> environment. Design, debug & build mobile apps & 2D/3D
>>> high-impact games for multiple OSs.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
>>
>>
>>
>>>
>>>
_______________________________________________ Iverilog-devel
>>> mailing list Ive...@li...
>>> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
Go from Idea to Many App Stores Faster with Intel(R) XDK
>> Give your users amazing mobile app experiences with Intel(R)
>> XDK. Use one codebase in this all-in-one HTML5 development
>> environment. Design, debug & build mobile apps & 2D/3D
>> high-impact games for multiple OSs.
>> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
>> _______________________________________________ Iverilog-devel
>> mailing list Ive...@li...
>> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>>
>
>
>
> ------------------------------------------------------------------------------
>
>
Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for
> multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
>
>
>
> _______________________________________________ Iverilog-devel
> mailing list Ive...@li...
> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlZmAIUACgkQrPt1Sc2b3imLYQCgvbkuGBSbOBNIjnw++Yr+foRn
St0AnRWTrvLWJ9nHGkSngBI5xpm+MJuY
=eogv
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Iverilog-devel mailing list
Ive...@li...
https://lists.sourceforge.net/lists/listinfo/iverilog-devel
|