Forum Discussion

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

address decoding in vhdl

hello,

I have a soft-core processor and an uart. in order to send the data from output of the processor to the input of uart vhdl module, i'm thinking that i need address decoding to writes the data into uart?? am i right?? but to do the address decoding in vhdl, i dont have any idea how to write it..can someone guide me on how to do this ?? Thx very much

regard,

bruno

18 Replies

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

    --- Quote Start ---

    where should i define my uart address?? in my uart_serial.vhd??

    --- Quote End ---

    You don't need to define uart_address. A uart doesn't need an address, right? The addresses are from the processor. A peripheral to a processor needs an address.

    So we have double whammy here :). Question: There are address lines coming from a processor but our peripheral/device has no port which looks like an address line. What do we do? Answer: Use some enable signal like chip_select or tx_enable which kicks off the peripheral to work as an equivalent to an address line.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    there is blockram instantiated in my zpu_core.vhd. does this decoder take out one by one the data in the blockram(in attachment)?? can you give me examples of chip_select?? out_mem_addr(14 downto 0)="00000000000000", then

    chip_select='1'?? am i right??

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

    --- Quote Start ---

    there is blockram instantiated in my zpu_core.vhd. does this decoder take out one by one the data in the blockram(in attachment)??

    --- Quote End ---

    I can't say. You will have to simulate the design and verify. The decoder is meant to decode the addresses of the processor not that of a memory. A good reading of processor basics should clear your doubts: http://en.wikipedia.org/wiki/microprocessor

    --- Quote Start ---

    can you give me examples of chip_select??

    --- Quote End ---

    Some good examples can be the select lines of a mux, enable lines of a counter and CS signals of external memories.

    --- Quote Start ---

    out_mem_addr(14 downto 0)="00000000000000", then

    chip_select='1'?? am i right??

    thx

    --- Quote End ---

    No. The address should be that of a processor.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hello vizzie,

    i just realized that rs232 cant handle 31 bits. mem_write is 32 bits width. that means what comes out of my address decoder is also 32 bits width. tx_data_in must not be more than 8 bits..do you have any idea on this?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    hello vizzie,

    i just realized that rs232 cant handle 31 bits. mem_write is 32 bits width. that means what comes out of my address decoder is also 32 bits width. tx_data_in must not be more than 8 bits..do you have any idea on this?

    --- Quote End ---

    I suppose you mean you have 32 bits data bus from the processor and the device data width is only 8-bits (right?). If there are no specific bus-arbitration rules in zpu (which appears to be true), then what abt connecting the least significant 8-bits of data-bus to tx_data_in?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    that means, if i only use the 8 least significants bit, will i have the same output data as before??

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

    --- Quote Start ---

    that means, if i only use the 8 least significants bit, will i have the same output data as before??

    --- Quote End ---

    Yes I believe so, though you must check this out.