Menu

Using TinyXml on a DSP

DavidA
2005-05-27
2013-05-20
  • DavidA

    DavidA - 2005-05-27

    Hi

    I would like to use TinyXml in a Digital Signal Processor application. The DSP that I am using represents a char by a 32-bit word, not by a byte as is usual on an x86 processor.  Might this cause a problem for TinyXml?

    Does anyone have experience of using TinyXml on a DSP?

    Best regards

    David

     
    • Ellers

      Ellers - 2005-05-28

      Not having done any work on a DSP the following may be useless...

      Firstly, you said "DSP Application" - do you mean a software app, or hardware? 

      Windows/Linux are (mostly) 32 bit - its the C language that allows us to access 8-bit char's within each 32 bytes.

      I may be really missing what you mean here tho...

      HTH
      Ellers

       
    • DavidA

      DavidA - 2005-06-06

      Thanks for your reply. I have been away, hence my slow reply.

      >Firstly, you said "DSP Application" - do you mean a
      >software app, or hardware? 

      It is a software app.

      >Windows/Linux are (mostly) 32 bit - its the C language
      >that allows us to access 8-bit char's within each 32 bytes.

      >I may be really missing what you mean here tho...

      The issue is that the DSP's C compiler aligns each char on a 32-bit boundary, not an 8-bit boundary. This may not affect TinyXML at all, but it might. I guess the best way to proceed is for me to try it.

       
      • Ellers

        Ellers - 2005-06-06

        Cool so the DSP comes with its own C compiler? Cool.

        In that case it should be fine. IIRC TinyXml parses by using the C idiom

          char *pc
          while ( pc++ )...

        in other words, the char* should be incremented correctly.
        Give it a go and see what happens.
        Whether this is the best or most efficient is another question.

        Post back with what happens, I'm interested to know...

         
    • Yves Berquin

      Yves Berquin - 2005-06-06

      Just a question : are you sure your DSP compiler supports C++ completely ?
      One of the Texas' "C++" compiler, for example, doesn't support virtual inheritance ... which basically makes it nothing more than a C compiler, with support for a single first automatic parameter to a struct instance ...
      If this is the case, TinyXML will not compile.

       
    • DavidA

      DavidA - 2005-06-07

      Hi

      Firstly, I built and ran the test application (xmltest.cpp) with VisualC++ and it ran fine.

      Next, I used the Analog Devices' DSP C++ compiler (VisualDSP++) to target a TS201 TigerSHARC DSP. Here is part of the result:

      ...
          ** Bug regression tests **
          [pass] Test InsertBeforeChild on empty node. [1][1]
          [pass] Test InsertAfterChild on empty node.  [1][1]
          [pass] Basic TiXmlString test.  [Hello World!][Hello World!]
          [fail] Entity transformation: read.
          [fail] Entity transformation: write.
          [pass] dot in element attributes and names [0][0]
          [pass] Entity with one digit. [1][1]
          [pass] Entity with one digit. [1.1 Start easy ignore fin thickness
          ][1.1 Start easy ignore fin thickness
          ]
          [pass] Correct value of unknown. [!DOCTYPE PLAY SYSTEM 'play.dtd'][!DOCTYPE PLAY SYSTEM 'play.dtd']
          [pass] Comment formatting. [ Somewhat<evil> ][ Somewhat<evil> ]
          [pass] White space kept. [ This has leading and trailing space ][ This has leading and trailing space ]
          [pass] White space kept. [This has  internal space][This has  internal space]
          [pass] White space kept. [ This has leading, trailing, and  internal space ][ This has leading, trailing, and  internal space ]
          [pass] White space condensed. [This has leading and trailing space][This has leading and trailing space]
          [pass] White space condensed. [This has internal space][This has internal space]
          [pass] White space condensed. [This has leading, trailing, and internal space][This has leading, trailing, and internal space]
          [pass] Parsing repeated attributes. [0][0]
          [pass] Parsing repeated attributes. [blue][blue]
          [pass] Embedded null throws error. [1][1]
          [pass] ISO-8859-1 Parsing. [C nt nt       ][C nt nt       ]
          [pass] Empty document error TIXML_ERROR_DOCUMENT_EMPTY [13][13]
          [pass] Empty tinyxml string compare equal [1][1]
          [pass] Empty tinyxml string compare equal [1][1]
         
          Pass 74, Fail 2

      So there are only two failures. Are these anything to worry about?

      David

       
    • DavidA

      DavidA - 2005-06-09

      Hi

      There has been no reply to my previous post. Can anyone comment on why the failures below occur on the DSP please?

      ** Bug regression tests **
      [pass] Test InsertBeforeChild on empty node. [1][1]
      [pass] Test InsertAfterChild on empty node. [1][1]
      [pass] Basic TiXmlString test. [Hello World!][Hello World!]
      [fail] Entity transformation: read. 
      [fail] Entity transformation: write. 

      Thanks

      David

       
    • Lee Thomason

      Lee Thomason - 2005-06-09

      David --

      Hard question to answer without a lot more information about the DSP. A bug it the size of data types, perhaps? Incorrect int to char cast?

      The failures are significant. Failures in the entities will cause basic XML parsing problems in the field.

      sorry I can't tell you more,
      lee

       
    • DavidA

      DavidA - 2005-06-10

      Lee

      Thanks for your reply.

      >Hard question to answer without a lot more information >about the DSP. A bug it the size of data types, >perhaps? Incorrect int to char cast?

      Yes, I was not expecting you to debug the problem. However, if you can suggest where in the code to look that would be a great help. Otherwise, I can step through with a debugger.

      David

       
    • DavidA

      DavidA - 2005-06-23

      Hi

      Just to let you know that xmltest is now running succesfully on the TS201 DSP. In case anyone needs to know: it is necessary to set the char size to 8-bits to make it work (the default compiler setting is 32-bits).

      However, I have not succeeded in making it working with STL.

      I tried defining:

         #define TIXML_USE_STL
        
      but I got the compile time error:

      ".\xmltest.cpp", line 254: cc0349:  error: no operator "<<" matches these operands
                  operand types are: ostringstream << TiXmlDocument
        outputStream << doc;
                     ^

      Any suggestions how to fix this would be welcomed.

      David

       
      • Ellers

        Ellers - 2005-06-24

        The operator<< isn't being defined. Hmm. I can't remember the rules whether std::ostream is considered by the compiler equivalent to ostringstream. I thought it was, but I'm rusty with streams.

        In any case, check if this is being included in the compile from tinyxml.h

        friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);

        The easy way to test this would be to put say "!!foobar!!" or similar on the next line and see if you get a compile error.

        If it is being compiled then perhaps your compiler doesn't match ostream and ostringstream?

        Hope this helps - sorry its a bit indefinite.

        Ellers

         
    • DavidA

      DavidA - 2005-09-19

      Hi

      I would just like to report that I am successfully running TinyXml on a TI TMS320TCI100 (C64xx family) DSP with no modifications. It is worth noting that a good amount of stack (4kwords) and a large heap are required, which is a significant factor for embedded systems.

      Thanks for making TinyXml available!

      David

       
    • Lee Thomason

      Lee Thomason - 2005-09-20

      Excellent! Thanks for the feedback on the stack stuff. It's never really been optimized for memory use, but it is a worthwhile project.

      lee

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.