What is interesting here is that some of these design errors can be completely prevented by use of sufficient type systems.
For example, register access in second case is a typical use case for (Haskell's) Either type. Yes, you get address. It either from Left (bus 1) or from Right (bus 2). By pattern matching you can decide an action to take.
For example, register access in second case is a typical use case for (Haskell's) Either type. Yes, you get address. It either from Left (bus 1) or from Right (bus 2). By pattern matching you can decide an action to take.