Multiplexer Index

Discussion in 'VHDL' started by woko, Aug 3, 2005.

  1. woko

    woko Guest

    Hi! I have to design a FPGA with lots of registers read/writeable by a
    cpu. So far I had only a few registers and for read access there was a
    "case" multiplexer implemented. (see example case)

    Because now I have around 60 registers there would be 60 entries in the
    "case", I would like to have it indexed. As you can see I wrote a
    simple index code (example index) which could be compiled by the xilinx
    ise but I did not check both if they really work.

    The thing is: the index method uses much less units in the fpga as the
    case method. (case around 768 slices, index around 1004 slices)
    Is there a way I can achieve the same usage of logic with case style?
    I guess it could depend on the synthesize tool, but I don't want to
    hear that because I won't get any other...

    regards,

    Wolfgang Kopp


    example case:
    pDatamux: process (sA, Pwm(0).Reg, Pwm(1).Reg, Pwm(2).Reg)
    begin
    case sA is
    when X"4" => sDo <= Pwm(1).Reg;
    when X"8" => sDo <= Pwm(2).Reg;
    when others => sDo <= Pwm(0).Reg;
    end case;
    end process;


    example index:
    signal sDo :std_logic_vector (10 downto 0);
    signal AIndex : integer range 0 to cREGISTER;
    begin

    Reg(0).Dout <= conv_std_logic_vector(cVersion, 11);

    AIndex <= conv_integer((sAdr - cREG_BASE))/2;
    sDo <= Reg(Aindex).Dout;
    woko, Aug 3, 2005
    #1
    1. Advertising

  2. woko

    Andy Peters Guest

    woko wrote:
    > Hi! I have to design a FPGA with lots of registers read/writeable by a
    > cpu. So far I had only a few registers and for read access there was a
    > "case" multiplexer implemented. (see example case)
    >
    > Because now I have around 60 registers there would be 60 entries in the
    > "case", I would like to have it indexed. As you can see I wrote a
    > simple index code (example index) which could be compiled by the xilinx
    > ise but I did not check both if they really work.
    >
    > The thing is: the index method uses much less units in the fpga as the
    > case method. (case around 768 slices, index around 1004 slices)
    > Is there a way I can achieve the same usage of logic with case style?
    > I guess it could depend on the synthesize tool, but I don't want to
    > hear that because I won't get any other...


    I suppose you could implement your registers in RAMs, but that might
    not be practical for your design if you need immediate access to all of
    the registers all of the time.

    -a
    Andy Peters, Aug 4, 2005
    #2
    1. Advertising

  3. woko

    woko Guest

    > I suppose you could implement your registers in RAMs, but that might
    > not be practical for your design if you need immediate access to all of
    > the registers all of the time.
    >
    > -a

    This would be a possible solution for some of the registers. I could
    place the PWM compare values in the RAM and periodically query them in
    between one PWM clock, which is just about 1us.
    But I would like to keep it simple as long as I have enough distributed
    RAM in my FPGA.
    cheers,
    Wolfgang Kopp
    woko, Aug 5, 2005
    #3
    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. Lily
    Replies:
    6
    Views:
    4,691
    Eric Smith
    Apr 29, 2004
  2. bxbxb3

    Big multiplexer?

    bxbxb3, Apr 15, 2005, in forum: VHDL
    Replies:
    5
    Views:
    774
    bxbxb3
    Apr 19, 2005
  3. Weng Tianxiang
    Replies:
    12
    Views:
    1,616
  4. john

    Multiplexer

    john, Jun 14, 2006, in forum: VHDL
    Replies:
    20
    Views:
    3,407
    Andy Peters
    Jun 22, 2006
  5. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    275
    Tomasz Chmielewski
    Mar 4, 2008
Loading...

Share This Page