I've seen several posts by people who are trying to write programs in HDL. I'd like to offer the following, hopefully useful, perspective.
HDL is not a programming language, it's a soldering iron!
The IN and OUT statements tell what pins are available on the IC that you are designing. Users of this new IC will be able to solder wires to these pins, but not to any of its internal wiring.
The PARTS section tells how to solder together the internal parts of this new IC, and which internal parts' pins connect to the IC's pins. These are not function calls; they are soldering instructions. The identifiers are not variables; they are wire names (colors, if you will). You may have more than one wire connected to a part's output. The order that you solder your wires does not matter.
Consider wiring this circuit for "Bob":
+-----------------------+ | Bob | | +-----+ +-----+ | | | Foo | | Bar | | pin1 >--->a c>--->q s>---> pin3 | | | | | | pin2 >--->b d>-*->r | | | | | | | | | | +-----+ | +-----+ | | | | | +-----------> pin4 | | +-----------------------+CHIP Bob {
Free forum by Nabble | Edit this page |