??? 10/22/07 20:23 Read: times |
#146019 - re: Them two ways Responding to: ???'s previous message |
Andy said:
Anyways, there is a school of thought that says that all synchronous assignments in a module should be done in one big always block. I don't agree with that, as it makes maintenance difficult. Okay. So I think I hear you saying that the OneWay vs. AnotherWay choice really is mostly just a matter of style. So far, I've been tending towards the everything-in-one-always-block myself, no doubt in part because my modules to date have been so very small. I can see where the separate always blocks might help in larger modules. Although I suppose that it's a good idea to partition really big modules into smaller ones for the same reasons that it's a good idea to do the same with too-big subroutines in your favorite procedural programming language. Actually, this is one of the debates I've been having with myself in building the Morse code decoder. When I get it all done, it will be real interesting to hear the opinion of you experts about how I have partitioned it into modules. So far, mine have been running around 50-100 lines long, including what I would consider lots of comments. At this point I think I would get confused if they got much bigger, although I can see where an expert might get tired of writing module interface code after a while and want to just dive in and get the job done already. Andy said:
More important, naming a block (which does not have to be an always or initial block, it can be anything with begin/end) creates a local scope in which you can create local variables. You can also disable a named block (useful in simulation, not available in synthesis), which causes execution of the block to terminate. Aha. Thank you. More reading for Russell! -- Russ |