ZEsarUX beta 5.1

Emulator and emulator development specific topics
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZEsarUX beta 5.1

Post by marste »

An old request but that I hope to see realized sooner or later (or I'll try myself when I'll complete all debugging and enhancements setup): is possible to have a flag to write a profile dump file?

To explain better:

It would be really useful to understand which part of the program is executed the most in order to optimize it the most. I think this is quite general.

A simple counter of number of instruction fetched at instruction level would be enough. A more elaborate way would be to add (not substitute) also the T-States spent, but this is really not so important since if you look well it's enough clear, even if there are instruction with T-States that depends on operands.

It can be a simple array of 64K long integers, initialized to 0 at the beginning, with cells incremented during instruction fetch, and simply written to a text file at the program exit.

Cesar, what do you think about it?
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZEsarUX beta 5.1

Post by chernandezba »

marste wrote: Sat Oct 21, 2017 9:10 pm An old request but that I hope to see realized sooner or later (or I'll try myself when I'll complete all debugging and enhancements setup): is possible to have a flag to write a profile dump file?

Try Cpu transaction log (on debug menu) ;)
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZEsarUX beta 5.1

Post by chernandezba »

marste wrote: Sat Oct 21, 2017 8:56 pm The attachment is just to give you an idea of my use of trace and why I need a clean one.
This file is obtained with hexdump formatting and then imported into libreoffice.
Sorry I don’t understand what is this trace file about
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZEsarUX beta 5.1

Post by marste »

chernandezba wrote: Sun Oct 22, 2017 12:18 pm Try Cpu transaction log (on debug menu) ;)
I already did, time ago, but the result was a file of many gigabystes even for a very small computation, and it has to be post-processed to arrive to the identification of the number of execution of each instruction!...

Anyway it is surely a good candidate place for the change! :)
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZEsarUX beta 5.1

Post by marste »

chernandezba wrote: Sun Oct 22, 2017 12:18 pm Sorry I don’t understand what is this trace file about
The trace on port $35 / $53 ! :)
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZEsarUX beta 5.1

Post by chernandezba »

marste wrote: Sun Oct 22, 2017 5:17 pm

The trace on port $35 / $53 ! :)
Hi
This is an old thread but I want to follow it as I have added ZEsarUX hardware debug ports for ZX80/81 :)
I have chosen these ports 35H/53H for register/value ports, and I have added a new register port (6) to output a byte to a file. The file must be chosen from settings->debug->byte file setting

This is documented here:
https://github.com/chernandezba/zesarux ... isters.txt


And I have created a simple ZX81 test program to do the outs:
https://github.com/chernandezba/zesarux ... xi-ports.p

These two files are (of course) included on the ZEsarUX source code.
To test it, you must compile from sources or wait to the next beta or stable ZEsarUX build.

I hope this will be useful for you (and others) ;)

Regards
Cesar
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZEsarUX beta 5.1

Post by marste »

Wow, you really "expanded" the concept, nice!!! :))
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZEsarUX beta 5.1

Post by chernandezba »

marste wrote: Wed Apr 04, 2018 6:11 pm Wow, you really "expanded" the concept, nice!!! :))
Thanks :)
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZEsarUX beta 5.1

Post by marste »

chernandezba wrote: Mon Apr 02, 2018 8:02 pm And I have created a simple ZX81 test program to do the outs:
https://github.com/chernandezba/zesarux ... xi-ports.p
Ciao Cesar, long time have passed but we are doing retrocomputing for a reason, aren't we? :)

I was trying to use the feature (and took me some time to convert my old logging) but seems not working and your test program doesn't exist anymore.

The code I'm using is:

Code: Select all

    ld a,6
    out (0x35),a
    ld a,"H"
    out (0x53),a
And to run the program:

Code: Select all

/opt/zesarux/zesarux --hardware-debug-ports --hardware-debug-ports-byte-file ./debug.dump \
                     --machine ZX81 --zx8081mem 2 myprog.p
This should write one character, but no file (debug.dump) is being produced, nor is extended if I pre-create it empty.

For completeness I'm using Linux (Manjaro fully updated) and last version of zesarux available in AUR (9.1).
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZEsarUX beta 5.1

Post by chernandezba »

the example program is here:

https://github.com/chernandezba/zesarux ... xi-ports.p

All the extras folder were moved to another repo some time ago

My example program still works

I think I know your problem, your out can NOT be done as out (n),a, you must use out (c),a , as my ports are exactly 0035h and 0053h, not XX35H nor XX53H

My sample program does:


4082 LD BC,0035
4085 LD A,06
4087 OUT (C),A
4089 LD BC,0053
408C LD A,08 (or whatever the value)
408E OUT (C),A
4090 RET

Cheers
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
Post Reply