Hello everyone,
After receiving a question about the use of generate statements for Project 4, we have decided to not allow them for this project. Generate statements are a sort of meta-programming you can do in Verilog, to "lay down" gates or modules programatically. This can be useful when a module you design must consist of many copies of the same module with different port connections, such as the FA modules in a larger adder. However, the use of generate statements has several significant drawbacks, leading to us not allowing you to use them in Project 4:
- The use of generate statements causes students to think flat, instead of hierarchically. We want you all to learn how to manage complex designs of medium-to-large size, and generate statements tend to encourage students to make flat designs. For the FA example above, consider making and using 4-bit adder sub-blocks to build your larger-width adder, instead of using dozens of FA modules directly. This will save you lots of debugging and verification time.
- Compiler support for generate statements is not as reliable as you would hope for, and we have spent many hours this semester helping students with debugging their generate statements, due to compiler errors/warnings and odd behavior.