-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences with Nuked-OPM #12
Comments
I double-checked the noise block in the die shot, and I was not able to found any problems with my schematics yet. First, let's look at the LSFR's initialization circuits. Note that Evey dynamic shift register bits of the LFSR have complementary outputs. Q passes the value to the next register, and /Q connects to a 17-input NOR(wired-OR+INV in the photo). Since the input was negative logic, Q is also negative logic, and /Q is positive logic. Since the NOTP inverts Q of MCYC0 DFF, Q of MCYC1 DFF and MCYC2 DFF is positive logic. Anyway, they are all positive logic, and they connected to a 17-input NOR. Here they mean When the output of the 17-input NOR becomes 1, the output of NOR2 becomes 0. Let's look at the first picture again. The output of NOR2 is connected to the NOR3. In normal operation, MRST = 0, and the value of MCYC17-00 DFF is 1 during the LFSR value update period. Then all inputs of the NOR3 will be 0, and the output will be 1. If the output of the NOR3 is 1, the output of the AOI21 will be 0. I assumed in the first paragraph that the polarity of the LFSR's input is negative logic, so we can think of the LFSR as having a input value 1. IKAOPM/HDL/IKAOPM_modules/IKAOPM_noise.v Line 64 in 7cea2df
I haven't read nukeykt's code. He might have written his code with the output of the taps in the LFSR as negative logic. |
In the register-to-register connections of all YM2XXX FM chips, the polarity of the data changes every time it passes through a single DFF+comb logic. Very confusing and annoying. Many nets of the schematics are annotated with positive and negative logic. |
You can use I will review Nuked's code after your comments above |
Yesterday, when I replied, it was over 2 am in my local time. I took another look at the die shot during the day today and didn't find anything that contradicts what I said yesterday. I'll keep the issue open anyway. |
I reviewed the nukeykt's code, and the behavior of his C code and my Verilog code is exactly the same, except that he implemented all the circuits "as is", and I implemented them with some polarity changes. They are simply differences in intermediate data polarity. I will close the case. |
Thank you |
A quick check has revealed some differences between your code and Nuked's. For instance:
https://github.com/ika-musume/IKAOPM/blob/7cea2dfc242154f9aff333180f29f4a854454e76/HDL/IKAOPM_modules/IKAOPM_noise.v#L64C58-L64C69
And
https://github.com/nukeykt/Nuked-OPM/blob/a0ab44be60cb28b68431779829454ddf3284f272/opm.c#L1265
where he is comparing the LFSR with all 1's and you are comparing with all 0's. His implementation is also based on a die shot so I don't know which one is the right one. I'm opening up the issue here, as I have talked with you more recently.
I think there are other small differences in how the noise is generated between the two of you.
The text was updated successfully, but these errors were encountered: