Forum Discussion

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

Exporting the qsys address map

Does anyone know a way of exporting the 'address map' information from qsys (eg as a .csv file) so that it can be analysed in a sensible tool?

7 Replies

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

    Open an emdedded shell and type

    sopc-create-header-files soc_system.sopcinfo --module hps_0 --single system.h

    will create a header file with the qsys components except the hps.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I've gone looking for such things in the past myself. I think it doesn't exist. I just went digging through all the build products of this morning's generation, the only thing that seems to have any finished address information in it is the memory map table in the HTML. I suppose a sufficiently desperate man could try to scrape that with BeautifulSoup or something, but it would be held together pretty touchily.

    There's definitely this idea with all the Qsys stuff that whatever tools Altera is willing to provide, in whatever beta state they may be, are all the tools anyone might ever want, and that there's no reason to have any sort of external API to it.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The address map is exported in the .sopcinfo file, which is XML. Look for the string 'baseAddress' and 'span' to get your bearings.

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

    AFAICT a lot of the tools are designed to make the tutorials (and courses) easy - but not really useful.

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

    Your first request was for the information to be "analysed in a sensible tool", which I think XML fits that description.

    Human readable? I think the answer to that question is "no, it is not available" and your best bet would be creating a fake BSP and pulling the system.h that gets generated.

    Getting the information you asked about out of the XML is pretty easy, even if you don't know anything about XML or scripting with XML by following a random tutorial.

    Here is an XSLT that dumps comma-delimited baseAddress and span of all the slaves connected to 'jtag_avalon_master_0'.

    
    <xsl:stylesheet version="1.0"
    		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <xsl:for-each select="/EnsembleReport/module/interface/memoryBlock">
          <xsl:value-of select="name"/>, <xsl:value-of select="baseAddress"/>, <xsl:value-of select="span"/>,
        </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>