Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: creating custom multiple registers

  1. #11
    Join Date
    Nov 2017
    Posts
    10
    Rep Power
    1

    Default Re: creating custom multiple registers

    Hi,

    Sorry I attached the wrong VHD file for the avalon interface. Here it is,

    LIBRARY ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;
    use ieee.std_logic_signed.all;




    ENTITY reg16_avalon_interface IS
    PORT ( clock, resetn : IN STD_LOGIC;
    read, write, chipselect : IN STD_LOGIC;
    writedata : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
    byteenable : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
    readdata : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
    address: IN Std_Logic_Vector(3 downto 0);
    Q_export : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) );
    END reg16_avalon_interface;






    ARCHITECTURE Structure OF reg16_avalon_interface IS
    type reg_type is array (16 downto 0) of std_logic_vector (31 downto 0);
    SIGNAL local_byteenable : STD_LOGIC_VECTOR(3 DOWNTO 0);
    SIGNAL to_reg, from_reg : reg_type;




    COMPONENT reg16
    PORT ( clock, resetn : IN STD_LOGIC;
    D : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
    byteenable : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
    Q : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) );
    END COMPONENT;


    BEGIN
    to_reg(to_integer(unsigned(address))) <= writedata;
    WITH (chipselect AND write) SELECT
    local_byteenable <= byteenable WHEN '1', "0000" WHEN OTHERS;
    reg_instance: reg16 PORT MAP (clock, resetn, to_reg(to_integer(unsigned(address))), local_byteenable, from_reg(to_integer(unsigned(address))));
    readdata <= from_reg(to_integer(unsigned(address)));
    Q_export <= from_reg(to_integer(unsigned(address)));
    END Structure;


    I think I am going wrong with the way I am specifying the address signal. But I am not entirely sure how to implement this.



    -Smruthi

  2. #12
    Daixiwen is offline Moderator **Forum Master**
    Join Date
    May 2008
    Location
    Norway
    Posts
    4,550
    Rep Power
    1

    Default Re: creating custom multiple registers

    I think you are complicating your code, you should only need one array. I'd advise you to either run your code in a simulator or use signaltap to see exactly what is happening.
    Definition of a man-year: 730 people trying to finish the project before lunch

  3. #13
    Join Date
    Nov 2017
    Posts
    10
    Rep Power
    1

    Default Re: creating custom multiple registers

    Okay, thank you for the promt replies!

Similar Threads

  1. Need help writing timequest constraint(s) for multiple registers
    By bobyost in forum Quartus II and EDA Tools Discussion
    Replies: 0
    Last Post: April 2nd, 2013, 10:45 AM
  2. Error: connection between multiple registers with the same bus
    By GBernardi in forum Quartus II and EDA Tools Discussion
    Replies: 0
    Last Post: March 4th, 2013, 09:21 AM
  3. “Cannot convert all sets of registers into RAM megafunctions when creating nodes.”
    By saber890 in forum Quartus II and EDA Tools Discussion
    Replies: 4
    Last Post: December 14th, 2011, 10:16 PM
  4. Creating pipeline registers
    By Inebas in forum General Altera Discussion
    Replies: 0
    Last Post: October 4th, 2008, 09:41 AM
  5. creating memory of registers
    By domaj in forum Quartus II and EDA Tools Discussion
    Replies: 1
    Last Post: June 15th, 2008, 05:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •