Skip to content
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

About the ADPCM's active5 signal. #73

Open
kunichiko opened this issue Jul 11, 2023 · 1 comment
Open

About the ADPCM's active5 signal. #73

kunichiko opened this issue Jul 11, 2023 · 1 comment
Assignees
Labels

Comments

@kunichiko
Copy link

I have a question about the HDL code on this line.

wire active5 = (en_ch[1] && cur_ch[4]) || (en_ch[2] && cur_ch[5]) || (en_ch[2] && cur_ch[0]) || (en_ch[3] && cur_ch[1]) || (en_ch[4] && cur_ch[2]) || (en_ch[5] && cur_ch[3]);//{ cur_ch[3:0], cur_ch[5:4] } == en_ch;

This combinational logic looks asymmetric. Because..

(en_ch[1] && cur_ch[4])   ← diff = 3
(en_ch[2] && cur_ch[5])  ← diff = 3
(en_ch[2] && cur_ch[0])  ← diff = 4
(en_ch[3] && cur_ch[1])  ← diff = 4
(en_ch[4] && cur_ch[2])  ← diff = 4
(en_ch[5] && cur_ch[3])  ← diff = 4

Of course, I haven't fully understood the pipeline logic, but I believe this logic is incorrect.

Could you please inform me if there are any reasons why it is asymmetric?

@jotego jotego self-assigned this Jul 11, 2023
@jotego
Copy link
Owner

jotego commented Jul 11, 2023

I didn't make that change. That line looks wrong indeed, it isn't using bit 0 in en_ch either...

After I released JT10, MiSTer developers tinkered with it independently and I lost track of some of the edits. This is marked in MiSTer's repo as an experimental change:

https://github.com/MiSTer-devel/NeoGeo_MiSTer/blame/master/rtl/jt12/hdl/adpcm/jt10_adpcm_cnt.v#L74

I have raised the question in MiSTer's repo, let's wait and see. I think en_ch[0] should be used instead of using twice en_ch[2]. I would try this instead:

 wire active5 =  |({ cur_ch[3:0], cur_ch[5:4] }&en_ch); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants