Skip to content

Commit 4cb0c74

Browse files
committed
aetherling interface change
1 parent dbe2c12 commit 4cb0c74

File tree

5 files changed

+51
-3
lines changed

5 files changed

+51
-3
lines changed

apps/aetherling/common/fast-interface.fil

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ comp Conv2dAbstract<'G: 1>(
2727
/// 16 inputs at the same time and exactly for one cycle.
2828
comp Wrapper<'G: II>(
2929
valid_up: interface['G],
30-
I[16]: ['G, 'G+1] 8
30+
I[16]: ['G, 'G+H] 8
3131
) -> (
3232
O[16]: ['G+L, 'G+L+1] 8
3333
) with {
34+
some H where H == 1;
3435
/// The latency of the module
3536
some L where L > 0;
3637
/// The initiation interval of the module
@@ -72,6 +73,8 @@ comp Wrapper<'G: II>(
7273

7374
// The II is limited by the speed at which the convolution can process the inputs.
7475
II := 16/C::N;
76+
77+
H := 1;
7578
}
7679

7780
// The main component has the same interface for each design
@@ -134,4 +137,4 @@ comp main<'G: II>(
134137

135138
L := W::L;
136139
II := W::II;
137-
}
140+
}

apps/aetherling/common/slow-interface.fil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ comp main<'G: II>(
132132
L := W::L;
133133
II := W::II;
134134
H := W::H;
135-
}
135+
}

primitives/param-funcs.fil

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,17 @@ comp BitsNeeded[N]<'G:1>() -> () with {
1212
let Bits = log2(N)+1; assume Bits > 0;
1313
Out := Bits;
1414
}
15+
16+
/// Return the parameter that is the maximum of A or B.
17+
comp Max[A, B]<'G:1>() -> () with {
18+
some Out where Out == if A > B { A } else { B };
19+
} {
20+
Out := if A > B { A } else { B };
21+
}
22+
23+
/// Return the parameter that is the minimum of A or B.
24+
comp Min[A, B]<'G:1>() -> () with {
25+
some Out where Out == if A > B { B } else { A };
26+
} {
27+
Out := if A > B { B } else { A };
28+
}

primitives/reshape.fil

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ comp Deserialize[W, N, B, ?C=1, ?H=1]<'G: End-1>(
103103
}
104104
}
105105

106+
106107
/// Take a bundle of length L that produces values every N and cycles and make
107108
/// it produce values every M cycles where M > N.
108109
comp Downsample[N, M, L, W]<'G: (M-N)*L>(

primitives/state.fil

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,36 @@ comp Shift[W, D, ?N=1]<'G: 1>(
7777
}
7878
/* ANCHOR_END: shift */
7979

80+
/// Shift 2D bundle of signals
81+
comp Shift2D[W, D0, D1, ?N=1]<'G:1>(
82+
in[D0][D1]: ['G, 'G+1] W
83+
) -> (
84+
out[D0][D1]: ['G+N, 'G+N+1] W
85+
) where W > 0, D0 > 0, D1 > 0, N > 0 {
86+
for i in 0..D0 {
87+
for j in 0..D1 {
88+
s := new Shift[W, N]<'G>(in{i}{j});
89+
out{i}{j} = s.out;
90+
}
91+
}
92+
}
93+
94+
/// Hold 2D bundle of signals active for multiple cycles.
95+
comp Strech2D[W, D0, D1, H]<'G:H>(
96+
en: interface['G],
97+
in[D0][D1]: ['G, 'G+1] W
98+
) -> (
99+
out[D0][D1]: ['G+1, 'G+H+1] W
100+
) where W > 0, D0 > 0, D1 > 0, H > 0 {
101+
for i in 0..D0 {
102+
for j in 0..D1 {
103+
r := new Register[W]<'G, 'G+H+1>(in{i}{j});
104+
out{i}{j} = r.out;
105+
}
106+
}
107+
}
108+
109+
80110
// A counter that counts up by one every time `en` is asserted and resets
81111
// when it reaches the value `N`.
82112
comp Counter[W, N]<'G:1>(

0 commit comments

Comments
 (0)