I understand that modules are essentially like c++ functions. However, I didn’t find something like a main() section that calls those functions. How does it work without a main() section?
I understand that modules are essentially like c++ functions. However, I didn’t find something
Share
Trying to find (or conceptually force) a main() equivalent in HDL is the wrong way to go about learning HDL — it will prevent you from making progress. For synthesisable descriptions you need to make the leap from sequential thinking (one instruction running after another) to “parallel” thinking (everything is running all the time). Mentally, look at your code from left to right instead of top to bottom, and you may realize that the concept of main() isn’t all that meaningful.
In HDL, we don’t “call” functions, we instantiate modules and connect their ports to nets; again, you’ll need to change your mental view of the process.
Once you get it, it all becomes much smoother…