|
From: Stephen W. <st...@ic...> - 2015-06-05 19:48:44
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 That shares the literal bits that are the time value, but it does not account for the semantics of time. If it did, it would scale time values to local units as they cross module boundaries. That is the crux of the problem that Orson is facing. On 06/05/2015 12:24 PM, Martin Whitaker wrote: > Stephen Williams wrote: >> You are pointing out a problem with VERILOG and not VHDL vs. >> Verilog. In Verilog, time values do not cross module boundaries >> through ports. Doing so will get you the headaches that you see. >> Fixing it will involve extending the verilog language. >> > The SystemVerilog committee has already done this for you. See > section 23.3.3 of 1800-2012: > > "Values of all data types on variables and nets can be passed > through ports. This is accomplished by allowing both sides of a > port connection to have assignment-compatible data types and by > allowing continuous assignments to variables." > > So it is now legal to declare: > > module m(input time t); > > You can also declare: > > module m(ref time t); > > which lets you share a common variable. > > Martin > > ------------------------------------------------------------------------------ > > _______________________________________________ > 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 iEYEARECAAYFAlVx/Q8ACgkQrPt1Sc2b3inIcACcC/7OfbA8m0H6rwnTEfM9373C wK8AnR6I3Ykl3pdzG8a/6OaodNWXMELG =fUjY -----END PGP SIGNATURE----- |