Mux and Buses Have Different Functionality Depending On Which Level They're Demuxed / Selected
From Bugzilla ticket #998
Jeff Kissell: 2016-03-28 15:01:52 PDT
While attempting to use a bus to cull together signals at the top level of the model, tag them, then send the tag into the first-level sub-block of the model, and separate them in that level, I find different functionality between mux parts and bus parts.
The bus has the advantage of being able name signals and reorder them as necessary, so I started with using that. However, unbussing one level down throws back connection errors (and those errors are difficult to parse).
Joe suggests if I just replace the but with a mux, it works. While this is an OK band-aid, it means I lose the functionality of being able to name and reorder signals.
What makes it further confusing:
- If you use a bus creator and selector system with an ADC part, you can unpack the bus at an arbitrarily deep level. This is done, for example, in the end-station PEM models.
- If you use a bus creator and selector system with any part, and unpack on the same level as the signals were bus, all works well. This is done, for example, in the top level of the SUS models, in the mid-levels of the ISI models, etc.
In summary,
- the bus and mux should either have exactly the same functionality (and essentially become the exact same part, and one could remove on or the other),
- if we must retain different functionality, they should be MUCH more clearly distinguishable (currently the only distinction is bus' little white bar),
- and the use-cases must be distinct and consistent given what parts can be / are plugged into it
If none of the above is possible, then at least but in a doc block in the CDS_PARTS library that explains the different uses, and make the RCG put out a more useful error to the command line suggesting that the problem is the mux / bus usage rather than some poorly connect / over written ADC channel.
Keith: 2016-03-29 14:15:33 PDT
Created attachment 186 [details] common ccodeio.h
Rolf: 2017-01-25 16:34:10 PST
Matlab uses different description fields for Muxes and Buses, so not a straight forward 'make them work the same'. I am looking into how to have the RCG connect buses between any/all levels of a model. I have developed a basic scheme with a prototype Python parser. Now need to figure out how to fit this schema into the RCG perl based parser.