On Thursday 07 June 2012, Felix Salfelder wrote: > verilog uses a discrete time (uint64_t), while gnucap runs > with double (also 64 bit) time. unless time is really big, > it's no problem to schedule all the events of a verilog > device after converting to double. but then, i don't see why > gnucap does use double for the master time.
Using a double was the obvious choice originally, years ago. In a way, it still is but as you point out, sometimes an alternative non-obvious choice may be a better choice. Looking again, I could easily see defining a new type "TIME", following gnucap's convention of class names being all caps. This "TIME" needs to interface with double expressions like a double but could have a different representation inside. If you want to try it ... Initially typedef TIME to be double. Keep this as a reference for performance comparison. Then, define a class TIME that initially is just a double, but enforces strict type checking and adds a bit of overhead. You will need to add all of the access functions and operations so it can be used the same. Disable implicit conversions so you will catch all of the places it is used. Benchmark again to verify that you haven't messed it up. Now, you can change the representation under the hood to try alternative representations. _______________________________________________ Gnucap-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/gnucap-devel
