K
KJ
Guest
On Friday, August 12, 2016 at 1:12:48 PM UTC-4, Ilya Kalistru wrote:
Typically I have the package, entity and architecture all in the same file. There are cases where I've put the architecture in a separate file, I don't recall a single instance where the package and entity needed to be in separate files. But yes you still have to put that latency number change in.
What I do to 'remember' to make this package change is to put an assertion in to check that the actual latency through the module matches the number in the package. When the assertion fails, I suddenly 'remember' that the latency number needs to be updated...or sometimes that I've made an incorrect change to the algorithm.
The case of a constant (disregarding changes made during development) is easy, just put the number in the package. The more complex case where maybe the module has different, static ways of being used that are selected by entity generics simply means that the package should have a function that gets passed the values of the entity generics and uses those to compute the latency. To the user of the module, that means that yes they need to make sure that they use the same generics in the call to the function to determine the latency as they do when they instantiate the entity but once again, having an assertion in the architecture code that measures the actual latency and checks it to the expected latency as defined by the package function is the way that you can provide reasonable coverage of this type of misuse of the module.
Kevin Jennings
On Friday, August 12, 2016 at 5:39:36 PM UTC+3, Jim Lewis wrote:
I would put a constant in a package that is associated with a particular entity. As you do your detailed design and update the pipeline in a particular block, simply update the corresponding constant in the package - even better would be to use that constant to define the number of pipeline stages in the block.
Then any design that references the package can see the constant.
That's exactly what I've done. But when you are modifying the module you
have to remember that somewhere in a different file (package) there is a
constant you have to adjust according to you changes.
Typically I have the package, entity and architecture all in the same file. There are cases where I've put the architecture in a separate file, I don't recall a single instance where the package and entity needed to be in separate files. But yes you still have to put that latency number change in.
What I do to 'remember' to make this package change is to put an assertion in to check that the actual latency through the module matches the number in the package. When the assertion fails, I suddenly 'remember' that the latency number needs to be updated...or sometimes that I've made an incorrect change to the algorithm.
The case of a constant (disregarding changes made during development) is easy, just put the number in the package. The more complex case where maybe the module has different, static ways of being used that are selected by entity generics simply means that the package should have a function that gets passed the values of the entity generics and uses those to compute the latency. To the user of the module, that means that yes they need to make sure that they use the same generics in the call to the function to determine the latency as they do when they instantiate the entity but once again, having an assertion in the architecture code that measures the actual latency and checks it to the expected latency as defined by the package function is the way that you can provide reasonable coverage of this type of misuse of the module.
Kevin Jennings