#
✕ nick:marcan
#asahi-dev · 2021-10-29 14:58
marcanah wait, there was one more register
#asahi-dev · 2021-10-29 14:57
marcan:-)
#asahi-dev · 2021-10-29 14:57
marcanpovik: and this is how you reverse an NCO without looking at the kext
#asahi-dev · 2021-10-29 14:56
marcanwhich means there's an inverse relationship, if r2 is 2*r1, then it spends half as long at 0.5, so the overall div is 0.16666
#asahi-dev · 2021-10-29 14:55
marcanso the first register is the increment for the ddiv = +0 state, and the second for the ddiv = +0.5 state
#asahi-dev · 2021-10-29 14:54
marcanand that's all of the data registers then, reg0 is presumably control, might want to poke around the bits there at some point
#asahi-dev · 2021-10-29 14:53
marcanand the flip-frop drives an LSB's worth of divider
#asahi-dev · 2021-10-29 14:53
marcanyeah, so any time the top bit of the accumulator toggles, the flip-flop toggles
#asahi-dev · 2021-10-29 14:52
marcanhm, sec
#asahi-dev · 2021-10-29 14:52
marcanso basically the logic would be a state flip-flop driving a mux that selects the increment register
#asahi-dev · 2021-10-29 14:50
marcanok, so small values take a while to converge, which tells me these are accumulator increments indeed
#asahi-dev · 2021-10-29 14:45
marcanpretty sure it's error
#asahi-dev · 2021-10-29 14:44
marcanhow long to be +0.5 and how long not to
#asahi-dev · 2021-10-29 14:44
marcanso it's just two periods
#asahi-dev · 2021-10-29 14:43
marcanyeah, I was about to say...
#asahi-dev · 2021-10-29 14:40
marcanjix: so basically (1 - 1 / (1 - (r1 / r2))) / 2
#asahi-dev · 2021-10-29 14:39
marcanthere may be some measurement error, or the other register is messing with things
#asahi-dev · 2021-10-29 14:34
marcanand yes it does that
#asahi-dev · 2021-10-29 14:34
marcanwhich is another register
#asahi-dev · 2021-10-29 14:34
marcan0xff9f5200 is -0x60ae00
#asahi-dev · 2021-10-29 14:30
marcanthe other registers are related
#asahi-dev · 2021-10-29 14:30
marcanahh wait
#asahi-dev · 2021-10-29 14:27
marcanwhy a factor of 3 then though :D
#asahi-dev · 2021-10-29 14:27
marcanit might just... yeah that
#asahi-dev · 2021-10-29 14:25
marcanactually 22.6 matches even better
#asahi-dev · 2021-10-29 14:20
marcanthe sqrt(2) factor there bothers me
#asahi-dev · 2021-10-29 14:20
marcan(equivalent)
#asahi-dev · 2021-10-29 14:20
marcanjix: 0.5 - 0.5 / ((reg / (2**22.5)) + 1) makes more sense
#asahi-dev · 2021-10-29 14:08
marcanbut this does not match what I expect from a phase accumulator
#asahi-dev · 2021-10-29 14:08
marcanI would expect further fractions to be the phase accumulator thing
#asahi-dev · 2021-10-29 14:08
marcanwe know the half-integer part is that counter
#asahi-dev · 2021-10-29 14:08
marcanit's supposed to be an NCO
#asahi-dev · 2021-10-29 14:07
marcanchadmed: I mean the noise is just in my measurement
#asahi-dev · 2021-10-29 14:07
marcanjix: I wonder how that comes about from the implementation...
#asahi-dev · 2021-10-29 14:06
marcanmagic numbers suck
#asahi-dev · 2021-10-29 14:06
marcanmaybe, but there's no good reason to hardcode it when we know the formula
#asahi-dev · 2021-10-29 14:03
marcanthere's error in the measurement
#asahi-dev · 2021-10-29 14:03
marcanyes, the small ones are noisy
#asahi-dev · 2021-10-29 14:00
marcanit's a weird S shape in a log plot
#asahi-dev · 2021-10-29 13:40
marcanpovik, jix: want to take a crack at this relation for the NCO fractional part register? https://mrcn.st/p/8L7N8zW5
#asahi-dev · 2021-10-29 13:24
marcanI think it's probably a delta for the accumulator or so
#asahi-dev · 2021-10-29 13:24
marcanpovik: the next register is the fractional part, but it's also not just a straight thing
#asahi-dev · 2021-10-29 13:15
marcanyes but it feels very silly for this ;)
#asahi-dev · 2021-10-29 13:11
marcanthis is a kernel driver, not going to use NEON for this
#asahi-dev · 2021-10-29 13:10
marcanheh, yeah, table it is then
#asahi-dev · 2021-10-29 13:05
marcanI'm not sure where the 4.25 thing comes from, probably other registers
#asahi-dev · 2021-10-29 13:04
marcanignore the last stuff, the div calculation is what matters
#asahi-dev · 2021-10-29 13:04
marcanmatches all of them fine
#asahi-dev · 2021-10-29 13:04
marcanthat calculates the lookup table and then computes the divider based on the reg value
#asahi-dev · 2021-10-29 13:04
marcanpovik: https://mrcn.st/p/EfCm5k8t

plus ›