-
Notifications
You must be signed in to change notification settings - Fork 1
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
The out_match is not right #1
Comments
I'm not sure what you mean by "the out_match has no data after out_valid." If you were expecting vhdre to tell you where the match was or report back exactly which bytes/characters matched then I'm afraid I'll have to disappoint you: the generated architecture fundamentally can't do that. Among other things, you'd need to be able to buffer the incoming string somehow to do that, which becomes very complicated very fast on an FPGA and therefore would cost a lot of area and performance. I'm sure there are (commercially licensed) IP cores that can do it, but they will require much more area than vhdre and will probably run at a lower clock frequency. IMO, if you need match information beyond yes/no, it's probably more cost-efficient to just use a CPU implementation (but of course it depends on the use case). You could still use vhdre in combination with such a software implementation as a pre-filtering step, such that the software implementation only checks strings that are already known to match the regex. You'd probably need some application-specific buffering logic outside of vhdre to align the string stream with the match output and discard the unmatched strings, but it could be done. Just to be sure, this is what I did to implement your example (and to refresh my memory; it's been almost two years since I last looked at this project):
I'm running Linux and have no simulator licenses available to me right now, so I have to resort to ghdl + gtkwave, but obviously the simulation software shouldn't matter;
You can ignore the "test suite failed" if you're following along with simulating the model this way; it's just because vhdeps expects testbenches to terminate automatically, and the generated testbench isn't smart enough to do that. It should open gtkwave regardless, which after some messing around with adding signals and finding the right timestamp should give you something like this: The two cycles with |
Thanks !! I get what you are saying, sorry I thought |
Could you provide a working example or a command ? I tried to generate simple regex "ab" with test "ab", the out_match has no data after out_valid.
The text was updated successfully, but these errors were encountered: