This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LIB_CODE in *.m51 files

Hello,

I have a problem with extracting data from *.m51 to build simulator. There are some library code in *.m51, placed in segments:
LIB_CODE and LDIV.
I guess it's length and address depends on which KEIL *.lib files are used.
Do you have any idea what should I do when simulator comes to lib part? Is there a possibility to enter in library code and debug? I don't have a source of KEL lib files, and don't know their order in LIB_CODE segment..

Best regards,
Branislava

Parents
  • You mean you're building your own simulator?

    Wouldn't it be better to use the existing Keil simulator, and its AGSI to add your extensions??

    what is even more ridiculous is that he is building a simulator, if he is making a FPGA '51 he should make an emulator

    Surely, you don't need the map/listing files anyhow - what you need is the Debug Information that's contained in the Object File?
    That's what the Keil simulator uses, I'm sure!

    I have no ides what the simulator uses, but all emulators I know of use just the object file.

    Erik

Reply
  • You mean you're building your own simulator?

    Wouldn't it be better to use the existing Keil simulator, and its AGSI to add your extensions??

    what is even more ridiculous is that he is building a simulator, if he is making a FPGA '51 he should make an emulator

    Surely, you don't need the map/listing files anyhow - what you need is the Debug Information that's contained in the Object File?
    That's what the Keil simulator uses, I'm sure!

    I have no ides what the simulator uses, but all emulators I know of use just the object file.

    Erik

Children
  • "I have no ides what the simulator uses, but all emulators I know of use just the object file"

    Absolutely. The Linker Listing is just a human-readable presentation of the information in the Object file.
    The Object file contains all the necessary information in machine-readable form - so use it!
    Don't mess about with Listing files!

    The OMF51 spec is here: http://www.keil.com/download/docs/80.asp

  • Yes,objest file is enough for simulator, but not for debugger. Debugger needs *.lst file. The problem is entering source code under libraries (LIB_CODE).
    (Sorry, that I didn't mentioned debugger)

    Brana

  • Debugger needs *.lst file.

    No, it doesn't. If you don't trust, feel free to try for yourself: kill all the *.lst files from a Keil project, then run it in the Keil integrated debugger --- works like a charm.

  • if you need to see it in an emulator, load the CEIBO ICE code and try it. (it runs as a simulator when no hardware is connected.

    Erik

  • yes, KEIL debugger is working without *.lst file :)
    .. but we have "special request" to use lst (and still don't know would we get source code for simulator...)
    Thank you all..

    Brana

  • (and still don't know would we get source code for simulator...)

    I am sure there is some simulator where someone will sell you the source code. I can suggest a few.

    expecting someone that has invested time (= money) in coding a simulator to give it to for free you is silly.

    This "modern" idea "I want the best money can buy for free" does not make sense

    Erik

  • "but we have 'special request' to use lst"

    Why?
    Again: the OBJ is what you need, so use it!

    "know would we get source code for simulator"

    You don't need the source!
    Keil provides and interface whereby you can add your special features to the standard uVision Simulator - look up AGSI in the knowledgebase.

  • "Debugger needs *.lst file."

    As already noted, this is rubbish.

    The debugger, like the simulator, obtains its debug information from the Obj file.

    "The problem is entering source code under libraries (LIB_CODE)."

    The source code for the libraries is not provided, so nothing can help you there - not the Lst files, not the Obj file.
    The Simulator & Debugger don't just make up source code out of thin air. The Obj file contains Debug Information (provided you checked the option), and it is the Debug Information that allows the Simulator & Debugger to relate absolute program addresses to source code files & line numbers, and source code identifiers.

    One more time: the Debug Information is in the Obj file - that's why you need to use the Obj file!

  • Thank you for that information about *.obj file. I just want to say that I'm talking about 8051 core within FGPA design (it is specific because we have simulator (without the source code)for FPGA and have to build debugger for 8051).

  • <i.have to build debugger for 8051
    If you are talking about "live" debugging (as with an ICE) good luck, you will need it. If you are talking about simulating WHY?, keil has one, Juergen Wickenhauser has one, Vault has one, and more. Why reinvent the wheel?.


    Erik

  • "I'm talking about 8051 core within FGPA design"

    that shouldn't be a problem - the behaviour of the 8051 core should be unaffected.

    Therefore, you can use the standard Keil compiler which simulates a standard 8051 "core" - you can add your "special" features via the Advanced Generic Simulator Interface (AGSI).

    See Application Note 154, Implementing DLLs for User-defined Simulation (AGSI)
    http://www.keil.com/appnotes/docs/apnt_154.asp

    "...and have to build debugger for 8051."

    Again, no you don't. The behaviour of the 8051 "core" is (or should be!) standard - so you just use the standard debugger, via the Advanced Generic Debugger Interface (AGDI).
    See Application Note 145, Implementing DLLs for Hardware Debuggers (AGDI) Rev. 3
    http://www.keil.com/appnotes/docs/apnt_145.asp

    If you really must roll your own debugger, why not take a look as SDCC?
    It's open-source, and includes a debugger:
    http://sdcc.sourceforge.net/
    I think there's also a simulator.

    But, whatever you do, the .OBJ file is the place to look for your debug information - not the listings!

  • thank you.. but our business companions supply simulator (without the source code, which simulates all FPGA design) and ordered from us debugger for 8051 core, which should take information from *.lst and *.m51 files. Now we are having problems with that, especially when LIB code appears. Do you know where I can find KEIL *.lst file description ? (for exaple - LIB code parts are marked with 'E'..)

    Brana

  • ordered from us debugger for 8051 core, which should take information from *.lst and *.m51 files. Now we are having problems with that
    If you can not eductate your customer re the .omf/.bas files which (s)he can not avoid making (they DO have them) then it will cost you more to fulfil the contract than you can possibly make from it.

    Erik