Project

General

Profile

Actions

Feature #84

open

Add SID

Added by foft over 4 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
11/09/2019
Due date:
% Done:

0%

Estimated time:

Description

Agreed to try adding a SID to the pokeymax.

Eclaire is a good test bed for this, so starting out with that


Files

sidbits.tar.bz2 (148 KB) sidbits.tar.bz2 foft, 11/17/2019 09:10 PM
Actions #1

Updated by foft over 4 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by foft over 4 years ago

Have a dual 8250 working, though it doesn't fit in the smaller boards. Investigating why, memory or logic...

Actions #3

Updated by foft over 4 years ago

Logic utilization (in ALMs) 9,808 / 9,430 ( 104 % )

Actions #4

Updated by foft over 4 years ago

600 alms each, will use mono sid I guess. Or make it a generic and enable on the larger boards?

Actions #5

Updated by foft over 4 years ago

Also got this potential USB sharing, that'd save 750 ALMS. Each request/reply is host initiated, so no reason can't share one. Keepalives would need to go to both ports. Not sure how complex that'd be! Perhaps I plumb the output to both, with a mux for when I send explicit in/out requests?

Actions #6

Updated by foft over 4 years ago

Actually the issue with fitting in v2 is block ram, not ALMs. Though its always good to save ALMs!

The sid tables take 14KB each. So for stereo sid its 28KB. Anyway I do not even have 14KB to spare on v2...

Actions #7

Updated by foft over 4 years ago

I loaded the tables in to octave to take a look.

Observations...
  • Not a simple curve
  • Lots of zeros, >80% in some cases
  • Quite a lot of dupes

dupes:

log2(numel(unique(ps)))

ans = 6.5699

log2(numel(unique(st)))

ans = 4.7549

log2(numel(unique(p_t)))

ans = 5.8074

log2(numel(unique(pst)))

ans = 4.5850

zeros:

sum(ps==0)/numel(ps)

ans = 0.63379

sum(st==0)/numel(st)

ans = 0.86743

sum(p_t==0)/numel(p_t)

ans = 0.58545

sum(pst==0)/numel(pst)

ans = 0.89331

Actions #8

Updated by foft over 4 years ago

Wondering about some kind of bit map of unpopulated locations (reducing locations) or a 2nd lookup layer (reducing bits)

Actions #9

Updated by foft over 4 years ago

Also wondering if the clk frequency is important (not enable), I see some state table increment on every clock, which is reset on enable

Actions #10

Updated by foft over 4 years ago

It sounds good to me, but not sure what it is meant to sound like!!

Actions #11

Updated by foft over 4 years ago

Did some research over the weekend. Generating these isn't a terribly trivial problem!

I tried for some time to generate in matlab. I came up with a pretty good solution for wave 3: triangle + sawtooth. Actually its sawtooth + 2 sawtooth since the triangle is inverted. Anyway this worked pretty well:
tmp = zeros(size(a));
for k=1:12
pre =k-4;
post = k;
if pre<1
pre = 1;
end
if post>12
post = 12;
end
idx = pre:post;
if a(idx) == b(idx);
tmp(k) = b(k);
end
end
i.e. and and if in conflict, ground the 4 adjacent bits.

Was struggling with the pulse + triangle one, now come up with an easy answer for that one yet!

Anyway found some description of what is going on in the libsidplayfp + some functions to generate:
libsidplayfp-2.0.1/src/builders/residfp-builder/residfp/WaveformCalculator.cpp

Also the wave files are here:
https://bel.fi/alankila/c64-sw/combined-waveforms/sidwaves/

Actions #12

Updated by foft over 4 years ago

Attaching some of the octave files from investigating this for reference + the wave files + other useful bits I found online.

Actions #13

Updated by foft over 3 years ago

I have implemented my own better sid core now which I will back-port to Eclaire.

Actions

Also available in: Atom PDF