Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Combine/Map one bus onto another

Hello,

Would someone be able to explain how to combine bits from two different buses?

Say I had two buses Source[23..0] and Sink[21..0] - I want to map a number of bits from Source onto specific bits from Sink so:

Source[5..0] drives Sink[5..0] and

Source[13..8] drives Sink[11..6] and

Source[22..16] drives Sink[17..12]

I cannot change Sink as its width and configuration must remain as they are for part of the design to work.

Is there any way to do this without connecting every signal through Wires?

Thanks

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    it sounds like you might be using a .bdf? you might just write a little HDL file, create a .bsf from the file, and instantiate it in your .bdf

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    cool. one of the .bdf experts might know the best way to build the bus using wires/buses, but i figured a couple lines of HDL is faster and easier

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Source[5..0] drives Sink[5..0] and

    Source[13..8] drives Sink[11..6] and

    Source[22..16] drives Sink[17..12]

    --- Quote End ---

    Assuming you want to do this in the block editor, you can use wire symbols (found in the symbol selector under primitives/buffer) for this. Despite the name, they work with buses too, so you can have Source[13..8] going into a wire symbol and Sink[11.6] going out.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks rwestman,

    didn't think of that, I got thrown off by the name.