-
Notifications
You must be signed in to change notification settings - Fork 277
Preprocessor doesn't differentiate between VUnit check() and other procedures of the same name #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The You will do fine without You can actually work around the lack of Note that the value of location preprocessing for check type of subprograms is lost if you are setup to stop the simulation on the first failing check. In that case the call stack will reveal the location of the call and how you got there. Location for logs still has a value. Finally, there is also an undocumented |
The same thing happens with slice assignments to signals with certain names.
|
A better parser is not enough. There also needs to be a semantic analys step where the function/procedure call is bound to a specific implementation based on type inference and scope. |
An alternative solution would be to have a separate preprocessor where the user would have to provide a separate location argument themselves such as: -- vunit_loc is a constant in a package, vunit_loc is replaced with the location information.
check(condition, vunit_loc); The preprocessing could be more robust since the |
@kraigher Yes, there has to be a balance between effort and added value and I feel that the two suggested improvements would add value with little effort. If we were to add proper parsing and semantic analysis in the future we could take this a step further but I think it safe to say that such additions wouldn't be driven by this functionality due to the high effort. It will be other values driving such development. Adding I would prefer to do the quicker fixes suggested above, leave this issue open and let this second idea mature for a while. Maybe there will be some more user input now that this issue has been opened. |
…Improved preprocessor to avoid assignments to array slices sharing name with a log or check subprogram. Fixed some lint issues. Related to #200
@rwmsmith @felixn I pushed a new release addressing your issues. The updated API for I haven't address aggregate assignments so something like (debug(31 downto 16), debug(15 downto 0)) := std_logic_vector'(x"deadbeef"); would still cause problems. For these cases you'll have to break the aggregate (or exclude I'll leave the issue open for a while to see if there are other issues concerning the preprocessing |
The VUnit pre-processor adds line number and filename arguments to the check() procedure calls. Unfortunately, it doesn't discriminate between VUnit's check() procedures and any other procedure / function of the same name, so it adds these parameters to all such procedures. This then causes compilation failures.
The same happens with log(), which in my case clashes with a function to calculate logarithms.
The text was updated successfully, but these errors were encountered: