Reputation: 49
I have been using VHDL for a while, and i found that , its more difficult to debug a VHDL design than to design it. Since processes are concurrent , its very difficult to know which part of the design has bugs.
Like C , where we can use some easy degugging rules like putting a printf statement to see the bug location, is there any simple tips and tricks to find such errors in VHDL.
Please also suggest me any website or do document , which can be used for the same.
Upvotes: 1
Views: 1051
Reputation: 71
Relative to other programming languages (such as C, Python, etc.), I actually find VHDL easier to debug. the language itself is rather simple, in the sense that it doesn't lend itself to creating complicated algorithms very easily. The secret to easy debugging, in my experience, is to keep modules as simple as possible, and combine them together to create complicated structures. this way, finding bugs gets easier.
Upvotes: 2
Reputation: 4374
This question is perhaps a bit vague, but here's a few things that I try to do to make designs easier to work on. It's opinion based, but does come from personal experience.
You can use simple assertions to catch some types of problem during simulation. Example:
if (rising_edge(clk)) then
assert (a /= b)
report "a and b should never be equal!"
severity error;
end if;
Similarly, you can use the report
statement on its own, to print out signal values. Example:
if (rising_edge(clk)) then
report "count is now " & integer'image(count);
end if;
Report
doesn't do anything in your compiled FPGA, it's only for simulation.
Upvotes: 7