VHDL sharing components?

Discussion in 'VHDL' started by Matt Johnson, Oct 18, 2013.

  1. Matt Johnson

    Matt Johnson Guest

    I'm not sure if this is possible, as I haven't been able to think of a way to do it with my limited knowledge of VHDL.

    I'm making a 4-stage processor (fetch, decode, execute, writeback) in VHDL for a class project. Each of the different stages are supposed to be different VHDL files.

    I've put my registers as a component in the execute stage. In my writeback stage, I'm supposed to modify register values with the output of my ALU which is in the execute stage. If my registers are a component of the execute stage, is it possible to share that component with the writeback stage to edit the values? I'm not sure how to approach this...
     
    Matt Johnson, Oct 18, 2013
    #1
    1. Advertising

  2. Matt Johnson

    GaborSzakacs Guest

    Matt Johnson wrote:
    > I'm not sure if this is possible, as I haven't been able to think of a way to do it with my limited knowledge of VHDL.
    >
    > I'm making a 4-stage processor (fetch, decode, execute, writeback) in VHDL for a class project. Each of the different stages are supposed to be different VHDL files.
    >
    > I've put my registers as a component in the execute stage. In my writeback stage, I'm supposed to modify register values with the output of my ALU which is in the execute stage. If my registers are a component of the execute stage, is it possible to share that component with the writeback stage to edit the values? I'm not sure how to approach this...


    You don't really want to "share a component." What you want is to
    provide a port for writing the register file. That is you need to
    look at your registers like a RAM that has address, data write enable
    pins. If the registers physically exist in one module, then you need
    to make these signals ports so they can be accessed by another module.
    The registers themselves, and the process to write and read them
    are all in one module.

    It really helps to start by drawing a simplified block diagram of
    your system and figure out what signals you need to pass between
    the various modules. Then define what the requirements are for
    the signals, for example how the "RAM" gets written - when does
    the write data need to be valid with respect to the write enable,
    clock, etc.

    It's much harder to start writing VHDL right away and trying to
    work from a bottom-up approach. Many seasoned veterans of logic
    design may prefer to work that way, but it's only possible because
    they start with a good idea of the system and its interconnect
    requirements.

    --
    Gabor
     
    GaborSzakacs, Oct 18, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. boku
    Replies:
    2
    Views:
    18,636
    David R Brooks
    Apr 28, 2005
  2. Moikel
    Replies:
    6
    Views:
    2,081
    Brian Drummond
    Feb 11, 2006
  3. Mickey Segal
    Replies:
    0
    Views:
    913
    Mickey Segal
    Feb 2, 2004
  4. afd
    Replies:
    1
    Views:
    8,414
    Colin Paul Gloster
    Mar 23, 2007
  5. Vagant
    Replies:
    2
    Views:
    505
Loading...

Share This Page