We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome,
Firefox,
Internet Explorer 11,
Safari. Thank you!

AR# 3205

Description

Keywords: Foundation, F1.4, Simulation, Bus, Flatten, Combine

Urgency: Standard

Description:

When simulating a bus signal, if it is first flattened from the menu selection (Signal->Bus->Flatten) and then recombined (Signal->Bus->Combine), the bit order appears to be reversed. (i.e. the most significant bit becomes the least significant bit, and the least significant bit becomes the most significant bit).

This appears to produce incorrect simulation results.

Solution

The confusion lies in the function of the Flatten and Combine options. Bus -> Flatten actually breaks the bus. After you have peformed a Bus -> Flatten, the bus is no longer a bus. When you perform Bus -> Combine, it creates the bus. When the bus is Combined, the bit order is determined by the order in which the signals are listed in the Simulator window. The top-most bit becomes the LSB. Note that even if BIT7 is on top, and BIT0 on the bottom of the list, BIT7 is the LSB after you do a Bus -> Combine.

The function which you probably want to use in this case (rather than Bus -> Flatten and Bus -> Combine) is the Buses icon in the toolbar which looks like a sideways fork. This icon performs the function of simply expanding and collapsing the bus to be able to VIEW the individual bits. This is different than the Bus -> Flatten and Bus -> Combine which actually break and create the bus. With the Buses icon, the bus always remains a bus, but what changes is the view of it, ie, whether you see it as a bus or as indivual bits.

In case the bit order or your bus has been switched, (by inadvertantly using the Bus -> Flatten, Bus -> Combine) you can restore the correctorder by selecting: