CDN Live EMEA 2013: Using the Extension Capability and the Reflection Interface of Specman/e for Automatic Memoization

Paper

Slides

The e hardware verification language provides a powerful macro-definition syntax which can be used to extend the language, i.e. create new constructs that have syntax checking, and the look-and-feel of built-in constructs. Furthermore, it has a reflection API to query and control the properties of simple and compound types and objects.

In this paper we will show how these mechanisms are used to create an automatic memoization macro for pure methods (in e, what is generally called a function is called a method, while function arguments are called parameters).

Memoization is an optimization technique that trades run-time for memory space. Run- time critical methods can be sped-up using caching: the input and output parameter values of a method call are saved in a lookup-table. Upon each call of the method, the input values are compared with the cached ones. In case of a match, the function will return the cached result instead of recalculating it. If the cost of the cache-lookup and update is lower than calculating the result, it might be beneficial to memoize the method.

( Thorsten Dworzak )


Created  
May 9, 2013