ucb-bar / dsptools

A Library of Chisel3 Tools for Digital Signal Processing
Apache License 2.0
221 stars 38 forks source link

PaperProject Details #112

Open chick opened 6 years ago

chick commented 6 years ago

Branches

project branch
firrtl intervals
chisel3 interval-type-2
firrtl-interpreter instrumenting-sizes
shunshou commented 6 years ago

@azidar What do you expect should happen in these cases?

1) Directly assign a <= b where a has known range that's smaller than b. Should that be an error without explicit b.wrap(a), b.clip(a), or b.assignInterval(a)? Also, re: back-propagation of ranges, if b has some smaller bound and b <= x - y, I assume you can't make any assumptions about the ranges of x and y. However, if you've constrained x and y to be only positive and use only multiply and add ops i.e. b <= x + y, you can further optimize x and y ranges -- should be min(x_range, b_range). That's not something the tool should be able to figure out, maybe? But it'd be nice to have some optional Firrtl pass go and trim widths that way, maybe (unless synthesis tools are smart about that). More generally, does a always keep its range if known or will it take on b's range if b's range is smaller?

2) Directly assign a <= b where a's bp = 5 and b's bp = 12 (both known). You're losing precision, which means that your interval also changes. In that case, before range inference, it might make sense to explicitly add b.bpset(a)? -- Otherwise, you're propagating the wrong ranges, which potentially accumulates and becomes probelamtic.


Looks like a always keeps a's range...

shunshou commented 6 years ago

@chick @azidar @grebe fyi firrtl is on intervals-oct2 now.

shunshou commented 6 years ago

@chick @grebe -- Intervals type classes should hopefully be in a workable state, so can actually really start using them. QOR for the firrtl output looks like what I calculated + the firrtl-interpreter sims got the right mins + maxes for the one test I paid closest attention to. I'm going to port over my testing infrastructure from my local repo to dsptools so hopefully it'll be easier for you to play with stuff. Should be up in the next hour or so? Then I'll go and try more complicated circuits and run them through some real synthesis tool.