Comments (3)
Alternative proposal: If shrink
forces the step size to be the same as the width, the compilation looks like:
decl a: bit<10>[16 bank 8];
decl b: bit<10>[8];
for (let i = 0..8) {
view v_a = shrink a[i:2]
b[i] = v_a[0] + 2*v_a[1]
}
compiles to:
for (let i = 0..8) {
b[i] = v_a[4*i + 0] + 2*v_a[4*i + 1];
}
I propose that we have the explicit syntax:
view v_a = shrink a[4 * i: 4];
where the programmer explicitly specifies 4 * i
for the offset and 4
for the width. I think it would reduce mistakes like:
for (let i = 0..12) { // 12 will be OOB!
view v_a = shrink a[i:2]
b[i] = v_a[0] + 2*v_a[1]
}
Especially since we don't do any static bounds checking.
from dahlia.
-
I don't see any immediate problems with any of these three—they all seem like they should probably be fine? It could help to try drawing the "hardware interposer" for each to make sure they seem to have roughly predictable cost.
-
I think those restrictions make sense, yes.
-
Some rough ideas, based on previous discussions:
let v = view a[0..+5]; // v is a view on a with offset 0 and width 5 let a' = shrink a: int[10 bank 5]; // a' is like a, but with banking factor 5 let a' = shrink a: int[10 bank 5][10 bank 5]; // for multi-dimensional arrays
flex
could work the same way. The idea behind theshrink
syntax is that it might be nice, for clarity, to write out the new type of the "adapted" memory.
from dahlia.
Tracking in #124.
from dahlia.
Related Issues (20)
- `--lower` flag handling memory parameters incorrectly.
- Double imports for FuTIL backend HOT 5
- Using fixed point in futil imports or function definitions doesn't work. HOT 3
- Fixed point division not using correct primitive. HOT 1
- Support reverse range iteration HOT 1
- Remove fixed point constants from Dahlia.
- Hoist slow binops incorrectly hoists
- Current Fixed Point Constant Implementation parses numbers incorrectly.
- Multi-cycle binary operations emit incorrect `write_en` guard.
- UnrollBank doesn't re-write same local variable names in different definitions.
- Add `@bound` attribute for loops with statically known bounds. HOT 1
- [Calyx] Don't generate conflicting assignments when lowering unrolled loops
- `split` views not lowered correctly
- [Calyx] Generate non-combinational reads for memories HOT 2
- Support for Constants and Dynamic Loops HOT 4
- Typechecker isSubtype does not handle alias type
- Typechecker Issue HOT 3
- Split views bypass typechecker and allow incorrect loop unrolling
- Parse error in let expression for bitwidth 32 and above
- Test has incorrect lowering HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dahlia.