diff options
| author | Stephen Twigg | 2016-04-27 16:46:23 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2016-05-04 01:28:50 -0700 |
| commit | 73e35c55c7a3f4be98432fd275e0e0ae7db76d46 (patch) | |
| tree | 7822b910dd81112e0f0c586e08beb18426f62197 /src/test/resources | |
| parent | 0ad47ff929aa084d6aff4d378b32968ef19b97c7 (diff) | |
Add HasId=Module|Data.suggestName, TransitName util
Often times the scala runtime reflection fails to find an appropriate
name for a given net. This commit tries to partially ameliorate the
issue by exposing a suggestName function onto HasId (i.e. Module, Data)
that the user can call to 'suggest' a name.
Only the first suggestion is taken so repeated calls to suggestName will
not change the name for that node. This type of name exposure is
slightly risky as there is a chance the same name is suggested in the
same namespace. Thus, naming within a Module occurs in two passes:
The suggestion phase is when the user calls suggestName, etc. Near the
'end,' the Module uses runtime reflection to suggest names as well.
The forcing phase is when all the nodes are run through and a name is
'forced' onto them, using the namespace to suggest alternatives if the
desired one is taken. If no suggestion is present, the default name is
T, as before.
Second, there is an issue that commonly comes up when a component
library creates intermediate logic and then only returns a piece, or
even a piece of a piece (like part of a module IO). Any names suggested
by the Module by reflection onto that return value are either lost or
not fully applied. This issue is resolved by TransitName. TransitName
attaches a hook to the suggestName function of a HasId. With that hook,
any time suggestName is called on the hooked ID, that name suggestion is
also applied to other nodes.
For example, if Queue(in) is called, then any attempts to name the
returned output DecoupledIO will actually translate to naming attempts
on the backing Queue.
Diffstat (limited to 'src/test/resources')
0 files changed, 0 insertions, 0 deletions
