Exploring more advanced SystemVerilog constructs
We’ve used many basic constructs in our designs. The syntax we’ve used is enough to construct anything you would like to design. There are some other design constructs, that can be useful, so I’d like to at least introduce them with an example of how to use them. The most useful construct is the interface.
Interfacing components using the interface construct
SystemVerilog interfaces can be thought of as modules that extend across other modules. An interface in its simplest form is a bundle of wires, very much like a structure. However, unlike a structure, the direction of each individual signal is independent, meaning that you can have both inputs and outputs defined within the interface.
I’ve created a project to show our PS/2 Host interface, ps2_host,
implemented using an interface: https://github.com/PacktPublishing/The-FPGA-Programming-Handbook-Second-Edition/blob/main/CH14/SystemVerilog/build...