diff options
| author | Julian Blake Kongslie | 2021-03-24 08:35:07 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2021-03-24 08:50:57 -0700 |
| commit | 5c1df6d27f5dac143efc9ce84689b863dbee45bd (patch) | |
| tree | 9bb9c9bcab00e7d5a5d1b40467d8e5a810f0b706 /fibseq.sv | |
| parent | Clean before building. (diff) | |
| download | toycpu-5c1df6d27f5dac143efc9ce84689b863dbee45bd.tar.xz | |
Reorganize repo layout to make it a little easier to work within.
Diffstat (limited to 'fibseq.sv')
| -rw-r--r-- | fibseq.sv | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/fibseq.sv b/fibseq.sv deleted file mode 100644 index 752c0b6..0000000 --- a/fibseq.sv +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | `include "utils.svh" | ||
| 2 | |||
| 3 | module fibseq | ||
| 4 | #( BITS = 8 | ||
| 5 | ) | ||
| 6 | ( input bit clk | ||
| 7 | , input bit reset | ||
| 8 | |||
| 9 | , input bit ready `define ready `past(ready) | ||
| 10 | , output bit valid | ||
| 11 | , output bit [BITS-1:0] data | ||
| 12 | ); | ||
| 13 | |||
| 14 | bit [BITS-1:0] a; | ||
| 15 | bit [BITS-1:0] b; | ||
| 16 | |||
| 17 | always_ff @(posedge clk) begin | ||
| 18 | if (reset) begin | ||
| 19 | valid = 0; | ||
| 20 | a = 0; | ||
| 21 | b = 1; | ||
| 22 | end else begin | ||
| 23 | if (`ready) valid = 0; | ||
| 24 | if (!valid) begin | ||
| 25 | valid = 1; | ||
| 26 | data = a; | ||
| 27 | {a, b} = {b, a + b}; | ||
| 28 | end | ||
| 29 | end | ||
| 30 | end | ||
| 31 | |||
| 32 | endmodule | ||
