wishbone address bits


keesj

Recommended Posts

Hi,

I am having some issues understanding the wishbone addressing used. I  taking the UART as example

My main question is "what bit is wb_adr_i(2)" in the initial wishbone_in?

https://github.com/GadgetFactory/DesignLab_Examples/blob/master/libraries/ZPUino_Wishbone_Peripherals/COMM_zpuino_wb_UART.vhd#L251

 

100 bits of wishbonne: wishbone_in : in std_logic_vector(100 downto 0);

25? bits of wb_address: signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits)

map wishbone bit 3 to???  wb_ard_1 wb_adr_i <= wishbone_in(27 downto 3);

case wb_adr_i(2)   is ?

 

 

 

Link to comment
Share on other sites

Having talked with a few people about this I think the code would better be rewritten as
 

signal wb_adr_i: std_logic_vector(23 downto 0);

then case wb_adr_i(0) becomes the first bit

It is possible that the bits 23 downto 19 or contain the  wishbone address?

Link to comment
Share on other sites

I would guess the reason for the "downto 2" is that the bus address is in word (32 bit) units while the addresses seen by code are in byte (8 bit) units.  Thus, with "26 downto 2", the numbers of the bits more closely correspond with the processor address space, i.e. wb_adr_i(10) will be byte 1024 (2**10).

At least that's why I did the equivalent in my own 32 bit design.

 

Link to comment
Share on other sites

12 hours ago, Jaxartes said:

would guess the reason for the "downto 2" is that the bus address is in word (32 bit) units while the addresses seen by code are in byte (8 bit) units.  Thus, with "26 downto 2", the numbers of the bits more closely correspond with the processor address space, i.e. wb_adr_i(10) will be byte 1024 (2**10).

At least that's why I did the equivalent in my own 32 bit design.

Hi, I can see how this might be useful if you want word aligned memory access indeed. In the example I posted above only a single bit is used to discriminate so I think something else might be going on.

https://github.com/GadgetFactory/DesignLab_Examples/blob/master/libraries/ZPUino_Wishbone_Peripherals/COMM_zpuino_wb_UART.vhd#L251

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.