Comments (8)
Yeah. To do more elaborate testing I'm pretty sure we need to speed up the process in general. Even if running in (system) parallel as you wrote before setup per instruction is fairly heavy now and would be even more effect if we have cases where we do more "elaborate" addressing mode testing.
from r68k.
Progress has been made on this. I rewrote the memory model for the Musashi memory callbacks this weekend to use indirection. This means that instead of having a static 16MB array for these functions to read and write from, we just store "wrote 68 to adress 0x7612" and so on.
This not only shaves 16MB off the executable size, but also removes the restriction where (test) code had to live in the first 1K of memory, as only that much was copied between cores during clone etc. for performance reasons. We now only copy the diffs, wherever they might be located in memory, which is much more efficient as well.
Not quite ready to push that yet, though, I also want to ensure QC tests can set a random u32 used as the default memory fill (providing data for all memory locations where nothing has been written yet)
from r68k.
Nice :)
from r68k.
Just pushed the results of this refactoring. Now both memory and registers are filled with a random value, where all 32 bits are random. This does a much better job of exposing implementation differences, but also causes a lot more address-errors, due to word/long memory access at odd addresses.
This exposed us to two issues in Musashi. First, if an instruction causes an address error, apparently Musashi does exception processing, and also executes the first user instruction in the handler (the one the exception vector points to). r68k stops execution after exception processing, before executing any further instructions. As we haven't actually set up the vectors to point to anything, Musashi is basically just asked to execute a random instruction, which corrupts the state we want to compare. For now, I just ask QC to discard the result of that test when this happens (after checking that the memory accesses up to and including reading the vector match up).
Secondly, I think I found a initialization bug in Musashi; when the "random instruction" executed causes a different exception setting the "exception processing" flag, that flag isn't reset when resetting Musashi to prepare for a different test - and a subsequent address error then pushes this flag onto the stack. I've included a patched Musashi here, but haven't had the energy to do a PR.
from r68k.
Perhaps we can setup all vectors to point to a NOP handler, when we have implemented NOP, and then allow r68k to continue one step further, if we want to compare states, but I'm not sure that would test the intended instruction much beyond noticing if flags are set before or after memory accesses.
from r68k.
Yeah I'm not sure what the best approach would be here
from r68k.
This has been fixed, most recently by this PR fixing the issue where Musashi if an instruction causes address error, kept executing one or more instructions in the address error exception handler, even though the address error processing already depleted all available cycles.
from r68k.
👍
from r68k.
Related Issues (20)
- Implement TRAPV HOT 1
- Implement TST HOT 1
- Implement UNLK HOT 1
- Diff MAME version of Musashi with current HOT 29
- Compiler gets stuck when building release HOT 17
- Use default for Cpu struct
- More accurate cycle emulation for DIVS/DIVU needed?
- CHK, DIVU, DIVS trap case cycles differs from Musashi HOT 6
- Streamline qc and op_handler macros HOT 1
- Improve performance during QC HOT 27
- Use a logging framework HOT 1
- Disassembler HOT 27
- Implement opcode completeness test HOT 5
- Consider using a codegen for glue HOT 2
- Generating cycle tables HOT 23
- Turn r68k into a lib HOT 14
- Host callbacks HOT 11
- Share fuzz testing code HOT 3
- fuzix HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r68k.