element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design MicroZed Vivado Design Issue
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 9 replies
  • Subscribers 342 subscribers
  • Views 1050 views
  • Users 0 members are here
Related

MicroZed Vivado Design Issue

raymadigan
raymadigan over 9 years ago

I am not sure what to do at this point.  I  have tried everything I can think of except a new MicroZed board.

I have a design that uses a custom AXI Lite IP.   Basically I want to allocate N registers and have N/2 be read/write and the other N/2 be read only.  The read only registers will be written to by my application. 

I have build the design and none of my changes have any effect when I run the application on my uZed.  I have commented out the entire process that writes the register to the AXI output pins.  This change has no effect on the application, it still runs as the original AXI Lite IP.

I have asked countless times in the Vivado, Design Entry, Zynq forums and nobody has an idea of how to overcome this problem.

I have a very very early uZed.  Is there any suggestions to overcome this issue.

Is there a test I can run to determine where the issue might be.

I have a very similar problem with an AXI Stream Master IP I am trying to build.

  • Sign in to reply
  • Cancel
Parents
  • raymadigan
    0 raymadigan over 9 years ago

    I did another test this morning to be sure that what I was reporting here was accurate.  I built a brand new hardware project that included the following:

    Zynq Processor
    Processor Reset
    AXI Interconnect with 1 master and one slave
    AXI Lite with 6 registers.

    I made no edits of any of the VHDL Exported the hardware and launched the SDK.

    I created the following program in the SDK:

    // Six Register attempt at 0x4300000
    int main()
    {
        init_platform();
        print("Hello World
    r");
        int BaseAddress = 0x4300000;
        int i = 0;
        int offset = 0;
        int foo = 0;
        int regCount = 6;
        // Set each register to its index.
        for (i = 0; i < regCount; i++)
        {
        tHWTESTONE_mWriteReg(&BaseAddress, offset, i);
        toffset += 4;
        }
        offset = 0;
        // Write the value of each index
        for (i = 0; i < regCount; i++)
        {
        tfoo = HWTESTONE_mReadReg(&BaseAddress, offset);
        toffset += 4;
        tprintf("Write Register %d: %d
    r", i, foo);
        }
        // Write to the register one past the number generated
        offset = regCount * 4;
        HWTESTONE_mWriteReg(&BaseAddress, offset, offset);
        // Read the register one past the number generated
        foo = HWTESTONE_mReadReg(&BaseAddress, offset);
        printf("Read Register %d: %d
    r", regCount, foo);
        offset = 0;
        // Read all the registers including the one past
        for (i = 0; i < regCount +1; i++)
        {
        tfoo = HWTESTONE_mReadReg(&BaseAddress, offset);
        toffset += 4;
        tprintf("Read Register %d: %d
    r", i, foo);
        }

        cleanup_platform();
        return 0;
    }

    The output from the program was:
    Hello World
    Write Register 0: 0
    Write Register 1: 1
    Write Register 2: 2
    Write Register 3: 3
    Write Register 4: 4
    Write Register 5: 5
    Read Register 6: 24
    Read Register 0: 0
    Read Register 1: 1
    Read Register 2: 2
    Read Register 3: 3
    Read Register 4: 4
    Read Register 5: 5
    Read Register 6: 24

    What we see here is that writing and reading past the last register works as any of the registers in the requested range.  Also, the writing of the register is not a wrap around into the original register range.  It is actually writing to where register 6 would be.  In the VHDL that was generated by the AXI Lite wizard the reading process is such that if a number past the end of the register bank  is read from the result should be zero, and it isn't.

    The VHDL is

    constant OPT_MEM_ADDR_BITS : integer := 2;

    -- Implement memory mapped register select and read logic generation
    -- Slave register read enable is asserted when valid address is available
    -- and the slave is ready to accept the read address.
    slv_reg_rden <= axi_arready and S_AXI_ARVALID and (not axi_rvalid) ;

    process (slv_reg0, slv_reg1, slv_reg2, slv_reg3, slv_reg4, slv_reg5, axi_araddr, S_AXI_ARESETN, slv_reg_rden)

        --  loc_addr is a 3 bit vector [2 down to 0]
        variable loc_addr :std_logic_vector(OPT_MEM_ADDR_BITS downto 0);
        begin
    t-- Address decoding for reading registers
            -- loc_addr := axi_araddr(2 + 2 downto 2);
            -- Not sure of the specifics, assume it returns 3 bits in the address
    tloc_addr := axi_araddr(ADDR_LSB + OPT_MEM_ADDR_BITS downto ADDR_LSB);
    tcase loc_addr is
    t    when b"000" =>
    t        reg_data_out <= slv_reg0;
    t      when b"001" =>
    t        reg_data_out <= slv_reg1;
    t      when b"010" =>
    t        reg_data_out <= slv_reg2;
    t      when b"011" =>
    t        reg_data_out <= slv_reg3;
    t      when b"100" =>
    t        reg_data_out <= slv_reg4;
    t      when b"101" =>
    t        reg_data_out <= slv_reg5;

                  -- for case b"110" and b"111"
    t      when others =>
    t        reg_data_out  <= (others => '0');
    t    end case;
    tend process;

    Registers 6 and 7 should be in the others clause of the case statement.
    The same is true for the write process.  I can only conjecture that the bitstream that is running on the MicroZed is not the same as that shown it the vhdl for the project. 

    Also, I cn change the base address in the main program to
    BaseAddress to 0x42000000 or to 0x60000000 I still get the same result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • raymadigan
    0 raymadigan over 9 years ago

    I did another test this morning to be sure that what I was reporting here was accurate.  I built a brand new hardware project that included the following:

    Zynq Processor
    Processor Reset
    AXI Interconnect with 1 master and one slave
    AXI Lite with 6 registers.

    I made no edits of any of the VHDL Exported the hardware and launched the SDK.

    I created the following program in the SDK:

    // Six Register attempt at 0x4300000
    int main()
    {
        init_platform();
        print("Hello World
    r");
        int BaseAddress = 0x4300000;
        int i = 0;
        int offset = 0;
        int foo = 0;
        int regCount = 6;
        // Set each register to its index.
        for (i = 0; i < regCount; i++)
        {
        tHWTESTONE_mWriteReg(&BaseAddress, offset, i);
        toffset += 4;
        }
        offset = 0;
        // Write the value of each index
        for (i = 0; i < regCount; i++)
        {
        tfoo = HWTESTONE_mReadReg(&BaseAddress, offset);
        toffset += 4;
        tprintf("Write Register %d: %d
    r", i, foo);
        }
        // Write to the register one past the number generated
        offset = regCount * 4;
        HWTESTONE_mWriteReg(&BaseAddress, offset, offset);
        // Read the register one past the number generated
        foo = HWTESTONE_mReadReg(&BaseAddress, offset);
        printf("Read Register %d: %d
    r", regCount, foo);
        offset = 0;
        // Read all the registers including the one past
        for (i = 0; i < regCount +1; i++)
        {
        tfoo = HWTESTONE_mReadReg(&BaseAddress, offset);
        toffset += 4;
        tprintf("Read Register %d: %d
    r", i, foo);
        }

        cleanup_platform();
        return 0;
    }

    The output from the program was:
    Hello World
    Write Register 0: 0
    Write Register 1: 1
    Write Register 2: 2
    Write Register 3: 3
    Write Register 4: 4
    Write Register 5: 5
    Read Register 6: 24
    Read Register 0: 0
    Read Register 1: 1
    Read Register 2: 2
    Read Register 3: 3
    Read Register 4: 4
    Read Register 5: 5
    Read Register 6: 24

    What we see here is that writing and reading past the last register works as any of the registers in the requested range.  Also, the writing of the register is not a wrap around into the original register range.  It is actually writing to where register 6 would be.  In the VHDL that was generated by the AXI Lite wizard the reading process is such that if a number past the end of the register bank  is read from the result should be zero, and it isn't.

    The VHDL is

    constant OPT_MEM_ADDR_BITS : integer := 2;

    -- Implement memory mapped register select and read logic generation
    -- Slave register read enable is asserted when valid address is available
    -- and the slave is ready to accept the read address.
    slv_reg_rden <= axi_arready and S_AXI_ARVALID and (not axi_rvalid) ;

    process (slv_reg0, slv_reg1, slv_reg2, slv_reg3, slv_reg4, slv_reg5, axi_araddr, S_AXI_ARESETN, slv_reg_rden)

        --  loc_addr is a 3 bit vector [2 down to 0]
        variable loc_addr :std_logic_vector(OPT_MEM_ADDR_BITS downto 0);
        begin
    t-- Address decoding for reading registers
            -- loc_addr := axi_araddr(2 + 2 downto 2);
            -- Not sure of the specifics, assume it returns 3 bits in the address
    tloc_addr := axi_araddr(ADDR_LSB + OPT_MEM_ADDR_BITS downto ADDR_LSB);
    tcase loc_addr is
    t    when b"000" =>
    t        reg_data_out <= slv_reg0;
    t      when b"001" =>
    t        reg_data_out <= slv_reg1;
    t      when b"010" =>
    t        reg_data_out <= slv_reg2;
    t      when b"011" =>
    t        reg_data_out <= slv_reg3;
    t      when b"100" =>
    t        reg_data_out <= slv_reg4;
    t      when b"101" =>
    t        reg_data_out <= slv_reg5;

                  -- for case b"110" and b"111"
    t      when others =>
    t        reg_data_out  <= (others => '0');
    t    end case;
    tend process;

    Registers 6 and 7 should be in the others clause of the case statement.
    The same is true for the write process.  I can only conjecture that the bitstream that is running on the MicroZed is not the same as that shown it the vhdl for the project. 

    Also, I cn change the base address in the main program to
    BaseAddress to 0x42000000 or to 0x60000000 I still get the same result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube