VOGONS


Disable x86 prefetcher?

Topic actions

First post, by picmaster

User metadata
Rank Newbie
Rank
Newbie

Is there a way to disable the instruction prefetcher on actual x86 (ia32) cpu? This (maybe?) will force the cpu to fetch instructions like Z80, so actual instruction execution can be traced physically on the cpu buses, and instructions can be easily profiled for documentation/emulation purposes.

I personally doubt it somewhat, as the ISA is so f....ed-up (with instructions being 1-15 bytes) and different x86 cpus have 8-64 bits data buses, so such execution will be traumatizingly slow, but for debug/analysis purposes seems pragmatic. I know about the branch trace messages (rumors have it that even 386 supports it via undocumented DR7 bits), but they're still implicit way of observing/measuring execution.

Reply 1 of 1, by GloriousCow

User metadata
Rank Oldbie
Rank
Oldbie

no, the prefetch and instruction queues are fundamental components you can't disable.

On the 8088 and 8086 at least, you can track the contents of the instruction queue via the QS0 and QS1 status lines, which lets you detect instruction boundaries.
I attempted to enable branch traces messages on the 386EX but it just hangs. I think an ICE may be required.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc